Files
mongoose/tutorials/nxp/frdm-mcxn947-xpresso-freertos-builtin/Makefile
T

28 lines
1.2 KiB
Makefile

BOARD = mcxn947
IDE = MCUXpresso
RTOS = FreeRTOS
WIZARD_URL ?= http://mongoose.ws/wizard
TARGET ?= Debug
DOCKER = docker run --rm -v $(CURDIR):/root -w /root
IMAGE ?= scaprile/xpresso
HEADLESS_BUILD = /usr/local/mcuxpressoide/ide/mcuxpressoide --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild
all build example: firmware.axf
firmware.axf: wizard
mkdir -p workspace
PROJNAME=`xq -r .projectDescription.name wizard/.project` && \
($(DOCKER) $(IMAGE) $(HEADLESS_BUILD) -data workspace -import wizard -cleanBuild $$PROJNAME/$(TARGET) || true) && \
cp wizard/$(TARGET)/$$PROJNAME.axf firmware.axf
wizard:
hash=$$(curl -H 'Cookie: mongoose_wizard_uid=F2PPlAgQCqSthV1g' -s -X POST -H "Content-Type: application/json" -d '{"build":{"board":"$(BOARD)","ide":"$(IDE)","rtos":"$(RTOS)"},"http":{"http": true}}' $(WIZARD_URL)/api/hash | jq -r '.hash') \
&& curl -H 'Cookie: mongoose_wizard_uid=F2PPlAgQCqSthV1g' -s $(WIZARD_URL)/api/zip -o wizard.zip
unzip wizard.zip
cd wizard/mongoose ; rm mongoose.[ch] ; cp -rL ../../../../../mongoose.[ch] .
clean:
test -f firmware.axf && sudo rm -rf firmware.* wizard* workspace mcuxpresso .cache .eclipse .p2 || true