Skip to contentSkip to conversation

Makefile: restore support for board shortcut targets

PATCH New Mike Frysinger 3 participants 4 messages Aug 11, 2010 – Sep 12, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: restore support for board shortcut targets

The helpful shortcut for doing a board config + make was dropped recently as it conflicted with some new build code. However, the reason for using pattern targets originally was to avoid managing a duplicate list of boards. Since we now have one centralized place for a list of boards (the new boards.cfg), we don't need a pattern target -- we can generate the exact list of boards on the fly. So do just that.

When cleaning things up, the top level gitignore file ignores all things that end with ".depend", but the clean target only deletes files that are named exactly ".depend". Keep these in sync by having the clean target punt all files that match the pattern that gitignore is using.

---
 Makefile |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
Makefile +4 -3
index 4f1cb1b..f9eb4a2 100644
@@ -487,8 +487,9 @@ unconfig:
 %_config::	unconfig
 	@$(MKCONFIG) -A $(@:_config=)
 
-##%: %_config
-##	$(MAKE)
+sinclude .boards.depend
+.boards.depend:	boards.cfg
+	awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
 
 #
 # Functions to generate common board directory names
@@ -2468,7 +2469,7 @@ clean:
 		| xargs rm -f
 
 clobber:	clean
-	@find $(OBJTREE) -type f \( -name .depend \
+	@find $(OBJTREE) -type f \( -name '*.depend' \
 		-o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
 		-print0 \
 		| xargs -0 rm -f
Signature · 1 line
1.7.2
#1 lore raw

PATCH 1/1 Makefile: restore support for board shortcut targets

Quoted 6 lines · Mike Frysinger

The helpful shortcut for doing a board config + make was dropped recently as it conflicted with some new build code. ?However, the reason for using pattern targets originally was to avoid managing a duplicate list of boards. ?Since we now have one centralized place for a list of boards (the new boards.cfg), we don't need a pattern target -- we can generate the exact list of boards on the fly. ?So do just that.

hmm, i guess boards.cfg doesnt contain 100% of the boards as it doesnt support the ones that use the -t option to mkconfig or other exotic things, but i think this patch is still good to go
-mike

#2 lore raw

PATCH 1/1 Makefile: restore support for board shortcut targets

Hi Mike,

Quoted 11 lines · Mike Frysinger
Quoted 6 lines

The helpful shortcut for doing a board config + make was dropped recently as it conflicted with some new build code. ?However, the reason for using pattern targets originally was to avoid managing a duplicate list of boards. ?Since we now have one centralized place for a list of boards (the new boards.cfg), we don't need a pattern target -- we can generate the exact list of boards on the fly. ?So do just that.

hmm, i guess boards.cfg doesnt contain 100% of the boards as it doesnt support the ones that use the -t option to mkconfig or other exotic things, but i think this patch is still good to go

Yep, the generalization of the "-t" construct for boards.cfg is still missing. This will end up by being one entry in boards.cfg for all supported targets and then "-t" for mkconfig can go away.

So yes, the patch is good.

Wolfgang, what was our last idea that "-t" construct? Unfortunately I cannot remember...

Signature · 8 lines
BUGS:
  It is not yet possible to change operating system by writing to
  /proc/sys/kernel/ostype.
                                     -- Linux sysctl(2) man page
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#3 lore raw

PATCH 1/1 Makefile: restore support for board shortcut targets

In reply to Mike Frysinger

Dear Mike Frysinger,

Quoted 12 lines · In message <[email protected]> you wrote:

The helpful shortcut for doing a board config + make was dropped recently as it conflicted with some new build code. However, the reason for using pattern targets originally was to avoid managing a duplicate list of boards. Since we now have one centralized place for a list of boards (the new boards.cfg), we don't need a pattern target -- we can generate the exact list of boards on the fly. So do just that.

When cleaning things up, the top level gitignore file ignores all things that end with ".depend", but the clean target only deletes files that are named exactly ".depend". Keep these in sync by having the clean target punt all files that match the pattern that gitignore is using.

Quoted 4 lines
---
 Makefile |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Applied to "next" branch.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In any group of employed individuals the only naturally  early  riser
is  _always_  the office manager, who will _always_ leave reproachful
little notes ... on the desks of their subordinates.
                                - Terry Pratchett, _Lords and Ladies_