2019-10-23 11:34:40 +02:00
|
|
|
.PHONY: all clean test testclient 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 09:39:40 +02:00
|
|
|
CFLAGS += -O3 -std=c11 -pthread -D_POSIX_SOURCE -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`
|
2016-09-22 20:40:58 +02:00
|
|
|
|
2019-10-23 13:18:51 +02:00
|
|
|
OBJS := luksrku.o editor.o util.o log.o keydb.o file_encryption.o uuid.o argparse_edit.o pgmopts.o openssl.o server.o argparse_server.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
|
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
|
|
|
|
|
|
|
test: luksrku
|
2018-01-16 18:59:50 +01:00
|
|
|
./luksrku -v --server-mode -k server_key.bin
|
2016-09-22 20:40:58 +02:00
|
|
|
|
|
|
|
gdb: luksrku
|
2018-01-16 18:59:50 +01:00
|
|
|
gdb --args ./luksrku -v --server-mode -k server_key.bin
|
2016-09-22 20:40:58 +02:00
|
|
|
|
|
|
|
testclient: luksrku
|
2018-01-16 18:59:50 +01:00
|
|
|
./luksrku -v --client-mode -k client_keys.bin
|
2016-09-22 20:40:58 +02:00
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
luksrku: $(OBJS)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
|