aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile48
1 files changed, 25 insertions, 23 deletions
diff --git a/Makefile b/Makefile
index 51461c1..af50d13 100644
--- a/Makefile
+++ b/Makefile
@@ -28,21 +28,26 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# absolute path, because we're going to be passing things to sub-makes
-export TOPLEVEL = $(shell pwd)
+export TOPLEVEL = $(abspath .)
+export CRYPTECH_ROOT = $(abspath ../..)
# define board: dev-bridge or alpha
BOARD = TARGET_CRYPTECH_ALPHA
-#BOARD = TARGET_CRYPTECH_DEV_BRIDGE
-# Location of the Libraries folder from the STM32F4 Standard Peripheral Library
export LIBS_DIR = $(TOPLEVEL)/libraries
export MBED_DIR = $(LIBS_DIR)/mbed
export CMSIS_DIR = $(MBED_DIR)/targets/cmsis/TARGET_STM/TARGET_STM32F4
export BOARD_DIR = $(CMSIS_DIR)/$(BOARD)
export RTOS_DIR = $(MBED_DIR)/rtos
-export LIBTFM_DIR = $(LIBS_DIR)/thirdparty/libtfm
-export LIBHAL_DIR = $(LIBS_DIR)/libhal
-export LIBCLI_DIR = $(LIBS_DIR)/libcli
+
+export LIBHAL_SRC = $(CRYPTECH_ROOT)/sw/libhal
+export LIBHAL_BLD = $(LIBS_DIR)/libhal
+
+export LIBCLI_SRC = $(CRYPTECH_ROOT)/user/ft/libcli
+export LIBCLI_BLD = $(LIBS_DIR)/libcli
+
+export LIBTFM_SRC = $(CRYPTECH_ROOT)/sw/thirdparty/libtfm
+export LIBTFM_BLD = $(LIBS_DIR)/libtfm
export LIBS = $(MBED_DIR)/libstmf4.a
@@ -95,7 +100,6 @@ CFLAGS += -I$(MBED_DIR)/targets/cmsis/TARGET_STM/TARGET_STM32F4
CFLAGS += -I$(MBED_DIR)/targets/cmsis/TARGET_STM/TARGET_STM32F4/$(BOARD)
CFLAGS += -I$(MBED_DIR)/targets/hal/TARGET_STM/TARGET_STM32F4
CFLAGS += -I$(MBED_DIR)/targets/hal/TARGET_STM/TARGET_STM32F4/$(BOARD)
-CFLAGS += -DHAL_RSA_USE_MODEXP=0
export CFLAGS
%.o : %.c
@@ -104,10 +108,7 @@ export CFLAGS
%.o : %.S
$(CC) $(CFLAGS) -c -o $@ $<
-all: board-test cli-test libhal-test hsm
-
-init:
- git submodule update --init --recursive --remote
+all: board-test cli-test libhal-test hsm bootloader
$(MBED_DIR)/libstmf4.a:
$(MAKE) -C $(MBED_DIR)
@@ -115,7 +116,7 @@ $(MBED_DIR)/libstmf4.a:
board-test: $(BOARD_OBJS) $(LIBS)
$(MAKE) -C projects/board-test
-cli-test: $(BOARD_OBJS) $(LIBS) $(LIBCLI_DIR)/libcli.a
+cli-test: $(BOARD_OBJS) $(LIBS) $(LIBCLI_BLD)/libcli.a $(LIBHAL_BLD)/libhal.a $(RTOS_DIR)/librtos.a
$(MAKE) -C projects/cli-test
$(RTOS_DIR)/librtos.a:
@@ -124,19 +125,19 @@ $(RTOS_DIR)/librtos.a:
rtos-test: $(RTOS_OBJS) $(LIBS) $(RTOS_DIR)/librtos.a
$(MAKE) -C projects/rtos-test
-$(LIBTFM_DIR)/libtfm.a:
- $(MAKE) -C $(LIBTFM_DIR) PREFIX=$(PREFIX)
+$(LIBTFM_BLD)/libtfm.a:
+ $(MAKE) -C $(LIBTFM_BLD) PREFIX=$(PREFIX)
-$(LIBHAL_DIR)/libhal.a: $(LIBTFM_DIR)/libtfm.a
- $(MAKE) -C $(LIBHAL_DIR) IO_BUS=fmc RPC_SERVER=yes RPC_TRANSPORT=serial KS=volatile libhal.a
+$(LIBHAL_BLD)/libhal.a: $(LIBTFM_BLD)/libtfm.a
+ $(MAKE) -C $(LIBHAL_BLD) IO_BUS=fmc RPC_MODE=server RPC_TRANSPORT=serial KS=flash libhal.a
-$(LIBCLI_DIR)/libcli.a:
- $(MAKE) -C $(LIBCLI_DIR)
+$(LIBCLI_BLD)/libcli.a:
+ $(MAKE) -C $(LIBCLI_BLD)
-libhal-test: $(BOARD_OBJS) $(LIBS) $(LIBHAL_DIR)/libhal.a
+libhal-test: $(BOARD_OBJS) $(LIBS) $(LIBHAL_BLD)/libhal.a
$(MAKE) -C projects/libhal-test
-hsm: $(BOARD_OBJS) $(LIBS) $(LIBHAL_DIR)/libhal.a $(RTOS_DIR)/librtos.a
+hsm: $(BOARD_OBJS) $(LIBS) $(LIBHAL_BLD)/libhal.a $(RTOS_DIR)/librtos.a $(LIBCLI_BLD)/libcli.a
$(MAKE) -C projects/hsm
bootloader: $(BOARD_OBJS) $(LIBS)
@@ -145,7 +146,7 @@ bootloader: $(BOARD_OBJS) $(LIBS)
# don't automatically delete objects, to avoid a lot of unnecessary rebuilding
.SECONDARY: $(BOARD_OBJS)
-.PHONY: board-test rtos-test libhal-test cli-test
+.PHONY: board-test rtos-test libhal-test cli-test hsm bootloader
clean:
rm -f $(BOARD_OBJS)
@@ -158,5 +159,6 @@ clean:
distclean: clean
$(MAKE) -C $(MBED_DIR) clean
$(MAKE) -C $(RTOS_DIR) clean
- $(MAKE) -C $(LIBHAL_DIR) clean
- $(MAKE) -C $(LIBTFM_DIR) clean
+ $(MAKE) -C $(LIBHAL_BLD) clean
+ $(MAKE) -C $(LIBTFM_BLD) clean
+ $(MAKE) -C $(LIBCLI_BLD) clean