File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,20 @@ SPRESENSE_SDK = spresense-exported-sdk
6262
6363FIRMWARE = $(SPRESENSE_SDK ) /firmware
6464
65+ # Platforms are: Linux, Darwin, MSYS, CYGWIN
66+ PLATFORM := $(firstword $(subst _, ,$(shell uname -s 2>/dev/null) ) )
67+
68+ ifeq ($(PLATFORM ) ,Darwin)
69+ # macOS
70+ MKSPK = $(SPRESENSE_SDK ) /sdk/tools/macos/mkspk
71+ else ifeq ($(PLATFORM),Linux)
72+ # Linux
73+ MKSPK = $(SPRESENSE_SDK ) /sdk/tools/linux/mkspk
74+ else
75+ # Cygwin/MSYS2
76+ MKSPK = $(SPRESENSE_SDK ) /sdk/tools/windows/mkspk.exe
77+ endif
78+
6579INC += \
6680 -I. \
6781 -I../.. \
@@ -186,7 +200,7 @@ $(BUILD)/circuitpython.elf: $(BUILD)/libmpy.a
186200
187201$(BUILD ) /circuitpython.spk : $(BUILD ) /circuitpython.elf
188202 $(ECHO ) " Creating $@ "
189- $(SPRESENSE_SDK ) /sdk/tools/linux/mkspk -c 2 $(BUILD ) /circuitpython.elf nuttx $(BUILD ) /circuitpython.spk
203+ $(MKSPK ) -c 2 $(BUILD ) /circuitpython.elf nuttx $(BUILD ) /circuitpython.spk
190204
191205flash : $(BUILD ) /circuitpython.spk
192206 $(ECHO ) " Writing $< to the board"
You can’t perform that action at this time.
0 commit comments