1BLINKY := k64f_blinky
2BLINKY2 := k64f_blinky2
3
4SLINKY := k64f_slinky
5SLINKY2 := k64f_slinky2
6
7BOOT_RSA := k64f_boot_rsa
8BOOT_RSA_PSS := k64f_boot_rsa_pss
9BOOT_EC := k64f_boot_ec
10BOOT_EC256 := k64f_boot_ec256
11BOOT_RSA_EC := k64f_boot_rsa_ec
12BOOT_RSA_VALIDATE0 := k64f_boot_rsa_validate0
13BOOT_RSA_NOSWAP := k64f_boot_rsa_noswap
14
15RSA_KEY_1 := key_rsa.pem
16RSA_KEY_2 := key_rsa_2.pem
17
18BLINKY2_IMG := bin/targets/$(BLINKY2)/app/apps/blinky/blinky.img
19
20FLASH_ERASE := pyocd-flashtool -ce
21
22NEWTMGR_CONN := --conn k64f
23NEWTMGR_IMG := newtmgr $(NEWTMGR_CONN) image
24
25all: build-apps build-mcuboot
26
27build-blinky:
28	@echo "* Building blinky for the primary slot... \c"
29	@newt build -q $(BLINKY)
30	@echo "ok"
31
32build-blinky2:
33	@echo "* Building blinky2 for the secondary slot... \c"
34	@newt build -q $(BLINKY2)
35	@echo "ok"
36
37build-slinky:
38	@echo "* Building slinky for the primary slot... \c"
39	@newt build -q $(SLINKY)
40	@echo "ok"
41
42build-slinky2:
43	@echo "* Building slinky2 for the secondary slot... \c"
44	@newt build -q $(SLINKY2)
45	@echo "ok"
46
47build-boot-rsa:
48	@echo "* Building mcuboot with RSA... \c"
49	@newt build -q $(BOOT_RSA)
50	@echo "ok"
51
52build-boot-rsa-pss:
53	@echo "* Building mcuboot with RSA/PSS... \c"
54	@newt build -q $(BOOT_RSA_PSS)
55	@echo "ok"
56
57build-boot-ec:
58	@echo "* Building mcuboot with EC... \c"
59	@newt build -q $(BOOT_EC)
60	@echo "ok"
61
62build-boot-ec256:
63	@echo "* Building mcuboot with EC256... \c"
64	@newt build -q $(BOOT_EC256)
65	@echo "ok"
66
67# FIXME: multi-key signing does not work yet...
68build-boot-rsa-ec:
69	@echo "* Building mcuboot with RSA + EC... \c"
70	@newt build -q $(BOOT_RSA_EC)
71	@echo "ok"
72
73build-boot-rsa-validate0:
74	@echo "* Building mcuboot with primary slot validation... \c"
75	@newt build -q $(BOOT_RSA_VALIDATE0)
76	@echo "ok"
77
78build-boot-rsa-noswap:
79	@echo "* Building mcuboot with overwrite only upgrade... \c"
80	@newt build -q $(BOOT_RSA_NOSWAP)
81	@echo "ok"
82
83build-apps: build-blinky build-blinky2 build-slinky build-slinky2
84
85build-mcuboot: build-boot-rsa build-boot-rsa-pss build-boot-ec \
86	           build-boot-ec256 build-boot-rsa-validate0 build-boot-rsa-noswap
87
88clean:
89	rm -rf bin/
90
91.PHONY: all clean
92