From fff58101917de4932bcbc36e9eadf27b818ca383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Wed, 28 Mar 2018 16:27:12 +0200 Subject: [PATCH 1/3] Makefile.include: FIX .DEFAULT_GOAL not being all .DEFAULT_GOAL was reset many times which removed 'all' from being the default goal. By chance it was then set to `link` so was working by some magic. --- Makefile.include | 3 +++ boards/common/frdm/Makefile.include | 3 --- boards/mulle/Makefile.include | 3 --- boards/pba-d-01-kw2x/Makefile.include | 3 --- cpu/kinetis/Makefile.include | 3 --- makefiles/scan-build.inc.mk | 3 --- 6 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Makefile.include b/Makefile.include index 7531470684..f613c16c96 100644 --- a/Makefile.include +++ b/Makefile.include @@ -1,3 +1,6 @@ +# Globally set default goal to `all` +.DEFAULT_GOAL := all + # include Makefile.local if it exists -include Makefile.local diff --git a/boards/common/frdm/Makefile.include b/boards/common/frdm/Makefile.include index f71451d9fe..d147a04baf 100644 --- a/boards/common/frdm/Makefile.include +++ b/boards/common/frdm/Makefile.include @@ -26,9 +26,6 @@ export OPENOCD_EXTRA_INIT .PHONY: flash flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin -# Reset the default goal. -.DEFAULT_GOAL := - export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/old-openocd-$(CPU_FAMILY).cfg endif diff --git a/boards/mulle/Makefile.include b/boards/mulle/Makefile.include index ed3d0b144d..9a7c74a7be 100644 --- a/boards/mulle/Makefile.include +++ b/boards/mulle/Makefile.include @@ -61,9 +61,6 @@ export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-elf.sh .PHONY: flash flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin -# Reset the default goal. -.DEFAULT_GOAL := - # this board uses openocd include $(RIOTMAKE)/tools/openocd.inc.mk diff --git a/boards/pba-d-01-kw2x/Makefile.include b/boards/pba-d-01-kw2x/Makefile.include index cbb1133753..b1cf0565b3 100644 --- a/boards/pba-d-01-kw2x/Makefile.include +++ b/boards/pba-d-01-kw2x/Makefile.include @@ -15,9 +15,6 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) .PHONY: flash flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin -# Reset the default goal. -.DEFAULT_GOAL := - # We need special handling of the watchdog if we want to speed up the flash # verification by using the MCU to compute the image checksum after flashing. # wdog-disable.bin is a precompiled binary which will disable the watchdog and diff --git a/cpu/kinetis/Makefile.include b/cpu/kinetis/Makefile.include index 046337a006..59a0b948fd 100644 --- a/cpu/kinetis/Makefile.include +++ b/cpu/kinetis/Makefile.include @@ -44,7 +44,4 @@ USEMODULE += periph_wdog $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin: $(RIOTCPU)/$(CPU)/dist/wdog-disable.s $(Q)$(MAKE) -C $(RIOTCPU)/$(CPU)/dist/ $(notdir $@) -# Reset the default goal to not make wdog-disable.bin the default target. -.DEFAULT_GOAL := - include $(RIOTMAKE)/arch/cortexm.inc.mk diff --git a/makefiles/scan-build.inc.mk b/makefiles/scan-build.inc.mk index 0d4d651724..f91c691b77 100644 --- a/makefiles/scan-build.inc.mk +++ b/makefiles/scan-build.inc.mk @@ -87,6 +87,3 @@ else echo "No report found"; \ fi endif - -# Reset the default goal. -.DEFAULT_GOAL := From 92535234a2447977c40d83968b3bbe45a5b8bb17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Wed, 28 Mar 2018 16:49:30 +0200 Subject: [PATCH 2/3] Makefile.include: add an assert that .DEFAULT_GOAL is all --- Makefile.include | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile.include b/Makefile.include index f613c16c96..16afa50e03 100644 --- a/Makefile.include +++ b/Makefile.include @@ -593,4 +593,9 @@ CFLAGS += -include '$(RIOTBUILD_CONFIG_HEADER_C)' # include mcuboot support include $(RIOTMAKE)/mcuboot.mk + +# Sanity check, 'all' should be the default goal +ifneq (all, $(.DEFAULT_GOAL)) + $(error .DEFAULT_GOAL := $(.DEFAULT_GOAL)) +endif endif # BOARD=none From 655186c986c5b90ca774e59c73ea04c7fe7f97d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Wed, 28 Mar 2018 17:32:11 +0200 Subject: [PATCH 3/3] Makefile.include: rm deprecated comment on default goal --- Makefile.include | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile.include b/Makefile.include index 16afa50e03..4511cafed7 100644 --- a/Makefile.include +++ b/Makefile.include @@ -463,8 +463,7 @@ $(CURDIR)/eclipsesym.xml: # Export variables used throughout the whole make system: include $(RIOTMAKE)/vars.inc.mk -# Include build targets for selected tools after the default RIOT targets have -# been defined (-> so the `all` will be always the first target) +# Include build targets for selected tools include $(RIOTMAKE)/tools/targets.inc.mk # Warn if the selected board and drivers don't provide all needed features: