From 0b502bb6d88e0e3efd48470de92bb4b4a959722f Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Thu, 8 Jul 2010 01:06:33 -0400 Subject: Fix ram, flash, jtag targets --- Makefile | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 51123ba..64fcd20 100644 --- a/Makefile +++ b/Makefile @@ -28,10 +28,7 @@ VENDOR_ID = 1EAF PRODUCT_ID = 0003 # Force a rebuild if the maple target changed -PREV_BUILD_TYPE := $(shell cat $(BUILD_PATH)/build-type 2>/dev/null) -ifneq ($(PREV_BUILD_TYPE), $(MAPLE_TARGET)) - $(shell rm -rf $(BUILD_PATH)) -endif +PREV_BUILD_TYPE = $(shell cat $(BUILD_PATH)/build-type 2>/dev/null) # Some target specific things ifeq ($(MAPLE_TARGET), ram) @@ -66,14 +63,17 @@ $(foreach m,$(LIBMAPLE_MODULES),$(eval $(call LIBMAPLE_MODULE_template,$(m)))) # Main target include support/make/build-targets.mk -# Fake targets -POSSIBLE_TARGETS := install sketch clean help debug cscope tags ctags ram flash jtag -.PHONY: $(POSSIBLE_TARGETS) +.PHONY: install sketch clean help debug cscope tags ctags ram flash jtag install: sketch $(UPLOAD) -sketch: MSG_INFO $(BUILD_PATH)/$(BOARD).bin +build-check: +ifneq ($(PREV_BUILD_TYPE), $(MAPLE_TARGET)) + $(shell rm -rf $(BUILD_PATH)) +endif + +sketch: build-check MSG_INFO $(BUILD_PATH)/$(BOARD).bin clean: rm -rf build @@ -82,8 +82,11 @@ help: @echo "" @echo " libmaple Makefile help" @echo " ----------------------" - @echo " Compile targets:" - @echo " sketch: Compile sketch code" + @echo " Compile targets (default MAPLE_TARGET=flash):" + @echo " ram: Compile sketch code to ram" + @echo " flash: Compile sketch code to flash" + @echo " jtag: Compile sketch code to jtag" + @echo " sketch: Compile sketch code to target MAPLE_TARGET" @echo " " @echo " Programming targets:" @echo " install: Upload code to target" @@ -110,13 +113,10 @@ ctags: @echo "Made tags file for VIM code browsing" ram: - @env - MAPLE_TARGET=ram - @echo "Memory target set to RAM for this session" + $(MAKE) MAPLE_TARGET=ram --no-print-directory flash: - @env - MAPLE_TARGET=flash - @echo "Memory target set to FLASH for this session" + $(MAKE) MAPLE_TARGET=flash --no-print-directory jtag: - @env - MAPLE_TARGET=jtag - @echo "Memory target set to JTAG for this session" + $(MAKE) MAPLE_TARGET=jtag --no-print-directory -- cgit v1.2.3