From 1dcb84579bd4d1c2c7839c16c881818fa7b9f25a Mon Sep 17 00:00:00 2001 From: Anders Hoglund Date: Tue, 14 Jun 2016 10:48:46 +0200 Subject: [PATCH 1/2] Removed top_makefile. Obsolete now that the main Makefile can do all targets recursive. --- top_makefile | 68 ---------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 top_makefile diff --git a/top_makefile b/top_makefile deleted file mode 100644 index 4b1bb90e78..0000000000 --- a/top_makefile +++ /dev/null @@ -1,68 +0,0 @@ -ALL_TARGETS := naze -ALL_TARGETS += cc3d -ALL_TARGETS += cc3d_opbl -ALL_TARGETS += spracingf3 -ALL_TARGETS += spracingf3evo -ALL_TARGETS += spracingf3mini -ALL_TARGETS += sparky -ALL_TARGETS += alienflightf1 -ALL_TARGETS += alienflightf3 -ALL_TARGETS += colibri_race -ALL_TARGETS += lux_race -ALL_TARGETS += motolab -ALL_TARGETS += rmdo -ALL_TARGETS += ircfusionf3 -ALL_TARGETS += afromini -ALL_TARGETS += doge -ALL_TARGETS += singularity - -CLEAN_TARGETS := $(addprefix clean_, $(ALL_TARGETS)) - -clean_naze naze : opts := TARGET=NAZE -clean_cc3d cc3d: opts := TARGET=CC3D -clean_cc3d_opbl cc3d_opbl : opts := TARGET=CC3D_OPBL -clean_spracingf3mini spracingf3mini : opts := TARGET=SPRACINGF3MINI -clean_spracingf3 spracingf3 : opts := TARGET=SPRACINGF3 -clean_spracingf3evo spracingf3evo : opts := TARGET=SPRACINGF3EVO -clean_sparky sparky : opts := TARGET=SPARKY -clean_alienflightf1 alienflightf1 : opts := TARGET=ALIENFLIGHTF1 -clean_alienflightf3 alienflightf3 : opts := TARGET=ALIENFLIGHTF3 -clean_colibri_race colibri_race : opts := TARGET=COLIBRI_RACE -clean_lux_race lux_race : opts := TARGET=LUX_RACE -clean_motolab motolab : opts := TARGET=MOTOLAB -clean_rmdo rmdo : opts := TARGET=RMDO -clean_ircfusionf3 ircfusionf3 : opts := TARGET=IRCFUSIONF3 -clean_afromini afromini : opts := TARGET=AFROMINI -clean_doge doge : opts := TARGET=DOGE -clean_singularity singularity : opts := TARGET=SINGULARITY - - -.PHONY: all clean -all: everything -clean: clean_everything - - -.PHONY: clean_everything -clean_everything: $(CLEAN_TARGETS) - -.PHONY: everything -everything: $(ALL_TARGETS) - - -.PHONY:$(ALL_TARGETS) -$(ALL_TARGETS): - make -f Makefile hex binary $(opts) - -.PHONY: $(CLEAN_TARGETS) -$(CLEAN_TARGETS): - make -f Makefile clean $(opts) - -.PHONY: help -help: - @echo "This is your new top makefile. synopsis: make " . - @echo "Valid targets": - @echo "all" - @echo "clean" - @echo "$(ALL_TARGETS)" - @echo "$(CLEAN_TARGETS)" - From ea3856f8a8de441b39c61a0d5343f4b8ba69a0dd Mon Sep 17 00:00:00 2001 From: Anders Hoglund Date: Tue, 14 Jun 2016 12:28:11 +0200 Subject: [PATCH 2/2] Changed recursive all goal for proper return values. Failures had return value 0 (ok). Now also possible to use target name as make goal. Updated help texts to match this change. --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 12352a0ba7..53159fa346 100644 --- a/Makefile +++ b/Makefile @@ -658,15 +658,14 @@ $(OBJECT_DIR)/$(TARGET)/%.o: %.S @$(CC) -c -o $@ $(ASFLAGS) $< -## all : default task; compile C code, build firmware -all: - for build_target in $(VALID_TARGETS); do \ +## all : Build all valid targets +all: $(VALID_TARGETS) + +$(VALID_TARGETS): echo "" && \ - echo "Building $$build_target" && \ - $(MAKE) -j binary hex TARGET=$$build_target || \ - break; \ - echo "Building $$build_target succeeded."; \ - done + echo "Building $@" && \ + $(MAKE) -j binary hex TARGET=$@ && \ + echo "Building $@ succeeded." ## clean : clean up all temporary / machine-generated files clean: @@ -725,6 +724,8 @@ help: Makefile @echo "" @echo "Usage:" @echo " make [TARGET=] [OPTIONS=\"\"]" + @echo "Or:" + @echo " make [OPTIONS=\"\"]" @echo "" @echo "Valid TARGET values are: $(VALID_TARGETS)" @echo ""