* [BK PATCH] build: config vs. everything else
@ 2003-09-08 16:52 Ricky Beam
2003-09-08 18:19 ` Sam Ravnborg
0 siblings, 1 reply; 3+ messages in thread
From: Ricky Beam @ 2003-09-08 16:52 UTC (permalink / raw)
To: Linux Kernel Mail List
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2920 bytes --]
I've long wondered why make {anything}config followed by building anything
else would rebuild a number of mostly unrelated things in scripts. So,
I dug into it (oh, what an ugly web...)
The Story:
The rules for config (and %config) depend on "scripts" which will build
basically everything in scripts. However, there are two problems with this.
First, *config only NEEDS fixdep. Second, the complete build environment is
not setup at config time, so the compiler settings are not consistant. To
illustrate the point, compare scripts/.empty.o.cmd after a "make config" and
"make image" (zImage, whatever)
The "bk send" is attached. Below is the diff. Excuse the "@/bin/true"...
It's the fastest way to get make to shutup.
--Ricky
--- 1.425/Makefile Tue Sep 2 15:13:35 2003
+++ 1.426/Makefile Fri Sep 5 22:25:25 2003
@@ -259,12 +259,13 @@
# Helpers built in scripts/
-scripts/docproc scripts/fixdep scripts/split-include : scripts ;
+scripts/docproc scripts/split-include : scripts ;
-.PHONY: scripts
+.PHONY: scripts scripts/fixdep
scripts:
$(Q)$(MAKE) $(build)=scripts
-
+scripts/fixdep:
+ $(Q)$(MAKE) $(build)=scripts fixdep
# To make sure we do not include .config for any of the *config targets
# catch them early, and hand them over to scripts/kconfig/Makefile
@@ -342,8 +343,8 @@
# If .config is newer than include/linux/autoconf.h, someone tinkered
# with it and forgot to run make oldconfig
-include/linux/autoconf.h: scripts/fixdep .config
- $(Q)$(MAKE) $(build)=scripts/kconfig silentoldconfig
+include/linux/autoconf.h: .config
+ $(Q)$(MAKE) -f $(TOPDIR)/Makefile silentoldconfig
endif
--- 1.34/scripts/Makefile Tue Mar 18 13:19:44 2003
+++ 1.35/scripts/Makefile Fri Sep 5 22:25:25 2003
@@ -22,6 +22,9 @@
# fixdep is needed to compile other host programs
$(addprefix $(obj)/,$(filter-out fixdep,$(always)) $(subdir-y)): $(obj)/fixdep
+fixdep: $(obj)/fixdep
+ @/bin/true
+
# dependencies on generated files need to be listed explicitly
$(obj)/modpost.o $(obj)/file2alias.o: $(obj)/elfconfig.h
@@ -33,3 +36,4 @@
$(call if_changed,elfconfig)
targets += elfconfig.h
+
--- 1.9/scripts/kconfig/Makefile Sun Aug 31 19:13:49 2003
+++ 1.10/scripts/kconfig/Makefile Fri Sep 5 22:25:25 2003
@@ -21,7 +21,7 @@
$< -o arch/$(ARCH)/Kconfig
silentoldconfig: $(obj)/conf
- $< -s arch/$(ARCH)/Kconfig
+ $(Q)$< -s arch/$(ARCH)/Kconfig
.PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
--- 1.9/scripts/kconfig/conf.c Fri Jun 6 10:51:38 2003
+++ 1.10/scripts/kconfig/conf.c Fri Sep 5 22:25:25 2003
@@ -532,7 +532,8 @@
}
break;
case ask_silent:
- if (stat(".config", &tmpstat)) {
+ name = ".config";
+ if (stat(name, &tmpstat)) {
printf("***\n"
"*** You have not yet configured your kernel!\n"
"***\n"
@@ -541,6 +542,8 @@
"***\n");
exit(1);
}
+ conf_read(name);
+ break;
case ask_all:
case ask_new:
conf_read(NULL);
[-- Attachment #2: BK send patch --]
[-- Type: TEXT/PLAIN, Size: 6398 bytes --]
This BitKeeper patch contains the following changesets:
1.1165
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jfbeam
# Host: troz.com
# Root: /usr/src/linux-2.6-bk
#
#--- 1.425/Makefile Tue Sep 2 15:13:35 2003
#+++ 1.426/Makefile Fri Sep 5 22:25:25 2003
#@@ -259,12 +259,13 @@
#
# # Helpers built in scripts/
#
#-scripts/docproc scripts/fixdep scripts/split-include : scripts ;
#+scripts/docproc scripts/split-include : scripts ;
#
#-.PHONY: scripts
#+.PHONY: scripts scripts/fixdep
# scripts:
# $(Q)$(MAKE) $(build)=scripts
#-
#+scripts/fixdep:
#+ $(Q)$(MAKE) $(build)=scripts fixdep
#
# # To make sure we do not include .config for any of the *config targets
# # catch them early, and hand them over to scripts/kconfig/Makefile
#@@ -342,8 +343,8 @@
#
# # If .config is newer than include/linux/autoconf.h, someone tinkered
# # with it and forgot to run make oldconfig
#-include/linux/autoconf.h: scripts/fixdep .config
#- $(Q)$(MAKE) $(build)=scripts/kconfig silentoldconfig
#+include/linux/autoconf.h: .config
#+ $(Q)$(MAKE) -f $(TOPDIR)/Makefile silentoldconfig
#
# endif
#
#
#--- 1.34/scripts/Makefile Tue Mar 18 13:19:44 2003
#+++ 1.35/scripts/Makefile Fri Sep 5 22:25:25 2003
#@@ -22,6 +22,9 @@
# # fixdep is needed to compile other host programs
# $(addprefix $(obj)/,$(filter-out fixdep,$(always)) $(subdir-y)): $(obj)/fixdep
#
#+fixdep: $(obj)/fixdep
#+ @/bin/true
#+
# # dependencies on generated files need to be listed explicitly
#
# $(obj)/modpost.o $(obj)/file2alias.o: $(obj)/elfconfig.h
#@@ -33,3 +36,4 @@
# $(call if_changed,elfconfig)
#
# targets += elfconfig.h
#+
#
#--- 1.9/scripts/kconfig/Makefile Sun Aug 31 19:13:49 2003
#+++ 1.10/scripts/kconfig/Makefile Fri Sep 5 22:25:25 2003
#@@ -21,7 +21,7 @@
# $< -o arch/$(ARCH)/Kconfig
#
# silentoldconfig: $(obj)/conf
#- $< -s arch/$(ARCH)/Kconfig
#+ $(Q)$< -s arch/$(ARCH)/Kconfig
#
# .PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
#
#
#--- 1.9/scripts/kconfig/conf.c Fri Jun 6 10:51:38 2003
#+++ 1.10/scripts/kconfig/conf.c Fri Sep 5 22:25:25 2003
#@@ -532,7 +532,8 @@
# }
# break;
# case ask_silent:
#- if (stat(".config", &tmpstat)) {
#+ name = ".config";
#+ if (stat(name, &tmpstat)) {
# printf("***\n"
# "*** You have not yet configured your kernel!\n"
# "***\n"
#@@ -541,6 +542,8 @@
# "***\n");
# exit(1);
# }
#+ conf_read(name);
#+ break;
# case ask_all:
# case ask_new:
# conf_read(NULL);
#
# Diff checksum=6a129d6a
# Patch vers: 1.3
# Patch type: REGULAR
== ChangeSet ==
torvalds@athlon.transmeta.com|ChangeSet|20020205173056|16047|c1d11a41ed024864
jfbeam@troz.com|ChangeSet|20030906005754|14864
D 1.1165 03/09/05 22:25:56-04:00 jfbeam@troz.com +4 -0
B torvalds@athlon.transmeta.com|ChangeSet|20020205173056|16047|c1d11a41ed024864
C
c [PATCH] consistent "scripts" build
c
c The config targets depend on "scripts". However, fixdep is the only tool actually
c required. At config time, a full target build environment is not setup. Thus,
c scripts/empty.o (et. al.) will be recompiled between any target build and config
c build.
K 9834
P ChangeSet
------------------------------------------------
0a0
> torvalds@athlon.transmeta.com|scripts/Makefile|20020205174035|32289|96b950c69342ce77 jfbeam@troz.com|scripts/Makefile|20030906022525|41592
> zippel@linux-m68k.org[torvalds]|scripts/kconfig/Makefile|20021030043213|15288|5bd1152661e7e933 jfbeam@troz.com|scripts/kconfig/Makefile|20030906022525|32220
> torvalds@athlon.transmeta.com|Makefile|20020205173938|00876|d6ad9c1a8d595a5 jfbeam@troz.com|Makefile|20030906022525|14573
> zippel@linux-m68k.org[torvalds]|scripts/kconfig/conf.c|20021030043213|26561|8b9d1e0a36adabb5 jfbeam@troz.com|scripts/kconfig/conf.c|20030906022525|01802
== Makefile ==
torvalds@athlon.transmeta.com|Makefile|20020205173938|00876|d6ad9c1a8d595a5
jfbeam@spacemeat.troz.com|Makefile|20030902191335|12400
D 1.426 03/09/05 22:25:25-04:00 jfbeam@troz.com +6 -5
B torvalds@athlon.transmeta.com|ChangeSet|20020205173056|16047|c1d11a41ed024864
C
c separate fixdep from "scripts" and make it an independant target
K 14573
O -rw-rw-r--
P Makefile
------------------------------------------------
D262 1
I262 1
scripts/docproc scripts/split-include : scripts ;
D264 1
I264 1
.PHONY: scripts scripts/fixdep
D267 1
I267 2
scripts/fixdep:
$(Q)$(MAKE) $(build)=scripts fixdep
D345 2
I346 2
include/linux/autoconf.h: .config
$(Q)$(MAKE) -f $(TOPDIR)/Makefile silentoldconfig
== scripts/Makefile ==
torvalds@athlon.transmeta.com|scripts/Makefile|20020205174035|32289|96b950c69342ce77
jsimmons@maxwell.earthlink.net|scripts/Makefile|20030318181944|38775
D 1.35 03/09/05 22:25:25-04:00 jfbeam@troz.com +4 -0
B torvalds@athlon.transmeta.com|ChangeSet|20020205173056|16047|c1d11a41ed024864
C
c fixdep target
K 41592
O -rw-rw-r--
P scripts/Makefile
------------------------------------------------
I24 3
fixdep: $(obj)/fixdep
@/bin/true
\
I35 1
\
== scripts/kconfig/Makefile ==
zippel@linux-m68k.org[torvalds]|scripts/kconfig/Makefile|20021030043213|15288|5bd1152661e7e933
akpm@osdl.org[torvalds]|scripts/kconfig/Makefile|20030901012535|32022
D 1.10 03/09/05 22:25:25-04:00 jfbeam@troz.com +1 -1
B torvalds@athlon.transmeta.com|ChangeSet|20020205173056|16047|c1d11a41ed024864
C
c make silentoldconfig obey KBUILD_VERBOSE
K 32220
O -rw-rw-r--
P scripts/kconfig/Makefile
------------------------------------------------
D24 1
I24 1
$(Q)$< -s arch/$(ARCH)/Kconfig
== scripts/kconfig/conf.c ==
zippel@linux-m68k.org[torvalds]|scripts/kconfig/conf.c|20021030043213|26561|8b9d1e0a36adabb5
zippel@linux-m68k.org[torvalds]|scripts/kconfig/conf.c|20030606151850|64174
D 1.10 03/09/05 22:25:25-04:00 jfbeam@troz.com +4 -1
B torvalds@athlon.transmeta.com|ChangeSet|20020205173056|16047|c1d11a41ed024864
C
c make silentoldconfig actually silent
K 1802
O -rw-rw-r--
P scripts/kconfig/conf.c
------------------------------------------------
D535 1
I535 2
name = ".config";
if (stat(name, &tmpstat)) {
I543 2
conf_read(name);
break;
# Patch checksum=b46c30de
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BK PATCH] build: config vs. everything else
2003-09-08 16:52 [BK PATCH] build: config vs. everything else Ricky Beam
@ 2003-09-08 18:19 ` Sam Ravnborg
2003-09-08 18:46 ` Ricky Beam
0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2003-09-08 18:19 UTC (permalink / raw)
To: Ricky Beam, zippel; +Cc: Linux Kernel Mail List, Kai Germaschewski
Hi Ricky, I like your patch, but have a few comments.
> The rules for config (and %config) depend on "scripts" which will build
> basically everything in scripts. However, there are two problems with this.
> First, *config only NEEDS fixdep.
Correct.
> Second, the complete build environment is
> not setup at config time, so the compiler settings are not consistant. To
> illustrate the point, compare scripts/.empty.o.cmd after a "make config" and
> "make image" (zImage, whatever)
Again correct, which is also why we see modpost being built so often.
A few comments to your patch:
> The "bk send" is attached. Below is the diff. Excuse the "@/bin/true"...
> It's the fastest way to get make to shutup.
@: is faster, and used by kbuld today.
> +scripts/fixdep:
> + $(Q)$(MAKE) $(build)=scripts fixdep
Try to avoid special targets when the full name is OK.
No need for the fixdep target in scripts/Makefile
> -include/linux/autoconf.h: scripts/fixdep .config
> - $(Q)$(MAKE) $(build)=scripts/kconfig silentoldconfig
> +include/linux/autoconf.h: .config
> + $(Q)$(MAKE) -f $(TOPDIR)/Makefile silentoldconfig
Nice. But notice that TOPDIR is obsolete, use srctree.
> +fixdep: $(obj)/fixdep
> + @/bin/true
As noted above, this shortcut target is not needed.
> targets += elfconfig.h
> +
Avoid random white space changes.
> --- 1.9/scripts/kconfig/Makefile Sun Aug 31 19:13:49 2003
> +++ 1.10/scripts/kconfig/Makefile Fri Sep 5 22:25:25 2003
> @@ -21,7 +21,7 @@
> $< -o arch/$(ARCH)/Kconfig
>
> silentoldconfig: $(obj)/conf
> - $< -s arch/$(ARCH)/Kconfig
> + $(Q)$< -s arch/$(ARCH)/Kconfig
Unrelated change.
> --- 1.9/scripts/kconfig/conf.c Fri Jun 6 10:51:38 2003
> +++ 1.10/scripts/kconfig/conf.c Fri Sep 5 22:25:25 2003
> @@ -532,7 +532,8 @@
> }
> break;
> case ask_silent:
> - if (stat(".config", &tmpstat)) {
> + name = ".config";
> + if (stat(name, &tmpstat)) {
> printf("***\n"
> "*** You have not yet configured your kernel!\n"
> "***\n"
> @@ -541,6 +542,8 @@
> "***\n");
> exit(1);
> }
> + conf_read(name);
> + break;
What is the purpose of this change?
If it fixes kconfig behaviour it should go separate to Roman Zippel.
I have modified your the patch according to my cooments:
===== Makefile 1.424 vs edited =====
--- 1.424/Makefile Mon Sep 1 01:14:39 2003
+++ edited/Makefile Mon Sep 8 20:09:54 2003
@@ -253,12 +253,14 @@
# Helpers built in scripts/
-scripts/docproc scripts/fixdep scripts/split-include : scripts ;
+scripts/docproc scripts/split-include : scripts ;
-.PHONY: scripts
+.PHONY: scripts scripts/fixdep
scripts:
$(Q)$(MAKE) $(build)=scripts
+scripts/fixdep:
+ $(Q)$(MAKE) $(build)=scripts $@
# To make sure we do not include .config for any of the *config targets
# catch them early, and hand them over to scripts/kconfig/Makefile
@@ -336,8 +338,8 @@
# If .config is newer than include/linux/autoconf.h, someone tinkered
# with it and forgot to run make oldconfig
-include/linux/autoconf.h: scripts/fixdep .config
- $(Q)$(MAKE) $(build)=scripts/kconfig silentoldconfig
+include/linux/autoconf.h: .config
+ $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
endif
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BK PATCH] build: config vs. everything else
2003-09-08 18:19 ` Sam Ravnborg
@ 2003-09-08 18:46 ` Ricky Beam
0 siblings, 0 replies; 3+ messages in thread
From: Ricky Beam @ 2003-09-08 18:46 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: zippel, Linux Kernel Mail List, Kai Germaschewski
On Mon, 8 Sep 2003, Sam Ravnborg wrote:
>> The "bk send" is attached. Below is the diff. Excuse the "@/bin/true"...
>> It's the fastest way to get make to shutup.
>@: is faster, and used by kbuld today.
Noted.
>> +scripts/fixdep:
>> + $(Q)$(MAKE) $(build)=scripts fixdep
>Try to avoid special targets when the full name is OK.
>No need for the fixdep target in scripts/Makefile
I seem to recall doing it this way for some reason. But, the logic is the
same. Oh, now I remember... there has to be an explicit target to get
make to not say "already up to date."
>> targets += elfconfig.h
>> +
>Avoid random white space changes.
Then leave a blank line at the end of the file :-)
>> --- 1.9/scripts/kconfig/Makefile Sun Aug 31 19:13:49 2003
>> +++ 1.10/scripts/kconfig/Makefile Fri Sep 5 22:25:25 2003
>> @@ -21,7 +21,7 @@
>> $< -o arch/$(ARCH)/Kconfig
>>
>> silentoldconfig: $(obj)/conf
>> - $< -s arch/$(ARCH)/Kconfig
>> + $(Q)$< -s arch/$(ARCH)/Kconfig
>Unrelated change.
Strictly speaking...
>> --- 1.9/scripts/kconfig/conf.c Fri Jun 6 10:51:38 2003
>> +++ 1.10/scripts/kconfig/conf.c Fri Sep 5 22:25:25 2003
>> @@ -532,7 +532,8 @@
>> }
>> break;
>> case ask_silent:
>> - if (stat(".config", &tmpstat)) {
>> + name = ".config";
>> + if (stat(name, &tmpstat)) {
>> printf("***\n"
>> "*** You have not yet configured your kernel!\n"
>> "***\n"
>> @@ -541,6 +542,8 @@
>> "***\n");
>> exit(1);
>> }
>> + conf_read(name);
>> + break;
>
>What is the purpose of this change?
>If it fixes kconfig behaviour it should go separate to Roman Zippel.
"-s" (silent) should actually *be* silent. If conf_read() is called without
a config file, it isn't silent. (The use of 'name' is merely an optimization.)
--Ricky
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-09-08 18:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-08 16:52 [BK PATCH] build: config vs. everything else Ricky Beam
2003-09-08 18:19 ` Sam Ravnborg
2003-09-08 18:46 ` Ricky Beam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®