-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
53 lines (41 loc) · 1.41 KB
/
Makefile
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
PREFIX?=arm-none-eabi-
CC=$(PREFIX)gcc
OBJCOPY=$(PREFIX)objcopy
OD=bin
all: realall.really
SFLAGS= --static -nostartfiles -std=c11 -g3 -Os
SFLAGS+= -fno-common -ffunction-sections -fdata-sections
SFLAGS+= -I./libopencm3/include -L./libopencm3/lib
LFLAGS+=-Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
M0_FLAGS= $(SFLAGS) -mcpu=cortex-m0 -mthumb -msoft-float
M0P_FLAGS= $(SFLAGS) -mcpu=cortex-m0plus -mthumb -msoft-float
M3_FLAGS= $(SFLAGS) -mcpu=cortex-m3 -mthumb -msoft-float
M4FH_FLAGS= $(SFLAGS) -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16
M7SP_FLAGS= $(SFLAGS) -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16
M7DP_FLAGS= $(SFLAGS) -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16
include boards.efm32.mk
include boards.sam.mk
include boards.stm32.mk
include boards.ti.mk
include boards.nrf.mk
realall.really: outdir $(BOARDS_ELF) $(BOARDS_BIN) $(BOARDS_HEX)
libopencm3/Makefile:
@echo "Initializing libopencm3 submodule"
git submodule update --init
libopencm3/lib/libopencm3_%.a: libopencm3/Makefile
$(MAKE) -C libopencm3
%.bin: %.elf
@#printf " OBJCOPY $(*).bin\n"
$(OBJCOPY) -Obinary $(*).elf $(*).bin
%.hex: %.elf
@#printf " OBJCOPY $(*).hex\n"
$(OBJCOPY) -Oihex $(*).elf $(*).hex
outdir:
mkdir -p $(OD)/efm32
mkdir -p $(OD)/sam
mkdir -p $(OD)/ti
mkdir -p $(OD)/nrf52
clean:
$(RM) $(BOARDS_ELF) $(BOARDS_BIN) $(BOARDS_HEX)
.PHONY: realall.really outdir clean all
$(V).SILENT: