aboutsummaryrefslogtreecommitdiff
path: root/libraries/mbed/Makefile
blob: 9d68e923db755b5d86a2ada7f37f87989b33c6db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
CC=arm-none-eabi-gcc
AR=arm-none-eabi-ar

###########################################

vpath %.c targets/cmsis/TARGET_STM/TARGET_STM32F4 targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_DEV_BRIDGE

SRCS =	stm32f4xx_hal.c \
	stm32f4xx_hal_adc.c \
	stm32f4xx_hal_adc_ex.c \
	stm32f4xx_hal_can.c \
	stm32f4xx_hal_cec.c \
	stm32f4xx_hal_cortex.c \
	stm32f4xx_hal_crc.c \
	stm32f4xx_hal_cryp.c \
	stm32f4xx_hal_cryp_ex.c \
	stm32f4xx_hal_dac.c \
	stm32f4xx_hal_dac_ex.c \
	stm32f4xx_hal_dcmi.c \
	stm32f4xx_hal_dcmi_ex.c \
	stm32f4xx_hal_dma2d.c \
	stm32f4xx_hal_dma.c \
	stm32f4xx_hal_dma_ex.c \
	stm32f4xx_hal_dsi.c \
	stm32f4xx_hal_eth.c \
	stm32f4xx_hal_flash.c \
	stm32f4xx_hal_flash_ex.c \
	stm32f4xx_hal_flash_ramfunc.c \
	stm32f4xx_hal_fmpi2c.c \
	stm32f4xx_hal_fmpi2c_ex.c \
	stm32f4xx_hal_gpio.c \
	stm32f4xx_hal_hash.c \
	stm32f4xx_hal_hash_ex.c \
	stm32f4xx_hal_hcd.c \
	stm32f4xx_hal_i2c.c \
	stm32f4xx_hal_i2c_ex.c \
	stm32f4xx_hal_i2s.c \
	stm32f4xx_hal_i2s_ex.c \
	stm32f4xx_hal_irda.c \
	stm32f4xx_hal_iwdg.c \
	stm32f4xx_hal_lptim.c \
	stm32f4xx_hal_ltdc.c \
	stm32f4xx_hal_ltdc_ex.c \
	stm32f4xx_hal_msp_template.c \
	stm32f4xx_hal_nand.c \
	stm32f4xx_hal_nor.c \
	stm32f4xx_hal_pccard.c \
	stm32f4xx_hal_pcd.c \
	stm32f4xx_hal_pcd_ex.c \
	stm32f4xx_hal_pwr.c \
	stm32f4xx_hal_pwr_ex.c \
	stm32f4xx_hal_qspi.c \
	stm32f4xx_hal_rcc.c \
	stm32f4xx_hal_rcc_ex.c \
	stm32f4xx_hal_rng.c \
	stm32f4xx_hal_rtc.c \
	stm32f4xx_hal_rtc_ex.c \
	stm32f4xx_hal_sai.c \
	stm32f4xx_hal_sai_ex.c \
	stm32f4xx_hal_sd.c \
	stm32f4xx_hal_sdram.c \
	stm32f4xx_hal_smartcard.c \
	stm32f4xx_hal_spdifrx.c \
	stm32f4xx_hal_spi.c \
	stm32f4xx_hal_sram.c \
	stm32f4xx_hal_tim.c \
	stm32f4xx_hal_tim_ex.c \
	stm32f4xx_hal_uart.c \
	stm32f4xx_hal_usart.c \
	stm32f4xx_hal_wwdg.c \
	stm32f4xx_ll_fmc.c \
	stm32f4xx_ll_fsmc.c \
	stm32f4xx_ll_sdmmc.c \
	stm32f4xx_ll_usb.c \
	cmsis_nvic.c \
	hal_tick.c

OBJS = $(SRCS:.c=.o)

all: libstmf4.a

libstmf4.a: $(OBJS)
	$(AR) -r $@ $(OBJS)

clean:
	rm -f $(OBJS) libstmf4.a
8.o \ $(TOPLEVEL)/stm-fpgacfg.o \ $(TOPLEVEL)/stm-keystore.o \ $(TOPLEVEL)/stm-sdram.o \ $(TOPLEVEL)/stm-flash.o \ $(TOPLEVEL)/syscalls.o \ $(BOARD_DIR)/TOOLCHAIN_GCC_ARM/startup_stm32f429xx.o \ $(BOARD_DIR)/system_stm32f4xx.o \ $(BOARD_DIR)/stm32f4xx_hal_msp.o # cross-building tools 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 # whew, that's a lot of cflags CFLAGS = -ggdb -O2 -Wall -Warray-bounds #-Wextra CFLAGS += -mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb-interwork CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 CFLAGS += -DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DSTM32F429xx CFLAGS += -D__CORTEX_M4 -DTARGET_STM -DTARGET_STM32F4 -DTARGET_STM32F429ZI -DTOOLCHAIN_GCC -D__FPU_PRESENT=1 -D$(BOARD) CFLAGS += -ffunction-sections -fdata-sections -Wl,--gc-sections CFLAGS += -std=c99 CFLAGS += -I $(TOPLEVEL) CFLAGS += -I $(MBED_DIR)/api CFLAGS += -I $(MBED_DIR)/rtos/rtos CFLAGS += -I $(MBED_DIR)/rtos/rtx/TARGET_CORTEX_M CFLAGS += -I $(MBED_DIR)/targets/cmsis 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) export CFLAGS %.o : %.c $(CC) $(CFLAGS) -c -o $@ $< %.o : %.S $(CC) $(CFLAGS) -c -o $@ $< all: board-test cli-test libhal-test hsm init: git submodule update --init --recursive --remote $(MBED_DIR)/libstmf4.a: $(MAKE) -C $(MBED_DIR) board-test: $(BOARD_OBJS) $(LIBS) $(MAKE) -C projects/board-test cli-test: $(BOARD_OBJS) $(LIBS) $(LIBCLI_DIR)/libcli.a $(MAKE) -C projects/cli-test $(RTOS_DIR)/librtos.a: $(MAKE) -C $(RTOS_DIR) rtos-test: $(RTOS_OBJS) $(LIBS) $(MAKE) -C projects/rtos-test $(LIBTFM_DIR)/libtfm.a: $(MAKE) -C $(LIBTFM_DIR) PREFIX=$(PREFIX) $(LIBHAL_DIR)/libhal.a: $(LIBTFM_DIR)/libtfm.a # $(MAKE) -C $(LIBHAL_DIR) RPC_CLIENT=local IO_BUS=fmc KS=volatile libhal.a $(MAKE) -C $(LIBHAL_DIR) IO_BUS=fmc RPC_SERVER=yes RPC_TRANSPORT=serial KS=volatile libhal.a $(LIBCLI_DIR)/libcli.a: $(MAKE) -C $(LIBCLI_DIR) libhal-test: $(BOARD_OBJS) $(LIBS) $(LIBHAL_DIR)/libhal.a $(MAKE) -C projects/libhal-test hsm: $(BOARD_OBJS) $(LIBS) $(LIBHAL_DIR)/libhal.a $(MAKE) -C projects/hsm bootloader: $(BOARD_OBJS) $(LIBS) $(MAKE) -C projects/bootloader # don't automatically delete objects, to avoid a lot of unnecessary rebuilding .SECONDARY: $(BOARD_OBJS) .PHONY: board-test rtos-test libhal-test cli-test clean: rm -f $(BOARD_OBJS) $(MAKE) -C projects/board-test clean $(MAKE) -C projects/cli-test clean $(MAKE) -C projects/rtos-test clean $(MAKE) -C projects/libhal-test clean $(MAKE) -C projects/hsm clean distclean: clean $(MAKE) -C $(MBED_DIR) clean $(MAKE) -C $(RTOS_DIR) clean $(MAKE) -C $(LIBHAL_DIR) clean $(MAKE) -C $(LIBTFM_DIR) clean