Skip to content

Commit 14b853e

Browse files
committed
minimal/Makefile: Add support for building with user C modules.
Fixes issue adafruit#5750. Signed-off-by: Damien George <[email protected]>
1 parent 753b08c commit 14b853e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

ports/minimal/Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ CFLAGS += -Os -DNDEBUG
4141
CFLAGS += -fdata-sections -ffunction-sections
4242
endif
4343

44+
# Flags for optional C++ source code
45+
CXXFLAGS += $(filter-out -std=c99,$(CFLAGS))
46+
CXXFLAGS += $(CXXFLAGS_MOD)
47+
48+
# Flags for user C modules
49+
CFLAGS += $(CFLAGS_MOD)
50+
LDFLAGS += $(LDFLAGS_MOD)
51+
4452
LIBS =
4553

4654
SRC_C = \
@@ -56,7 +64,14 @@ ifeq ($(CROSS), 1)
5664
SRC_C += shared/libc/string0.c
5765
endif
5866

59-
OBJ = $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
67+
SRC_C += $(SRC_MOD)
68+
69+
SRC_CXX += $(SRC_MOD_CXX)
70+
71+
SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX)
72+
73+
OBJ += $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
74+
OBJ += $(addprefix $(BUILD)/, $(SRC_CXX:.cpp=.o))
6075

6176
ifeq ($(CROSS), 1)
6277
all: $(BUILD)/firmware.dfu

0 commit comments

Comments
 (0)