aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-06-26 10:26:52 -0400
committerRob Austein <sra@hactrn.net>2016-06-26 10:26:52 -0400
commit64e5fe8edec2c4ba461e712d6fbd05d47d5a9192 (patch)
tree5aea327aeab4c5946d286b965cc53bfe3edef6f7 /utils
parent2cd3b6fabe5e32f169257caf5532b2bf9c83f803 (diff)
Update libhal makefiles to use new LIBxxx_SRC / LIBxxx_BLD scheme so libhal can find tfm.h again.
Diffstat (limited to 'utils')
-rw-r--r--utils/Makefile24
1 files changed, 17 insertions, 7 deletions
diff --git a/utils/Makefile b/utils/Makefile
index 5e64449..ce36d4c 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -27,19 +27,29 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-INC = ../hal.h
-LIB = ../libhal.a
-BIN = eim_peek_poke cores
+ifndef CRYPTECH_ROOT
+ CRYPTECH_ROOT := $(abspath ../../..)
+endif
-CFLAGS ?= -g3 -Wall -fPIC -std=c99 -I..
+LIBTFM_SRC ?= ${CRYPTECH_ROOT}/sw/thirdparty/libtfm
+LIBTFM_BLD ?= ${LIBTFM_SRC}
-all: $(if $(wildcard ../hal_io_eim.o),eim_peek_poke) $(if $(wildcard ../core.o),cores)
+LIBHAL_SRC ?= ${CRYPTECH_ROOT}/sw/libhal
+LIBHAL_BLD ?= ${LIBHAL_SRC}
+
+LIBS = ${LIBHAL_BLD}/libhal.a ${LIBTFM_BLD}/libtfm.a
+
+CFLAGS ?= -g3 -Wall -fPIC -std=c99 -I${LIBHAL_SRC} -I${LIBTFM_BLD}
+
+BIN = eim_peek_poke cores
+
+all: $(if $(wildcard ${LIBHAL_BLD}/hal_io_eim.o),eim_peek_poke) $(if $(wildcard ${LIBHAL_BLD}/core.o),cores)
clean:
rm -f *.o ${BIN}
-${BIN}: %: %.o ${LIB}
+${BIN}: %: %.o ${LIBS}
${CC} ${CFLAGS} -o $@ $^ ${LDFLAGS}
-%.o: %.c ${INC}
+%.o: %.c ${LIBHAL_SRC}/*.h
${CC} ${CFLAGS} -c -o $@ $<