-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile.mk
28 lines (22 loc) · 1.04 KB
/
Makefile.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# adapt as needed:
GENCMPCL_DIR ?= ../gencmpclient
OPENSSL_DIR ?= /usr
OPENSSL_LIB ?= /lib/x86_64-linux-gnu
OUT_DIR ?= $(abspath .)
BIN_DIR ?= $(abspath .)
# mode ?= release
USE_LIBCMP ?= 1
override CFLAGS += -Wall -std=gnu99 -fPIC -D__linux__
ifeq ($(mode),release)
DEBUG_FLAGS ?= -O2
override DEBUG_FLAGS += -DNDEBUG=1
else
override DEBUG_FLAGS += -g -O0 -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all
endif
.PHONY: build clean
build:
make -C $(GENCMPCL_DIR) -f Makefile_v1 build USE_LIBCMP=$(USE_LIBCMP) OUT_DIR="$(OUT_DIR)" BIN_DIR="$(BIN_DIR)" OPENSSL_DIR="$(OPENSSL_DIR)" OPENSSL_LIB="$(OPENSSL_LIB)" CFLAGS="$(CFLAGS)" DEBUG_FLAGS="$(DEBUG_FLAGS)"
demo:
make -C $(GENCMPCL_DIR) -f Makefile_v1 demo USE_LIBCMP=$(USE_LIBCMP) OUT_DIR="$(OUT_DIR)" BIN_DIR="$(BIN_DIR)" OPENSSL_DIR="$(OPENSSL_DIR)" OPENSSL_LIB="$(OPENSSL_LIB)" CFLAGS="$(CFLAGS)" DEBUG_FLAGS="$(DEBUG_FLAGS)"
clean:
make -C $(GENCMPCL_DIR) -f Makefile_v1 clean USE_LIBCMP=$(USE_LIBCMP) OUT_DIR="$(OUT_DIR)" BIN_DIR="$(BIN_DIR)" OPENSSL_DIR="$(OPENSSL_DIR)"