Skip to contentSkip to conversation

make help ARCH=xx fun

DISCUSSION James H. Cloos Jr. 4 participants 11 messages Feb 21, 2004 – Feb 25, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

I was looking at the arch-specific make options for various archs, and found this bit of fun:

:; make help ARCH=sh
[elided]
Architecture specific targets (sh):
zImage - Compressed kernel image (arch/sh/boot/zImage)
SCCS - Build for arch/sh/configs/SCCS

  defconfig-adx           - Build for adx
  defconfig-cqreek        - Build for cqreek
  defconfig-dreamcast     - Build for dreamcast
  defconfig-hp680         - Build for hp680
  defconfig-se7751        - Build for se7751
  defconfig-snapgear      - Build for snapgear
  defconfig-systemh       - Build for systemh

[elided]

The defconfig options only show up after a bk get in arch/sh/configs/.

There are also several archs that do not have any arch-specific help. ppc64 (unlike ppc) is one such example.

-JimC

#1 lore raw
Quoted 15 lines · James H. Cloos Jr.

I was looking at the arch-specific make options for various archs, and found this bit of fun:

:; make help ARCH=sh
[elided]
Architecture specific targets (sh):
zImage - Compressed kernel image (arch/sh/boot/zImage)
SCCS - Build for arch/sh/configs/SCCS

  defconfig-adx           - Build for adx
  defconfig-cqreek        - Build for cqreek
  defconfig-dreamcast     - Build for dreamcast
  defconfig-hp680         - Build for hp680
  defconfig-se7751        - Build for se7751
  defconfig-snapgear      - Build for snapgear
  defconfig-systemh       - Build for systemh
Quoted 3 lines

[elided]

The defconfig options only show up after a bk get in arch/sh/configs/.

The sh people have decided to create the list based on the content of the directory. Therefore you see the SCCS entry, and that's why you need to do a 'bk bet'. In general you cannot expect the konfig and build system to work 100% if there is random files missing in the tree. Those files bk can checkout automatically is more by luck - and no effort has been put into making this a trustworthy way to do it.

I expect sh to change their defconfig system to the same infrastructure as used by ppc, arm and others.

Quoted 2 lines

There are also several archs that do not have any arch-specific help. ppc64 (unlike ppc) is one such example.

Patches are welcome.

Sam

#2 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sam" == Sam Ravnborg <[email protected]> writes:

Sam> The sh people have decided to create the list based on the Sam> content of the directory. Therefore you see the SCCS entry,

I thought that went w/o saying....

The points were that if doing a readdir(3) in the tree for config files, it would not be a bad idea to ignore directories and that each arch should have arch-specific make help support (the cited example was that ppc64 lacked it even though ppc had some).

-JimC

#3 lore raw
In reply to Sam Ravnborg
Quoted 18 lines · Sam Ravnborg
Quoted 17 lines · James H. Cloos Jr.

I was looking at the arch-specific make options for various archs, and found this bit of fun:

:; make help ARCH=sh
[elided]
Architecture specific targets (sh):
zImage - Compressed kernel image (arch/sh/boot/zImage)
SCCS - Build for arch/sh/configs/SCCS

  defconfig-adx           - Build for adx
  defconfig-cqreek        - Build for cqreek
  defconfig-dreamcast     - Build for dreamcast
  defconfig-hp680         - Build for hp680
  defconfig-se7751        - Build for se7751
  defconfig-snapgear      - Build for snapgear
  defconfig-systemh       - Build for systemh

[elided]

Quoted 7 lines
Quoted 1 line

The defconfig options only show up after a bk get in arch/sh/configs/.

The sh people have decided to create the list based on the content of the directory. Therefore you see the SCCS entry, and that's why you need to do a 'bk bet'. In general you cannot expect the konfig and build system to work 100% if there is random files missing in the tree. Those files bk can checkout automatically is more by luck - and no effort has been put into making this a trustworthy way to do it.

Hmm. Would something (untested) like the following be horribly wrong/bad?

define archhelp
@echo ' zImage - Compressed kernel image (arch/sh/boot/zImage)'
@if [ -d arch/$(ARCH)/configs/SCCS ]; then bk get -q arch/$(ARCH)/configs/;fi
# Assume board_defconfig

	for board in arch/$(ARCH)/configs/*defconfig; \
        do \
                 echo -n ' ' $$board | sed -e 's|arch/$(ARCH)/configs/||g' ; \
                 echo -n '        - Build for ' ; \
                 echo -e $$board | sed -e 's|.*_||g'; \
        done

endef

I kinda like the idea of documenting the various defconfig targets, in make help, so maybe even adding that to the normal help section iff arch/$(ARCH)/configs exists... Thoughts?

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#4 lore raw
Quoted 8 lines

Hmm. Would something (untested) like the following be horribly wrong/bad?

define archhelp
@echo ' zImage - Compressed kernel image (arch/sh/boot/zImage)'
@if [ -d arch/$(ARCH)/configs/SCCS ]; then bk get -q arch/$(ARCH)/configs/;fi
# Assume board_defconfig

Quoted 7 lines
	for board in arch/$(ARCH)/configs/*defconfig; \
        do \
                 echo -n ' ' $$board | sed -e 's|arch/$(ARCH)/configs/||g' ; \
                 echo -n '        - Build for ' ; \
                 echo -e $$board | sed -e 's|.*_||g'; \
        done

endef

I do not want kbuild to be cluttered with bk specific stuff. Also the "- Build for xxxxx" is not good enough.

I will try to come up with a patch the uses a file named arch/$(ARCH)/configs/index.txt
to actually display the help text. Gim'me a few hours.

Sam

#5 lore raw
Quoted 16 lines · Sam Ravnborg
Quoted 8 lines

Hmm. Would something (untested) like the following be horribly wrong/bad?

define archhelp
@echo ' zImage - Compressed kernel image (arch/sh/boot/zImage)'
@if [ -d arch/$(ARCH)/configs/SCCS ]; then bk get -q arch/$(ARCH)/configs/;fi
# Assume board_defconfig

Quoted 7 lines
	for board in arch/$(ARCH)/configs/*defconfig; \
        do \
                 echo -n ' ' $$board | sed -e 's|arch/$(ARCH)/configs/||g' ; \
                 echo -n '        - Build for ' ; \
                 echo -e $$board | sed -e 's|.*_||g'; \
        done

endef

Quoted 1 line

I do not want kbuild to be cluttered with bk specific stuff.

I can understand that. How about:
for board in arch/$(ARCH)/configs/*defconfig; \
do \
if [ -f $board ]; then

    ...

fi
done

Quoted 1 line

Also the "- Build for xxxxx" is not good enough.

Erm, it's usually something descriptive enough, if one is firmiliar with the platform / what's intended to build.

Quoted 2 lines

I will try to come up with a patch the uses a file named arch/$(ARCH)/configs/index.txt

The 'issue' with configs/index.txt, I'll wager, is that for every new board, that's one more file to modify (and thus possibly conflict on).

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#6 lore raw
Quoted 8 lines · Tom Rini

I can understand that. How about:
for board in arch/$(ARCH)/configs/*defconfig; \
do \
if [ -f $board ]; then

    ...

fi
done

Simply just matching on *defconfig should be fine. I already changed this on matching defconfig-* for sh to get around matching SCCS.

Quoted 11 lines
Quoted 1 line

Also the "- Build for xxxxx" is not good enough.

Erm, it's usually something descriptive enough, if one is firmiliar with the platform / what's intended to build.

Quoted 2 lines

I will try to come up with a patch the uses a file named arch/$(ARCH)/configs/index.txt

The 'issue' with configs/index.txt, I'll wager, is that for every new board, that's one more file to modify (and thus possibly conflict on).

Agreed. The whole reason I did the automated "- Build for foo" thing is that it's completely automated, and people building should already know what their target is (if not, they can look at arch/$(ARCH)/Kconfig and figure it out). I suppose it's not particularly descriptive, but it seems more sensible to have an abbreviated help text then none whatsoever.

#7 lore raw
Quoted 11 lines · Paul Mundt
Quoted 8 lines · Tom Rini

I can understand that. How about:
for board in arch/$(ARCH)/configs/*defconfig; \
do \
if [ -f $board ]; then

    ...

fi
done

Simply just matching on *defconfig should be fine. I already changed this on matching defconfig-* for sh to get around matching SCCS.

Would you mind changing to foo_defconfig from defconfig-foo ? Then you get the make foo_defconfig rule for free.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#8 lore raw
Quoted 6 lines · Tom Rini
Quoted 2 lines

Simply just matching on *defconfig should be fine. I already changed this on matching defconfig-* for sh to get around matching SCCS.

Would you mind changing to foo_defconfig from defconfig-foo ? Then you get the make foo_defconfig rule for free.

Yes, I plan on doing this in the next sh update. I did the defconfig-foo stuff before foo_defconfig existed, that's the only reason it's different at this point..

#9 lore raw
In reply to Tom Rini
Quoted 6 lines
Quoted 3 lines

I will try to come up with a patch the uses a file named arch/$(ARCH)/configs/index.txt

The 'issue' with configs/index.txt, I'll wager, is that for every new board, that's one more file to modify (and thus possibly conflict on).

What about the following patch.
This adds the support to the top-level Makefile, enabling this for all _defconfig users.
I used 'printf' to get proper alignment. Otherwise arm for example looked really ugly.
Is printf generally supported?

Sam

===== Makefile 1.456 vs edited =====

Makefile +8 -0
@@ -889,6 +889,9 @@
 # Brief documentation of the typical targets used
 # ---------------------------------------------------------------------------
 
+boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig)
+boards := $(notdir $(boards))
+
 help:
 	@echo  'Cleaning targets:'
 	@echo  '  clean		  - remove most generated files but keep the config'
@@ -914,6 +917,11 @@
 	@$(if $(archhelp),$(archhelp),\
 		echo '  No architecture specific help defined for $(ARCH)')
 	@echo  ''
+	@$(if $(boards), \
+		$(foreach b, $(boards), \
+		printf " %24s - Build for %s\\n" $(b) $(b);) \
+		echo '')
+	
 	@echo  '  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
 	@echo  '  make O=dir [targets] Locate all output files in "dir", including .config'
 	@echo  '  make C=1   [targets] Check all c source with checker tool'
#10 lore raw
Quoted 4 lines · Sam Ravnborg
Quoted 4 lines
Quoted 3 lines

I will try to come up with a patch the uses a file named arch/$(ARCH)/configs/index.txt

Quoted 8 lines
Quoted 2 lines

The 'issue' with configs/index.txt, I'll wager, is that for every new board, that's one more file to modify (and thus possibly conflict on).

What about the following patch.
This adds the support to the top-level Makefile, enabling this for all _defconfig users.
I used 'printf' to get proper alignment. Otherwise arm for example looked really ugly.

Looks quite good, thanks.

Quoted 1 line

Is printf generally supported?

It's part of coreutils on debian (and shellutils on others), so I'll wager a yes.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/