diff options
author | Paul Selkirk <paul@psgd.org> | 2015-10-26 18:37:57 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2015-10-26 18:37:57 -0400 |
commit | fb73e2d75b4e99a29c28bbbaf754222010c273b7 (patch) | |
tree | 4266ecd55d8bc2e8919163354e5815177dc59f74 /Makefile | |
parent | 26f12903dab2fafeaaefb02349763618ce96d070 (diff) |
Build libhal and libtfm for stm32.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 31 |
1 files changed, 24 insertions, 7 deletions
@@ -28,11 +28,13 @@ SRCS += $(TOPLEVEL)/Device/system_stm32f4xx.c ################################################### -CC=arm-none-eabi-gcc -AS=arm-none-eabi-as -OBJCOPY=arm-none-eabi-objcopy -OBJDUMP=arm-none-eabi-objdump -SIZE=arm-none-eabi-size +PREFIX=arm-none-eabi- +export CC=$(PREFIX)gcc +export AS=$(PREFIX)as +export AR=$(PREFIX)ar +export OBJCOPY=$(PREFIX)objcopy +export OBJDUMP=$(PREFIX)objdump +export SIZE=$(PREFIX)size CFLAGS = -ggdb -O2 -Wall -Wextra -Warray-bounds CFLAGS += -mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb-interwork @@ -53,13 +55,26 @@ OBJS = $(patsubst %.s,%.o, $(patsubst %.c,%.o, $(SRCS))) ################################################### -.PHONY: lib proj +.PHONY: libstmf4 proj libhal libtfm lib + +LIBS = libstmf4 libtfm libhal all: lib proj -lib: +init: + git submodule update --init --recursive + +lib: $(LIBS) + +libstmf4: $(MAKE) -C $(STD_PERIPH_LIB) STDPERIPH_SETTINGS="$(STDPERIPH_SETTINGS) -I $(PWD)/include" +libtfm: + ${MAKE} -C thirdparty/libtfm PREFIX=$(PREFIX) + +libhal: hal_io_fmc.o + ${MAKE} -C libhal IO_OBJ=../hal_io_fmc.o libhal.a + proj: $(PROJS:=.elf) %.elf: %.o $(OBJS) @@ -80,3 +95,5 @@ clean: distclean: clean $(MAKE) -C $(STD_PERIPH_LIB) clean + $(MAKE) -C thirdparty/libtfm clean + $(MAKE) -C libhal clean |