2019-10-23 21:13:50 +02:00
|
|
|
.PHONY: all clean test_s test_c install parsers
|
2019-10-23 09:39:40 +02:00
|
|
|
all: luksrku
|
2016-09-22 20:40:58 +02:00
|
|
|
|
2019-10-19 15:06:39 +02:00
|
|
|
BUILD_REVISION := $(shell git describe --abbrev=10 --dirty --always --tags)
|
2016-09-22 20:40:58 +02:00
|
|
|
INSTALL_PREFIX := /usr/local/
|
2019-10-19 14:47:54 +02:00
|
|
|
CFLAGS := -Wall -Wextra -Wshadow -Wswitch -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Werror=implicit-function-declaration -Werror=format -Wno-unused-parameter
|
2019-10-23 21:13:50 +02:00
|
|
|
CFLAGS += -O3 -std=c11 -pthread -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500 -DBUILD_REVISION='"$(BUILD_REVISION)"'
|
2019-10-19 14:47:54 +02:00
|
|
|
CFLAGS += `pkg-config --cflags openssl`
|
2019-10-23 15:28:38 +02:00
|
|
|
CFLAGS += -ggdb3 -DDEBUG -fsanitize=address -fsanitize=undefined -fsanitize=leak
|
2019-10-23 11:34:40 +02:00
|
|
|
PYPGMOPTS := ../Python/pypgmopts/pypgmopts
|
2019-10-19 14:47:54 +02:00
|
|
|
|
|
|
|
LDFLAGS := `pkg-config --libs openssl`
|
2019-10-25 12:19:01 +02:00
|
|
|
TEST_PREFIX := local
|
2016-09-22 20:40:58 +02:00
|
|
|
|
2019-10-23 22:31:41 +02:00
|
|
|
OBJS := \
|
|
|
|
argparse_client.o \
|
|
|
|
argparse_edit.o \
|
|
|
|
argparse_server.o \
|
2019-10-25 10:21:29 +02:00
|
|
|
blacklist.o \
|
2019-10-23 22:31:41 +02:00
|
|
|
client.o \
|
|
|
|
editor.o \
|
2019-10-25 12:19:01 +02:00
|
|
|
exec.o \
|
2019-10-23 22:31:41 +02:00
|
|
|
file_encryption.o \
|
|
|
|
keydb.o \
|
|
|
|
log.o \
|
2019-10-25 12:19:01 +02:00
|
|
|
luks.o \
|
2019-10-23 22:31:41 +02:00
|
|
|
luksrku.o \
|
|
|
|
openssl.o \
|
|
|
|
pgmopts.o \
|
|
|
|
server.o \
|
|
|
|
signals.o \
|
|
|
|
thread.o \
|
2019-10-24 19:03:48 +02:00
|
|
|
udp.o \
|
2019-10-23 22:31:41 +02:00
|
|
|
util.o \
|
|
|
|
uuid.o
|
2019-10-23 11:34:40 +02:00
|
|
|
|
|
|
|
parsers:
|
|
|
|
$(PYPGMOPTS) -n edit parsers/parser_edit.py
|
2019-10-23 13:18:51 +02:00
|
|
|
$(PYPGMOPTS) -n server parsers/parser_server.py
|
2019-10-23 20:13:25 +02:00
|
|
|
$(PYPGMOPTS) -n client parsers/parser_client.py
|
2016-09-22 20:40:58 +02:00
|
|
|
|
|
|
|
install: all
|
2019-10-23 09:39:40 +02:00
|
|
|
cp luksrku $(INSTALL_PREFIX)sbin/
|
|
|
|
chown root:root $(INSTALL_PREFIX)sbin/luksrku
|
|
|
|
chmod 755 $(INSTALL_PREFIX)sbin/luksrku
|
2016-09-22 20:40:58 +02:00
|
|
|
|
|
|
|
clean:
|
2019-10-23 09:39:40 +02:00
|
|
|
rm -f $(OBJS) $(OBJS_CFG) luksrku
|
2016-09-22 20:40:58 +02:00
|
|
|
|
2019-10-23 21:13:50 +02:00
|
|
|
test_s: luksrku
|
2019-10-25 12:19:01 +02:00
|
|
|
./luksrku server -vv testdata/$(TEST_PREFIX)_server.bin
|
2016-09-22 20:40:58 +02:00
|
|
|
|
2019-10-23 21:13:50 +02:00
|
|
|
test_c: luksrku
|
2019-10-25 12:19:01 +02:00
|
|
|
./luksrku client -vv --no-luks testdata/$(TEST_PREFIX)_client.bin
|
2016-09-22 20:40:58 +02:00
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
luksrku: $(OBJS)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
|