aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 25 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index 1479112..85a7552 100644
--- a/Makefile
+++ b/Makefile
@@ -36,10 +36,17 @@ ifndef CRYPTECH_ROOT
CRYPTECH_ROOT := $(abspath ../..)
endif
-PKCS11_DIR ?= ${CRYPTECH_ROOT}/sw/pkcs11
-LIBHAL_DIR ?= ${PKCS11_DIR}/libhal
-LIBTFM_DIR ?= ${PKCS11_DIR}/libtfm
-SQLITE3_DIR ?= ${PKCS11_DIR}/sqlite3
+PKCS11_DIR ?= ${CRYPTECH_ROOT}/sw/pkcs11
+
+LIBHAL_SRC ?= ${CRYPTECH_ROOT}/sw/libhal
+LIBHAL_BLD ?= ${PKCS11_DIR}/libhal
+
+LIBTFM_SRC ?= ${CRYPTECH_ROOT}/sw/thirdparty/libtfm
+LIBTFM_BLD ?= ${PKCS11_DIR}/libtfm
+
+SQLITE3_SRC ?= ${CRYPTECH_ROOT}/sw/thirdparty/sqlite3
+SQLITE3_BLD ?= ${PKCS11_DIR}/sqlite3
+
# Whether to enable threading. Main reason for being able to turn it
# off is that gdb on the Novena (sometimes) goes bananas when
@@ -70,8 +77,8 @@ UNAME := $(shell uname)
# Compilation flags, etc.
-CFLAGS := -g3 -fPIC -Wall -std=c99 -I${CRYPTECH_ROOT}/sw/libhal
-LIBS := ${LIBHAL_DIR}/libhal.a ${LIBTFM_DIR}/libtfm.a
+CFLAGS := -g3 -fPIC -Wall -std=c99 -I${LIBHAL_SRC}
+LIBS := ${LIBHAL_BLD}/libhal.a ${LIBTFM_BLD}/libtfm.a
ifeq "${UNAME}" "Darwin"
SONAME := libpkcs11.dylib
@@ -96,8 +103,8 @@ ifeq "${ENABLE_DEBUGGING}" "yes"
endif
ifeq "${ENABLE_OWN_SQLITE_LIBRARY}" "yes"
- CFLAGS += -I${SQLITE3_DIR}
- SOFLAGS += ${SQLITE3_DIR}/libsqlite3.a
+ CFLAGS += -I${SQLITE3_BLD}
+ SOFLAGS += ${SQLITE3_BLD}/libsqlite3.a
else
SOFLAGS += -lsqlite3
endif
@@ -110,10 +117,10 @@ all: ${SONAME} p11util py11/attribute_map.py
clean:
rm -rf *.o ${SONAME}* p11util schema.h attributes.h
- cd libtfm; ${MAKE} $@
- cd libhal; ${MAKE} $@
+ ${MAKE} -C libtfm $@
+ ${MAKE} -C libhal $@
ifeq "${ENABLE_OWN_SQLITE_LIBRARY}" "yes"
- cd sqlite3; ${MAKE} $@
+ ${MAKE} -C sqlite3 $@
endif
distclean: clean
@@ -121,14 +128,14 @@ distclean: clean
.FORCE:
-${LIBTFM_DIR}/libtfm.a: .FORCE
- cd libtfm; ${MAKE}
+${LIBTFM_BLD}/libtfm.a: .FORCE
+ ${MAKE} -C libtfm
-${LIBHAL_DIR}/libhal.a: .FORCE ${LIBTFM_DIR}/libtfm.a
- cd libhal; ${MAKE} daemon
+${LIBHAL_BLD}/libhal.a: .FORCE ${LIBTFM_BLD}/libtfm.a
+ ${MAKE} -C libhal daemon
-${SQLITE3_DIR}/libsqlite3.a: .FORCE
- cd sqlite3; ${MAKE}
+${SQLITE3_BLD}/libsqlite3.a: .FORCE
+ ${MAKE} -C sqlite3
schema.h: schema.sql scripts/convert-schema.sed Makefile
sed -f scripts/convert-schema.sed <schema.sql >schema.h
@@ -143,7 +150,7 @@ pkcs11.o: pkcs11.c schema.h attributes.h ${LIBS}
${CC} ${CFLAGS} -c $<
ifeq "${ENABLE_OWN_SQLITE_LIBRARY}" "yes"
- pkcs11.o: ${SQLITE3_DIR}/libsqlite3.a
+ pkcs11.o: ${SQLITE3_BLD}/libsqlite3.a
endif
ifeq "${UNAME}" "Darwin"