aboutsummaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-06-24 17:07:08 -0400
committerRob Austein <sra@hactrn.net>2016-06-24 17:07:08 -0400
commitdcc90e02ed381767a028638af9ead9b1e3477d34 (patch)
treea466d4a652008ced23a68d3cba4336ddd0f711d1 /GNUmakefile
parent2e95d8a357ea0cce0ef11da8520863b2d4e99936 (diff)
Support VPATH builds.
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile17
1 files changed, 13 insertions, 4 deletions
diff --git a/GNUmakefile b/GNUmakefile
index c8160a9..3e4964d 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -179,7 +179,11 @@ else ifeq "${RPC_MODE}" "client-mixed"
KS = volatile
endif
-TFMDIR := $(abspath ../thirdparty/libtfm)
+ifndef CRYPTECH_ROOT
+ CRYPTECH_ROOT := $(abspath ../..)
+endif
+
+TFMDIR ?= ${CRYPTECH_ROOT}/sw/thirdparty/libtfm
CFLAGS += -g3 -Wall -std=c99 -Wno-strict-aliasing -I${TFMDIR}
LDFLAGS += -g3 -L${TFMDIR} -ltfm
@@ -187,9 +191,14 @@ CFLAGS += -DHAL_STATIC_HASH_STATE_BLOCKS=${STATIC_HASH_STATE_BLOCKS}
CFLAGS += -DHAL_STATIC_HMAC_STATE_BLOCKS=${STATIC_HMAC_STATE_BLOCKS}
CFLAGS += -DHAL_STATIC_PKEY_STATE_BLOCKS=${STATIC_PKEY_STATE_BLOCKS}
+CFLAGS += -I${CRYPTECH_ROOT}/sw/libhal
+
+export CFLAGS
+export LDFLAGS
+
all: ${LIB}
- cd tests; ${MAKE} CFLAGS='${CFLAGS} -I..' LDFLAGS='${LDFLAGS}' $@
- cd utils; ${MAKE} CFLAGS='${CFLAGS} -I..' LDFLAGS='${LDFLAGS}' $@
+ cd tests; ${MAKE} $@
+ cd utils; ${MAKE} $@
client:
${MAKE} RPC_MODE=client-simple
@@ -225,7 +234,7 @@ test: all
cd tests; ${MAKE} -k $@
clean:
- rm -f *.o ${LIB}
+ rm -f *.o ${LIB} cryptech_rpcd
cd tests; ${MAKE} $@
cd utils; ${MAKE} $@