Make Makefile work across OS
This commit is contained in:
parent
8f653d6238
commit
c062990830
@ -62,6 +62,20 @@ SPRESENSE_SDK = spresense-exported-sdk
|
|||||||
|
|
||||||
FIRMWARE = $(SPRESENSE_SDK)/firmware
|
FIRMWARE = $(SPRESENSE_SDK)/firmware
|
||||||
|
|
||||||
|
# Platforms are: Linux, Darwin, MSYS, CYGWIN
|
||||||
|
PLATFORM := $(firstword $(subst _, ,$(shell uname -s 2>/dev/null)))
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM),Darwin)
|
||||||
|
# macOS
|
||||||
|
MKSPK = $(SPRESENSE_SDK)/sdk/tools/macos/mkspk
|
||||||
|
else ifeq ($(PLATFORM),Linux)
|
||||||
|
# Linux
|
||||||
|
MKSPK = $(SPRESENSE_SDK)/sdk/tools/linux/mkspk
|
||||||
|
else
|
||||||
|
# Cygwin/MSYS2
|
||||||
|
MKSPK = $(SPRESENSE_SDK)/sdk/tools/windows/mkspk.exe
|
||||||
|
endif
|
||||||
|
|
||||||
INC += \
|
INC += \
|
||||||
-I. \
|
-I. \
|
||||||
-I../.. \
|
-I../.. \
|
||||||
@ -186,7 +200,7 @@ $(BUILD)/circuitpython.elf: $(BUILD)/libmpy.a
|
|||||||
|
|
||||||
$(BUILD)/circuitpython.spk: $(BUILD)/circuitpython.elf
|
$(BUILD)/circuitpython.spk: $(BUILD)/circuitpython.elf
|
||||||
$(ECHO) "Creating $@"
|
$(ECHO) "Creating $@"
|
||||||
$(SPRESENSE_SDK)/sdk/tools/linux/mkspk -c 2 $(BUILD)/circuitpython.elf nuttx $(BUILD)/circuitpython.spk
|
$(MKSPK) -c 2 $(BUILD)/circuitpython.elf nuttx $(BUILD)/circuitpython.spk
|
||||||
|
|
||||||
flash: $(BUILD)/circuitpython.spk
|
flash: $(BUILD)/circuitpython.spk
|
||||||
$(ECHO) "Writing $< to the board"
|
$(ECHO) "Writing $< to the board"
|
||||||
|
Loading…
Reference in New Issue
Block a user