File tree 2 files changed +15
-5
lines changed
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change
1
+ # Select the configuration to build with, defaulting to "minimal"
2
+ CONFIG ?= minimal
3
+ ifeq ($(wildcard mpconfigport_$(CONFIG ) .h) ,)
4
+ $(error Invalid CONFIG specified)
5
+ endif
6
+
7
+ BUILD = build_$(CONFIG )
8
+ FIRMWARE = $(BUILD ) /firmware_$(CONFIG )
9
+
1
10
include ../micropython/py/mkenv.mk
2
11
3
12
# qstr definitions (must come before including py.mk)
@@ -10,11 +19,11 @@ CROSS_COMPILE = arm-none-eabi-
10
19
11
20
INC += -I.
12
21
INC += -I$(TOP )
13
- INC += -I$(TOP ) /stmhal
14
22
INC += -I$(BUILD )
15
23
16
24
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion
17
25
CFLAGS = $(INC ) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4 ) $(COPT )
26
+ CFLAGS += -DMP_CONFIGFILE="<mpconfigport_$(CONFIG ) .h>"
18
27
19
28
# Debugging/Optimization
20
29
ifeq ($(DEBUG ) , 1)
@@ -37,14 +46,14 @@ SRC_C = \
37
46
38
47
OBJ = $(PY_O ) $(addprefix $(BUILD ) /, $(SRC_C:.c=.o ) )
39
48
40
- all : $(BUILD ) /firmware .bin
49
+ all : $(FIRMWARE ) .bin
41
50
42
- $(BUILD ) /firmware .elf : $(OBJ )
51
+ $(FIRMWARE ) .elf : $(OBJ )
43
52
$(ECHO ) " LINK $@ "
44
53
$(Q )$(LD ) $(LDFLAGS ) -o $@ $^ $(LIBS )
45
54
$(Q )$(SIZE ) $@
46
55
47
- $(BUILD ) /firmware .bin : $(BUILD ) /firmware .elf
48
- $(Q )$(OBJCOPY ) -O binary -j .isr_vector -j .text -j .data $^ $( BUILD ) /firmware.bin
56
+ $(FIRMWARE ) .bin : $(FIRMWARE ) .elf
57
+ $(Q )$(OBJCOPY ) -O binary -j .isr_vector -j .text -j .data $^ $@
49
58
50
59
include $(TOP ) /py/mkrules.mk
Original file line number Diff line number Diff line change
1
+ #include "mpconfigport.h"
You can’t perform that action at this time.
0 commit comments