Allow top-level distclean target to descend to board Makefiles.
PATCH 1/1 Allow top-level distclean target to descend to board Makefiles.
Only applies to boards where it has been explicitly enabled. So far, that is 83xx and 85xx boards.
---
Soon, 85xx and 83xx boards will have generated files in their board directories that will need to be cleaned out. This patch provides the infrastructure to do so in one generic patch.
Makefile | 20 +++++++++++++++++++- board/cds/mpc8541cds/Makefile | 3 +++ board/cds/mpc8548cds/Makefile | 3 +++ board/cds/mpc8555cds/Makefile | 3 +++ board/mpc8349ads/Makefile | 3 +++ board/mpc8540ads/Makefile | 4 +++- board/mpc8540eval/Makefile | 3 +++ board/mpc8560ads/Makefile | 4 +++- board/pm854/Makefile | 3 +++ board/pm856/Makefile | 3 +++ board/sbc8560/Makefile | 3 +++ board/stxgp3/Makefile | 3 +++ board/tqm834x/Makefile | 3 +++ board/tqm85xx/Makefile | 3 +++ 14 files changed, 58 insertions(+), 3 deletions(-)
996e2c2225222c1a016d14faf13b8bf2e325bae6
Makefile +19 -1
@@ -135,6 +135,14 @@ SUBDIRS = tools \ post/cpu .PHONY : $(SUBDIRS) +# Subdirectories that will be "clean" and "distclean". +# Not all board Makefiles have "clean" and "distclean" yet, +# so only add those that support it to this list. +ifneq ($(filter $(CPU),mpc85xx mpc83xx),) +CLEANDIRS = board/$(BOARDDIR) +endif + + ######################################################################### #########################################################################
@@ -1846,7 +1854,17 @@ clobber: clean rm -f include/asm/proc include/asm/arch include/asm mrproper \ -distclean: clobber unconfig +distclean: cleansubdirs clobber unconfig + + +.PHONY: cleansubdirs +cleansubdirs: +ifneq ($(strip $(CLEANDIRS)),) + @for dir in $(CLEANDIRS) ; do \ + $(MAKE) -C $$dir distclean; \ + done +endif + backup: F=`basename $(TOPDIR)` ; cd .. ; \
board/cds/mpc8541cds/Makefile +3 -0
@@ -38,6 +38,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(OBJS) $(SOBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -46,6 +47,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/cds/mpc8548cds/Makefile +3 -0
@@ -38,6 +38,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(OBJS) $(SOBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -46,6 +47,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/cds/mpc8555cds/Makefile +3 -0
@@ -38,6 +38,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(OBJS) $(SOBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -46,6 +47,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/mpc8349ads/Makefile +3 -0
@@ -32,6 +32,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(SOBJS) $(OBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -40,6 +41,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/mpc8540ads/Makefile +3 -1
@@ -27,7 +27,6 @@ LIB = lib$(BOARD).a OBJS := $(BOARD).o SOBJS := init.o -#SOBJS := $(LIB): $(OBJS) $(SOBJS) $(AR) crv $@ $(OBJS)
@@ -35,6 +34,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(OBJS) $(SOBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -43,6 +43,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/mpc8540eval/Makefile +3 -0
@@ -36,6 +36,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(OBJS) $(SOBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -44,6 +45,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/mpc8560ads/Makefile +3 -1
@@ -27,7 +27,6 @@ LIB = lib$(BOARD).a OBJS := $(BOARD).o SOBJS := init.o -#SOBJS := $(LIB): $(OBJS) $(SOBJS) $(AR) crv $@ $(OBJS)
@@ -35,6 +34,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(OBJS) $(SOBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -43,6 +43,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/pm854/Makefile +3 -0
@@ -35,6 +35,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(OBJS) $(SOBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -43,6 +44,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/pm856/Makefile +3 -0
@@ -35,6 +35,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(OBJS) $(SOBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -43,6 +44,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/sbc8560/Makefile +3 -0
@@ -38,6 +38,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(OBJS) $(SOBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -46,6 +47,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/stxgp3/Makefile +3 -0
@@ -35,6 +35,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(OBJS) $(SOBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -43,6 +44,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/tqm834x/Makefile +3 -0
@@ -32,6 +32,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(SOBJS) $(OBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -40,6 +41,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
board/tqm85xx/Makefile +3 -0
@@ -35,6 +35,7 @@ $(LIB): $(OBJS) $(SOBJS) clean: rm -f $(OBJS) $(SOBJS) +.PHONY: distclean distclean: clean rm -f $(LIB) core *.bak .depend
@@ -43,6 +44,8 @@ distclean: clean .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ +ifeq ($(filter distclean,$(MAKECMDGOALS)),) -include .depend +endif #########################################################################
Signature · 1 line
0.99.9n
PATCH 1/1 Allow top-level distclean target to descend to board Makefiles.
Quoted 2 lines · In message <[email protected]> you wrote:
Soon, 85xx and 83xx boards will have generated files in
So, they will? Who says so?
Would you mind to elucidate?
Quoted 5 lines
their board directories that will need to be cleaned out. This patch provides the infrastructure to do so in one generic patch.
Quoted 15 lines
Makefile | 20 +++++++++++++++++++- board/cds/mpc8541cds/Makefile | 3 +++ board/cds/mpc8548cds/Makefile | 3 +++ board/cds/mpc8555cds/Makefile | 3 +++ board/mpc8349ads/Makefile | 3 +++ board/mpc8540ads/Makefile | 4 +++- board/mpc8540eval/Makefile | 3 +++ board/mpc8560ads/Makefile | 4 +++- board/pm854/Makefile | 3 +++ board/pm856/Makefile | 3 +++ board/sbc8560/Makefile | 3 +++ board/stxgp3/Makefile | 3 +++ board/tqm834x/Makefile | 3 +++ board/tqm85xx/Makefile | 3 +++ 14 files changed, 58 insertions(+), 3 deletions(-)
CHANGELOG entry missing.
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A woman should have compassion. -- Kirk, "Catspaw", stardate 3018.2
PATCH 1/1 Allow top-level distclean target to descend to board Makefiles.
Quoted 7 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you wrote:
Soon, 85xx and 83xx boards will have generated files in
So, they will? Who says so?
Would you mind to elucidate?
Sure. I can't generate _all_ my patches at once. :-)
The next set has generated flat device tree binary gunk derived from a "DTS" source file. To clean up distcleanly, those .dtb and a temporary oftree.c file need to be removed.
I'm hitting up the 85XX ADS and CDS boards. Kumar will be doing the same for the 8349 ADS board.
Thanks!
jdl
PATCH 1/1 Allow top-level distclean target to descend to board Makefiles.
Quoted 2 lines · In message <[email protected]> you wrote:
Sure. I can't generate _all_ my patches at once. :-)
Don't. But don't post patches which hang in the free air either. Please see the README - "If one logical set of modifications affects or creates several files, all these changes shall be submitted in a SINGLE patch file."
Quoted 6 lines
The next set has generated flat device tree binary gunk derived from a "DTS" source file. To clean up distcleanly, those .dtb and a temporary
oftree.cfile need to be removed.I'm hitting up the 85XX ADS and CDS boards. Kumar will be doing the same for the 8349 ADS board.
But the patch touched a lot of other Makefiles, too.
You don't explain what you're trying to fix, or why you think that all this magic in the top level Makefile is necessary.
Best regards,
Wolfgang Denk
Signature · 3 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Go to Heaven for the climate, Hell for the company." - Mark Twain
PATCH 1/1 Allow top-level distclean target to descend to board Makefiles.
In reply to Wolfgang DenkQuoted 4 lines · Wolfgang Denk
In message <[email protected]> you wrote:
CHANGELOG entry missing.
Argh. It's not being derived now?
I'll resubmit the patches...
jdl