From 300d6b3e3530d8549e7de9d158b119ff6ebcc50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Kijewski?= Date: Wed, 9 Apr 2014 23:00:29 +0200 Subject: [PATCH] Make: exterminate 'clean' buildtarget Closes #993. We do not need to descend into the modules to know what to do on `make clean BOARD=blub`. We can just invoke `rm -rf bin/blub`. This PR only keeps the descending into the USEPKGs, since they might want to delete cached/downloaded/extracted data. --- Makefile.base | 6 ------ Makefile.include | 4 +--- Makefile.unsupported | 3 ++- boards/avsextrem/Makefile | 3 --- boards/chronos/Makefile | 3 --- boards/msb-430-common/Makefile | 3 --- boards/msb-430/Makefile | 3 --- boards/msb-430h/Makefile | 3 --- boards/msba2-common/Makefile | 3 --- boards/msba2/Makefile | 3 --- boards/native/Makefile | 3 --- boards/pttu/Makefile | 3 --- boards/redbee-econotag/Makefile | 3 --- boards/wsn430-common/Makefile | 3 --- boards/wsn430-v1_3b/Makefile | 3 --- boards/wsn430-v1_4/Makefile | 3 --- cpu/cc430/Makefile | 3 --- cpu/lpc1768/Makefile | 3 --- cpu/lpc2387/Makefile | 3 --- cpu/mc1322x/Makefile | 3 --- cpu/msp430-common/Makefile | 8 -------- cpu/msp430x16x/Makefile | 3 --- cpu/native/Makefile | 3 --- drivers/Makefile | 4 ---- drivers/at86rf231/Makefile | 8 -------- drivers/cc110x_ng/Makefile | 3 --- drivers/cc2420/Makefile | 8 -------- sys/Makefile | 4 ---- 28 files changed, 3 insertions(+), 102 deletions(-) diff --git a/Makefile.base b/Makefile.base index c26d16cbdb..f6b18398a3 100644 --- a/Makefile.base +++ b/Makefile.base @@ -21,8 +21,6 @@ ifeq ($(strip $(GIT_VERSION)),) endif export CFLAGS += -DVERSION=\"$(GIT_VERSION)\" -.PHONY: clean - $(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ) $(AD)$(AR) -rc $(BINDIR)$(MODULE).a $(OBJ) $(ASMOBJ) @@ -44,7 +42,3 @@ $(BINDIR)$(MODULE)/%.o: %.s $(BINDIR)$(MODULE)/%.o: %.S @mkdir -p $(BINDIR)$(MODULE) $(AD)$(CC) -c $(CFLAGS) $*.S -o $(BINDIR)$(MODULE)/$*.o - -# remove compilation products -clean:: - $(AD)rm -f $(BINDIR)$(MODULE).a $(OBJ) $(DEP) $(ASMOBJ) diff --git a/Makefile.include b/Makefile.include index 744d65c7a7..f6bac14b33 100644 --- a/Makefile.include +++ b/Makefile.include @@ -143,9 +143,7 @@ $(USEPKG:%=${BINDIR}%.a):: "$(MAKE)" -C $(RIOTBASE)/pkg/$(patsubst ${BINDIR}%.a,%,$@) clean: - @for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTBASE)/pkg/$$i clean || exit 1; done ; - "$(MAKE)" -C $(RIOTBOARD)/$(BOARD) clean - "$(MAKE)" -C $(RIOTBASE) clean + @for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTBASE)/pkg/$$i clean || exit 1; done rm -rf $(BINDIR) flash: all diff --git a/Makefile.unsupported b/Makefile.unsupported index fe71826c03..8b8c66a906 100644 --- a/Makefile.unsupported +++ b/Makefile.unsupported @@ -3,4 +3,5 @@ all: $(error Project $(PROJECT) currently not supported for $(BOARD)) -clean: all +clean: + @true diff --git a/boards/avsextrem/Makefile b/boards/avsextrem/Makefile index 721109f214..66e75590d5 100644 --- a/boards/avsextrem/Makefile +++ b/boards/avsextrem/Makefile @@ -6,6 +6,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/chronos/Makefile b/boards/chronos/Makefile index 9c583c8552..d5db842fcc 100644 --- a/boards/chronos/Makefile +++ b/boards/chronos/Makefile @@ -7,6 +7,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/msb-430-common/Makefile b/boards/msb-430-common/Makefile index ad11fe9974..476661c137 100644 --- a/boards/msb-430-common/Makefile +++ b/boards/msb-430-common/Makefile @@ -6,6 +6,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/msb-430/Makefile b/boards/msb-430/Makefile index e847666a50..4d3a2ce17d 100644 --- a/boards/msb-430/Makefile +++ b/boards/msb-430/Makefile @@ -6,6 +6,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/msb-430h/Makefile b/boards/msb-430h/Makefile index e847666a50..4d3a2ce17d 100644 --- a/boards/msb-430h/Makefile +++ b/boards/msb-430h/Makefile @@ -6,6 +6,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/msba2-common/Makefile b/boards/msba2-common/Makefile index ad11fe9974..476661c137 100644 --- a/boards/msba2-common/Makefile +++ b/boards/msba2-common/Makefile @@ -6,6 +6,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/msba2/Makefile b/boards/msba2/Makefile index 1b0a2c2590..8f2fb2c9bc 100644 --- a/boards/msba2/Makefile +++ b/boards/msba2/Makefile @@ -7,6 +7,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/native/Makefile b/boards/native/Makefile index 95358519cf..c1a5af72c1 100644 --- a/boards/native/Makefile +++ b/boards/native/Makefile @@ -12,6 +12,3 @@ $(BINDIR)$(MODULE)/%.o: %.c $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$(MODULE)/$*.o $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c |\ sed -e "1s|^|$(BINDIR)$(MODULE)/|" > $(BINDIR)$(MODULE)/$*.d - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/pttu/Makefile b/boards/pttu/Makefile index 1b0a2c2590..8f2fb2c9bc 100644 --- a/boards/pttu/Makefile +++ b/boards/pttu/Makefile @@ -7,6 +7,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/redbee-econotag/Makefile b/boards/redbee-econotag/Makefile index ad11fe9974..476661c137 100644 --- a/boards/redbee-econotag/Makefile +++ b/boards/redbee-econotag/Makefile @@ -6,6 +6,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/wsn430-common/Makefile b/boards/wsn430-common/Makefile index ad11fe9974..476661c137 100644 --- a/boards/wsn430-common/Makefile +++ b/boards/wsn430-common/Makefile @@ -6,6 +6,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/wsn430-v1_3b/Makefile b/boards/wsn430-v1_3b/Makefile index 1c90d58cf5..13ff3e7086 100644 --- a/boards/wsn430-v1_3b/Makefile +++ b/boards/wsn430-v1_3b/Makefile @@ -6,6 +6,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/boards/wsn430-v1_4/Makefile b/boards/wsn430-v1_4/Makefile index b91f1a85de..2aa36dcc40 100644 --- a/boards/wsn430-v1_4/Makefile +++ b/boards/wsn430-v1_4/Makefile @@ -6,6 +6,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/cpu/cc430/Makefile b/cpu/cc430/Makefile index d1d12a013e..ad74ec937a 100644 --- a/cpu/cc430/Makefile +++ b/cpu/cc430/Makefile @@ -6,6 +6,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/cpu/lpc1768/Makefile b/cpu/lpc1768/Makefile index 35034ca1c7..29d947056f 100644 --- a/cpu/lpc1768/Makefile +++ b/cpu/lpc1768/Makefile @@ -11,9 +11,6 @@ all: $(BINDIR)$(MODULE).a include $(RIOTBASE)/Makefile.base -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; - # This is needed for NXP Cortex M devices nxpsum: $(CCLOCAL) nxpsum.c -std=c99 -o nxpsum diff --git a/cpu/lpc2387/Makefile b/cpu/lpc2387/Makefile index 6674af3b27..57ce9fb1f1 100644 --- a/cpu/lpc2387/Makefile +++ b/cpu/lpc2387/Makefile @@ -20,6 +20,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/cpu/mc1322x/Makefile b/cpu/mc1322x/Makefile index 7b4d668624..8c68344a8c 100644 --- a/cpu/mc1322x/Makefile +++ b/cpu/mc1322x/Makefile @@ -12,6 +12,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/cpu/msp430-common/Makefile b/cpu/msp430-common/Makefile index 7ddcd45ed8..aff6a1957f 100644 --- a/cpu/msp430-common/Makefile +++ b/cpu/msp430-common/Makefile @@ -1,11 +1,3 @@ MODULE =msp430_common -DIRS = - -all: $(BINDIR)$(MODULE).a - @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; - include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/cpu/msp430x16x/Makefile b/cpu/msp430x16x/Makefile index ea6d8956af..b583dc78ed 100644 --- a/cpu/msp430x16x/Makefile +++ b/cpu/msp430x16x/Makefile @@ -8,6 +8,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/cpu/native/Makefile b/cpu/native/Makefile index a592a86309..34b29cd8c0 100644 --- a/cpu/native/Makefile +++ b/cpu/native/Makefile @@ -18,6 +18,3 @@ $(BINDIR)$(MODULE)/%.o: %.c $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -c $*.c -o $(BINDIR)$(MODULE)/$*.o $(AD)$(CC) $(CFLAGS) $(NATIVEINCLUDES) -MM $*.c |\ sed -e "1s|^|$(BINDIR)$(MODULE)/|" > $(BINDIR)$(MODULE)/$*.d - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/drivers/Makefile b/drivers/Makefile index f61b434ace..6789873156 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -39,7 +39,3 @@ all: @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -# remove compilation products -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/drivers/at86rf231/Makefile b/drivers/at86rf231/Makefile index ded5b0edcf..f0ae7afb32 100644 --- a/drivers/at86rf231/Makefile +++ b/drivers/at86rf231/Makefile @@ -1,11 +1,3 @@ MODULE =at86rf231 -DIRS = - -all: $(BINDIR)$(MODULE).a - @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; - include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/drivers/cc110x_ng/Makefile b/drivers/cc110x_ng/Makefile index fbb9508c7b..2dc3f914a1 100644 --- a/drivers/cc110x_ng/Makefile +++ b/drivers/cc110x_ng/Makefile @@ -15,6 +15,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/drivers/cc2420/Makefile b/drivers/cc2420/Makefile index 05d164a17c..39a17b2101 100644 --- a/drivers/cc2420/Makefile +++ b/drivers/cc2420/Makefile @@ -1,11 +1,3 @@ MODULE =cc2420 -DIRS = - -all: $(BINDIR)$(MODULE).a - @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; - include $(RIOTBASE)/Makefile.base - -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ; diff --git a/sys/Makefile b/sys/Makefile index f3470957fc..08f0d791fe 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -106,7 +106,3 @@ all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do "$(MAKE)" -C $$i || exit 1; done ; include $(RIOTBASE)/Makefile.base - -# remove compilation products -clean:: - @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean || exit 1; done ;