-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (31 loc) · 1.26 KB
/
Makefile
File metadata and controls
41 lines (31 loc) · 1.26 KB
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
# List of all supported platforms
PLATFORMS = stm32f469disco testbench
# Select target platform by first argument
FIRST_ARG = $(firstword $(MAKECMDGOALS))
ifeq ($(findstring $(FIRST_ARG),$(PLATFORMS)),$(FIRST_ARG))
TARGET_PLATFORM = $(FIRST_ARG)
endif
# Create argument list for target Makefile
ifdef TARGET_PLATFORM
BOOTLOADER_MAKEFILE = platforms/$(TARGET_PLATFORM)/bootloader/Makefile
STARTUP_MAKEFILE = platforms/$(TARGET_PLATFORM)/startup/Makefile
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(RUN_ARGS):;@:)
endif
# Pubkeys folder: keys/selfsigned/pubkeys.c
# Create the file with keys you want to use for firmware signing
KEYS ?= selfsigned
.PHONY: $(PLATFORMS) clean test unit_tests
clean:
-rm -fR build
test:
@$(MAKE) -f test/Makefile test
unit_tests:
@$(MAKE) -f test/Makefile
stm32f469disco:
@test -f keys/$(KEYS)/pubkeys.c || (echo ERROR: ./$(KEYS)/pubkey.c file does not exist. Create it or define different KEYS parameter; exit 1;)
@$(MAKE) -f $(STARTUP_MAKEFILE) $(RUN_ARGS) TARGET_PLATFORM=$(TARGET_PLATFORM)
@$(MAKE) -f $(BOOTLOADER_MAKEFILE) $(RUN_ARGS) TARGET_PLATFORM=$(TARGET_PLATFORM) KEYS=$(KEYS)
testbench:
$(shell echo Test Bench)
@$(MAKE) -f $(BOOTLOADER_MAKEFILE) $(RUN_ARGS) TARGET_PLATFORM=$(TARGET_PLATFORM)