Skip to contentSkip to conversation

Move generated files to include/generated

PATCH/RFC Superseded Sam Ravnborg 4 participants 17 messages Jul 21, 2009 – Jul 22, 2009

Subsystems (27)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

In 2.6.30 we introduced support for adding generated files to a dedicated directory named "include/generated".

This had a number of benefits:

- avoid mixing generated and normal files
- allow us to finally kill the asm symlink
- simpler .gitignore rules
- simpler list of mrproper files

The following patchset introduces use of include/generated in several places as documented by the shortlog:

Sam Ravnborg (10):
kbuild: move bounds.h to include/generated
kbuild: move asm-offsets.h to include/generated
ia64: move nr-irqs.h to include/generated
sh: move machtypes.h to include/generated
arm: move mach-types to include/generated
kbuild: drop asm symlink
kbuild: move compile.h to include/generated drop unneeded include of autoconf.h
kbuild: move autoconf.h to include/generated
kbuild: move utsrelease.h to include/generated

We are left with version.h that is still generated in include/linux.

And there may be a few architecture specific files I have missed.

This patch serie has a few shortcomings...

1)
After applying one _must_ do a "make clean" to get a buildable kernel.
This is because we change the path of autoconf.h but the patch does not include anything to force a new autoconf.h to be created.
Another workaround is to use a simple "make oldconfig".

2)
All files will be rebuild.
We change an option to gcc due to path change of autoconf.h so all files will be rebuild.

3)
If some files are left in include/asm/ we may still pick them up.
This is relevant for asm-offsets.h where we have a lot of "#include <asm/asm-offsets.h>". And include/asm comes before arch/$ARCH/include/asm in the search order.

4)
We loose the check if this is the correct ARCH we are building for as we can no longer check the asm symlink. This shortcoming is addressed by another patch that saves ARCH and CROSS_COMPILE. But it is not part of this serie.

Individual patches will follow.
Patches are based on todays mainline.

It is also available at:

git://git.kernel.org/pub/scm/linux/kernel/git/sam/generated.git

Comments welcome!

Sam

#1 lore raw

PATCH 1/10 kbuild: move bounds.h to include/generated

---
 .gitignore                 |    1 -
 Kbuild                     |    2 +-
 Makefile                   |    2 +-
 include/linux/mmzone.h     |    2 +-
 include/linux/page-flags.h |    2 +-
 kernel/bounds.c            |    2 +-
 6 files changed, 5 insertions(+), 6 deletions(-)
.gitignore +0 -1
index b93fb7e..32855c6 100644
@@ -51,7 +51,6 @@ include/linux/autoconf.h
 include/linux/compile.h
 include/linux/version.h
 include/linux/utsrelease.h
-include/linux/bounds.h
 include/generated
 
 # stgit generated dirs
Kbuild +1 -1
index f056b4f..1165d7a 100644
@@ -8,7 +8,7 @@
 #####
 # 1) Generate bounds.h
 
-bounds-file := include/linux/bounds.h
+bounds-file := include/generated/bounds.h
 
 always  := $(bounds-file)
 targets := $(bounds-file) kernel/bounds.s
Makefile +1 -1
index 79957b3..9bd427e 100644
@@ -1197,7 +1197,7 @@ MRPROPER_DIRS  += include/config include2 usr/include include/generated
 MRPROPER_FILES += .config .config.old include/asm .version .old_version \
                   include/linux/autoconf.h include/linux/version.h      \
                   include/linux/utsrelease.h                            \
-                  include/linux/bounds.h include/asm*/asm-offsets.h     \
+                  include/asm*/asm-offsets.h                            \
 		  Module.symvers Module.markers tags TAGS cscope*
 
 # clean - Delete most, but leave enough to build external modules
include/linux/mmzone.h +1 -1
index 8895985..74800d0 100644
@@ -15,7 +15,7 @@
 #include <linux/seqlock.h>
 #include <linux/nodemask.h>
 #include <linux/pageblock-flags.h>
-#include <linux/bounds.h>
+#include <generated/bounds.h>
 #include <asm/atomic.h>
 #include <asm/page.h>
 
include/linux/page-flags.h +1 -1
index e2e5ce5..e99eaac 100644
@@ -8,7 +8,7 @@
 #include <linux/types.h>
 #ifndef __GENERATING_BOUNDS_H
 #include <linux/mm_types.h>
-#include <linux/bounds.h>
+#include <generated/bounds.h>
 #endif /* !__GENERATING_BOUNDS_H */
 
 /*
kernel/bounds.c +1 -1
index 3c53013..98a51f2 100644
@@ -12,7 +12,7 @@
 
 void foo(void)
 {
-	/* The enum constants to put into include/linux/bounds.h */
+	/* The enum constants to put into include/generated/bounds.h */
 	DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
 	DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
 	/* End of constants */
Signature · 1 line
1.6.2.5
#2 lore raw

PATCH 2/10 kbuild: move asm-offsets.h to include/generated

In reply to Sam Ravnborg

The simplest method was to add an extra asm-offsets.h file in arch/$ARCH/include/asm that references the generated file.

We can now migrate the architectures one-by-one to reference the generated file direct - and when done we can delete the temporary arch/$ARCH/include/asm/asm-offsets.h file.

---
 .gitignore                                |    1 -
 Kbuild                                    |    2 +-
 Makefile                                  |    1 -
 arch/alpha/include/asm/asm-offsets.h      |    1 +
 arch/arm/include/asm/asm-offsets.h        |    1 +
 arch/avr32/include/asm/asm-offsets.h      |    1 +
 arch/blackfin/include/asm/asm-offsets.h   |    1 +
 arch/cris/include/asm/asm-offsets.h       |    1 +
 arch/frv/include/asm/asm-offsets.h        |    1 +
 arch/h8300/include/asm/asm-offsets.h      |    1 +
 arch/ia64/include/asm/asm-offsets.h       |    1 +
 arch/m68k/include/asm/asm-offsets.h       |    1 +
 arch/microblaze/include/asm/asm-offsets.h |    1 +
 arch/mips/include/asm/asm-offsets.h       |    1 +
 arch/mn10300/include/asm/asm-offsets.h    |    1 +
 arch/parisc/include/asm/asm-offsets.h     |    1 +
 arch/powerpc/include/asm/asm-offsets.h    |    1 +
 arch/s390/include/asm/asm-offsets.h       |    1 +
 arch/sh/include/asm/asm-offsets.h         |    1 +
 arch/sparc/include/asm/asm-offsets.h      |    1 +
 arch/um/Makefile                          |    2 +-
 arch/um/include/asm/asm-offsets.h         |    1 +
 arch/x86/include/asm/asm-offsets.h        |    1 +
 arch/xtensa/include/asm/asm-offsets.h     |    1 +
 24 files changed, 22 insertions(+), 4 deletions(-)
 create mode 100644 arch/alpha/include/asm/asm-offsets.h
 create mode 100644 arch/arm/include/asm/asm-offsets.h
 create mode 100644 arch/avr32/include/asm/asm-offsets.h
 create mode 100644 arch/blackfin/include/asm/asm-offsets.h
 create mode 100644 arch/cris/include/asm/asm-offsets.h
 create mode 100644 arch/frv/include/asm/asm-offsets.h
 create mode 100644 arch/h8300/include/asm/asm-offsets.h
 create mode 100644 arch/ia64/include/asm/asm-offsets.h
 create mode 100644 arch/m68k/include/asm/asm-offsets.h
 create mode 100644 arch/microblaze/include/asm/asm-offsets.h
 create mode 100644 arch/mips/include/asm/asm-offsets.h
 create mode 100644 arch/mn10300/include/asm/asm-offsets.h
 create mode 100644 arch/parisc/include/asm/asm-offsets.h
 create mode 100644 arch/powerpc/include/asm/asm-offsets.h
 create mode 100644 arch/s390/include/asm/asm-offsets.h
 create mode 100644 arch/sh/include/asm/asm-offsets.h
 create mode 100644 arch/sparc/include/asm/asm-offsets.h
 create mode 100644 arch/um/include/asm/asm-offsets.h
 create mode 100644 arch/x86/include/asm/asm-offsets.h
 create mode 100644 arch/xtensa/include/asm/asm-offsets.h
.gitignore +0 -1
index 32855c6..5a5024a 100644
@@ -45,7 +45,6 @@ Module.symvers
 # Generated include files
 #
 include/asm
-include/asm-*/asm-offsets.h
 include/config
 include/linux/autoconf.h
 include/linux/compile.h
Kbuild +1 -1
index 1165d7a..e3737ad 100644
@@ -43,7 +43,7 @@ $(obj)/$(bounds-file): kernel/bounds.s Kbuild
 # 2) Generate asm-offsets.h
 #
 
-offsets-file := include/asm/asm-offsets.h
+offsets-file := include/generated/asm-offsets.h
 
 always  += $(offsets-file)
 targets += $(offsets-file)
Makefile +0 -1
index 9bd427e..1f6a34c 100644
@@ -1197,7 +1197,6 @@ MRPROPER_DIRS  += include/config include2 usr/include include/generated
 MRPROPER_FILES += .config .config.old include/asm .version .old_version \
                   include/linux/autoconf.h include/linux/version.h      \
                   include/linux/utsrelease.h                            \
-                  include/asm*/asm-offsets.h                            \
 		  Module.symvers Module.markers tags TAGS cscope*
 
 # clean - Delete most, but leave enough to build external modules
arch/alpha/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/arm/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/avr32/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/blackfin/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/cris/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/frv/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/h8300/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/ia64/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/m68k/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/microblaze/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/mips/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/mn10300/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/parisc/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/powerpc/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/s390/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/sh/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/sparc/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/um/Makefile +1 -1
index 0728def..8936057 100644
@@ -150,6 +150,6 @@ $(SHARED_HEADERS)/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s
 
 $(SHARED_HEADERS)/kern_constants.h:
 	$(Q)mkdir -p $(dir $@)
-	$(Q)echo '#include "../../../../include/asm/asm-offsets.h"' >$@
+	$(Q)echo '#include "../../../../include/generated/asm-offsets.h"' >$@
 
 export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH
arch/um/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/x86/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
arch/xtensa/include/asm/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
Signature · 1 line
1.6.2.5
#3 lore raw

PATCH 3/10 ia64: move nr-irqs.h to include/generated

In reply to Sam Ravnborg

Avoid generating files in the now deprecated asm-ia64 dir Simplified the logic in the Makefile when editing stuff in the area

Cc Al Viro <[email protected]>
Cc Tony Luck <[email protected]>
Cc Fenghua Yu <[email protected]>
---
 arch/ia64/Makefile          |    2 +-
 arch/ia64/include/asm/irq.h |    2 +-
 arch/ia64/kernel/Makefile   |    7 ++-----
 3 files changed, 4 insertions(+), 7 deletions(-)
arch/ia64/Makefile +1 -1
index 58a7e46..e9fcac6 100644
@@ -108,4 +108,4 @@ archprepare: make_nr_irqs_h FORCE
 PHONY += make_nr_irqs_h FORCE
 
 make_nr_irqs_h: FORCE
-	$(Q)$(MAKE) $(build)=arch/ia64/kernel include/asm-ia64/nr-irqs.h
+	$(Q)$(MAKE) $(build)=arch/ia64/kernel include/generated/nr-irqs.h
arch/ia64/include/asm/irq.h +1 -1
index 5282546..91b920f 100644
@@ -13,7 +13,7 @@
 
 #include <linux/types.h>
 #include <linux/cpumask.h>
-#include <asm-ia64/nr-irqs.h>
+#include <generated/nr-irqs.h>
 
 static __inline__ int
 irq_canonicalize (int irq)
arch/ia64/kernel/Makefile +2 -5
index 6b7edca..cedd773 100644
@@ -81,17 +81,14 @@ define cmd_nr_irqs
 endef
 
 # We use internal kbuild rules to avoid the "is up to date" message from make
-arch/$(SRCARCH)/kernel/nr-irqs.s: $(srctree)/arch/$(SRCARCH)/kernel/nr-irqs.c \
-				$(wildcard $(srctree)/include/asm-ia64/*/irq.h)
+arch/ia64/kernel/nr-irqs.s: arch/ia64/kernel/nr-irqs.c
 	$(Q)mkdir -p $(dir $@)
 	$(call if_changed_dep,cc_s_c)
 
-include/asm-ia64/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s
+include/generated/nr-irqs.h: arch/ia64/kernel/nr-irqs.s
 	$(Q)mkdir -p $(dir $@)
 	$(call cmd,nr_irqs)
 
-clean-files += $(objtree)/include/asm-ia64/nr-irqs.h
-
 #
 # native ivt.S, entry.S and fsys.S
 #
Signature · 1 line
1.6.2.5
#4 lore raw

RE: [PATCH 03/10] ia64: move nr-irqs.h to include/generated

Quoted 42 lines

---

arch/ia64/Makefile          |    2 +-
arch/ia64/include/asm/irq.h |    2 +-
arch/ia64/kernel/Makefile   |    7 ++-----
3 files changed, 4 insertions(+), 7 deletions(-)
arch/ia64/Makefile +0 -0
index 58a7e46..e9fcac6 100644
@@ -108,4 +108,4 @@ archprepare: make_nr_irqs_h FORCE

PHONY += make_nr_irqs_h FORCE

make_nr_irqs_h: FORCE

arch/ia64/Makefile +1 -1
-	$(Q)$(MAKE) $(build)=arch/ia64/kernel include/asm-ia64/nr-irqs.h
+	$(Q)$(MAKE) $(build)=arch/ia64/kernel include/generated/nr-irqs.h
arch/ia64/include/asm/irq.h +1 -1
index 5282546..91b920f 100644
@@ -13,7 +13,7 @@
 
 #include <linux/types.h>
 #include <linux/cpumask.h>
-#include <asm-ia64/nr-irqs.h>
+#include <generated/nr-irqs.h>
 

static __inline__ int
irq_canonicalize (int irq)

arch/ia64/kernel/Makefile +0 -0
index 6b7edca..cedd773 100644
@@ -81,17 +81,14 @@ define cmd_nr_irqs

endef

# We use internal kbuild rules to avoid the "is up to date" message from make
-arch/$(SRCARCH)/kernel/nr-irqs.s: $(srctree)/arch/$(SRCARCH)/kernel/nr- irqs.c \

arch/ia64/kernel/Makefile +1 -1
-				$(wildcard $(srctree)/include/asm-ia64/*/irq.h)
+arch/ia64/kernel/nr-irqs.s: arch/ia64/kernel/nr-irqs.c
Quoted 3 lines
	$(Q)mkdir -p $(dir $@)
	$(call if_changed_dep,cc_s_c)

Could you keep the SRCARCH and srctree variables? There is no need to hard code them.

Quoted 10 lines
arch/ia64/kernel/Makefile +1 -1
-include/asm-ia64/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s
+include/generated/nr-irqs.h: arch/ia64/kernel/nr-irqs.s
	$(Q)mkdir -p $(dir $@)
	$(call cmd,nr_irqs)
arch/ia64/kernel/Makefile +0 -2
-clean-files += $(objtree)/include/asm-ia64/nr-irqs.h
-

#

# native ivt.S, entry.S and fsys.S
#

Ditto.

#5 lore raw

Re: [PATCH 03/10] ia64: move nr-irqs.h to include/generated

Quoted 36 lines · Fenghua
Quoted 36 lines

---

arch/ia64/Makefile          |    2 +-
arch/ia64/include/asm/irq.h |    2 +-
arch/ia64/kernel/Makefile   |    7 ++-----
3 files changed, 4 insertions(+), 7 deletions(-)
arch/ia64/Makefile +0 -0
index 58a7e46..e9fcac6 100644
@@ -108,4 +108,4 @@ archprepare: make_nr_irqs_h FORCE

PHONY += make_nr_irqs_h FORCE

make_nr_irqs_h: FORCE

arch/ia64/Makefile +1 -1
-	$(Q)$(MAKE) $(build)=arch/ia64/kernel include/asm-ia64/nr-irqs.h
+	$(Q)$(MAKE) $(build)=arch/ia64/kernel include/generated/nr-irqs.h
arch/ia64/include/asm/irq.h +1 -1
index 5282546..91b920f 100644
@@ -13,7 +13,7 @@
 
 #include <linux/types.h>
 #include <linux/cpumask.h>
-#include <asm-ia64/nr-irqs.h>
+#include <generated/nr-irqs.h>
 

static __inline__ int
irq_canonicalize (int irq)

arch/ia64/kernel/Makefile +0 -0
index 6b7edca..cedd773 100644
@@ -81,17 +81,14 @@ define cmd_nr_irqs

endef

Quoted 11 lines
Quoted 9 lines

# We use internal kbuild rules to avoid the "is up to date" message from make
-arch/$(SRCARCH)/kernel/nr-irqs.s: $(srctree)/arch/$(SRCARCH)/kernel/nr- irqs.c \

arch/ia64/kernel/Makefile +1 -1
-				$(wildcard $(srctree)/include/asm-ia64/*/irq.h)
+arch/ia64/kernel/nr-irqs.s: arch/ia64/kernel/nr-irqs.c
	$(Q)mkdir -p $(dir $@)
	$(call if_changed_dep,cc_s_c)

Could you keep the SRCARCH and srctree variables? There is no need to hard code them.

I will update my patch to continue using SRCARCH.

I usually hardcode the name of the arch because it makes the code IMO more explicit and thus more readable.

The use of srctree is not needed but I can add that back too. Both changes are unrelated to the actual patch and I just rutinely made it look like I would have doen it.

Quoted 6 lines
Quoted 6 lines
arch/ia64/kernel/Makefile +1 -1
-include/asm-ia64/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s
+include/generated/nr-irqs.h: arch/ia64/kernel/nr-irqs.s
	$(Q)mkdir -p $(dir $@)
	$(call cmd,nr_irqs)
Quoted 7 lines
Quoted 5 lines
arch/ia64/kernel/Makefile +0 -2
-clean-files += $(objtree)/include/asm-ia64/nr-irqs.h
-

#

# native ivt.S, entry.S and fsys.S
#

Ditto.

OK.

Sam

#6 lore raw

RE: [PATCH 03/10] ia64: move nr-irqs.h to include/generated

In reply to Sam Ravnborg
Quoted 42 lines

---

arch/ia64/Makefile          |    2 +-
arch/ia64/include/asm/irq.h |    2 +-
arch/ia64/kernel/Makefile   |    7 ++-----
3 files changed, 4 insertions(+), 7 deletions(-)
arch/ia64/Makefile +0 -0
index 58a7e46..e9fcac6 100644
@@ -108,4 +108,4 @@ archprepare: make_nr_irqs_h FORCE

PHONY += make_nr_irqs_h FORCE

make_nr_irqs_h: FORCE

arch/ia64/Makefile +1 -1
-	$(Q)$(MAKE) $(build)=arch/ia64/kernel include/asm-ia64/nr-irqs.h
+	$(Q)$(MAKE) $(build)=arch/ia64/kernel include/generated/nr-irqs.h
arch/ia64/include/asm/irq.h +1 -1
index 5282546..91b920f 100644
@@ -13,7 +13,7 @@
 
 #include <linux/types.h>
 #include <linux/cpumask.h>
-#include <asm-ia64/nr-irqs.h>
+#include <generated/nr-irqs.h>
 

static __inline__ int
irq_canonicalize (int irq)

arch/ia64/kernel/Makefile +0 -0
index 6b7edca..cedd773 100644
@@ -81,17 +81,14 @@ define cmd_nr_irqs

endef

# We use internal kbuild rules to avoid the "is up to date" message from make
-arch/$(SRCARCH)/kernel/nr-irqs.s: $(srctree)/arch/$(SRCARCH)/kernel/nr- irqs.c \

arch/ia64/kernel/Makefile +1 -1
-				$(wildcard $(srctree)/include/asm-ia64/*/irq.h)
+arch/ia64/kernel/nr-irqs.s: arch/ia64/kernel/nr-irqs.c
Quoted 3 lines
	$(Q)mkdir -p $(dir $@)
	$(call if_changed_dep,cc_s_c)

Could you keep the SRCARCH and srctree variables? There is no need to hard code them.

Quoted 10 lines
arch/ia64/kernel/Makefile +1 -1
-include/asm-ia64/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s
+include/generated/nr-irqs.h: arch/ia64/kernel/nr-irqs.s
	$(Q)mkdir -p $(dir $@)
	$(call cmd,nr_irqs)
arch/ia64/kernel/Makefile +0 -2
-clean-files += $(objtree)/include/asm-ia64/nr-irqs.h
-

#

# native ivt.S, entry.S and fsys.S
#

Ditto.

#7 lore raw

PATCH 4/10 sh: move machtypes.h to include/generated

In reply to Sam Ravnborg
---
 arch/sh/Makefile               |    9 ++-------
 arch/sh/include/asm/.gitignore |    1 -
 arch/sh/include/asm/machvec.h  |    2 +-
 arch/sh/tools/Makefile         |    4 ++--
 arch/sh/tools/gen-mach-types   |    2 +-
 5 files changed, 6 insertions(+), 12 deletions(-)
 delete mode 100644 arch/sh/include/asm/.gitignore
arch/sh/Makefile +2 -7
index 75d049b..1b63cfd 100644
@@ -189,10 +189,6 @@ KBUILD_AFLAGS		+= $(cflags-y)
 libs-$(CONFIG_SUPERH32)		:= arch/sh/lib/	$(libs-y)
 libs-$(CONFIG_SUPERH64)		:= arch/sh/lib64/ $(libs-y)
 
-PHONY += maketools FORCE
-
-maketools:  include/linux/version.h FORCE
-	$(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
 
 all: $(KBUILD_IMAGE)
 
@@ -201,7 +197,8 @@ zImage uImage uImage.srec vmlinux.srec: vmlinux
 
 compressed: zImage
 
-archprepare: maketools
+archprepare:
+	$(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
 
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
@@ -213,5 +210,3 @@ define archhelp
 	@echo '  uImage  	           - Create a bootable image for U-Boot'
 	@echo '  uImage.srec  	           - Create an S-record for U-Boot'
 endef
-
-CLEAN_FILES += include/asm-sh/machtypes.h
arch/sh/include/asm/.gitignore deleted +0 -1
deleted file mode 100644
index 378db77..0000000
@@ -1 +0,0 @@
-machtypes.h
arch/sh/include/asm/machvec.h +1 -1
index 84dd377..9c30955 100644
@@ -12,7 +12,7 @@
 
 #include <linux/types.h>
 #include <linux/time.h>
-#include <asm/machtypes.h>
+#include <generated/machtypes.h>
 
 struct sh_machine_vector {
 	void (*mv_setup)(char **cmdline_p);
arch/sh/tools/Makefile +2 -2
index 567516b..558a56b 100644
@@ -10,7 +10,7 @@
 # Shamelessly cloned from ARM.
 #
 
-include/asm-sh/machtypes.h: $(src)/gen-mach-types $(src)/mach-types
+include/generated/machtypes.h: $(src)/gen-mach-types $(src)/mach-types
 	@echo '  Generating $@'
-	$(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
+	$(Q)mkdir -p $(dir $@)
 	$(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
arch/sh/tools/gen-mach-types +1 -1
index 65161e3..f5ff7c5 100644
@@ -1,6 +1,6 @@
 #!/bin/awk
 #
-# Awk script to generate include/asm-sh/machtypes.h
+# Awk script to generate include/generated/machtypes.h
 # Heavily based on arch/arm/tools/gen-mach-types
 #
 BEGIN	{ nr = 0 }
Signature · 1 line
1.6.2.5
#8 lore raw

PATCH 5/10 arm: move mach-types to include/generated

In reply to Sam Ravnborg

Simplified arch/arm/Makefile by dropping the maketools target It was undocumented and not needed

---
 arch/arm/Makefile                 |   14 ++------------
 arch/arm/include/asm/mach-types.h |    1 +
 arch/arm/tools/Makefile           |    2 +-
 arch/arm/tools/gen-mach-types     |    2 +-
 4 files changed, 5 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/include/asm/mach-types.h
arch/arm/Makefile +2 -12
index c877d6d..8b335bf 100644
@@ -226,15 +226,8 @@ all:	$(KBUILD_IMAGE)
 
 boot := arch/arm/boot
 
-#	Update machine arch and proc symlinks if something which affects
-#	them changed.  We use .arch to indicate when they were updated
-#	last, otherwise make uses the target directory mtime.
-
-archprepare: maketools
-
-PHONY += maketools FORCE
-maketools: include/linux/version.h FORCE
-	$(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h
+archprepare:
+	$(Q)$(MAKE) $(build)=arch/arm/tools include/generated/mach-types.h
 
 # Convert bzImage to zImage
 bzImage: zImage
@@ -245,9 +238,6 @@ zImage Image xipImage bootpImage uImage: vmlinux
 zinstall install: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
-CLEAN_FILES += include/asm-arm/mach-types.h \
-	       include/asm-arm/arch include/asm-arm/.arch
-
 # We use MRPROPER_FILES and CLEAN_FILES now
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
arch/arm/include/asm/mach-types.h new file +1 -0
new file mode 100644
index 0000000..948178c
@@ -0,0 +1 @@
+#include <generated/mach-types.h>
arch/arm/tools/Makefile +1 -1
index 1dbaa29..635cb18 100644
@@ -4,7 +4,7 @@
 # Copyright (C) 2001 Russell King
 #
 
-include/asm-arm/mach-types.h: $(src)/gen-mach-types $(src)/mach-types
+include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types
 	@echo '  Generating $@'
 	@mkdir -p $(dir $@)
 	$(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
arch/arm/tools/gen-mach-types +1 -1
index ce319ef..04fef71 100644
@@ -1,6 +1,6 @@
 #!/bin/awk
 #
-# Awk script to generate include/asm-arm/mach-types.h
+# Awk script to generate include/generated/mach-types.h
 #
 BEGIN	{ nr = 0 }
 /^#/	{ next }
Signature · 1 line
1.6.2.5
#9 lore raw

PATCH 6/10 kbuild: drop asm symlink

In reply to Sam Ravnborg

Generated files are no longer saved in include/asm so there is no use left of this.

This also allowed us to get rid of the ugly "include2" directory used for O=... builds.

---
 .gitignore |    1 -
 Makefile   |   51 +++++----------------------------------------------
 2 files changed, 5 insertions(+), 47 deletions(-)
.gitignore +0 -1
index 5a5024a..624e3ab 100644
@@ -44,7 +44,6 @@ Module.symvers
 #
 # Generated include files
 #
-include/asm
 include/config
 include/linux/autoconf.h
 include/linux/compile.h
Makefile +5 -46

93 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#10 lore raw

PATCH 7/10 kbuild: move compile.h to include/generated

In reply to Sam Ravnborg
---
 .gitignore              |    1 -
 arch/x86/boot/version.c |    2 +-
 init/Makefile           |    6 +++---
 init/version.c          |    2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)
.gitignore +0 -1
index 624e3ab..0f594d9 100644
@@ -46,7 +46,6 @@ Module.symvers
 #
 include/config
 include/linux/autoconf.h
-include/linux/compile.h
 include/linux/version.h
 include/linux/utsrelease.h
 include/generated
arch/x86/boot/version.c +1 -1
index 2723d9b..4d88763 100644
@@ -14,7 +14,7 @@
 
 #include "boot.h"
 #include <linux/utsrelease.h>
-#include <linux/compile.h>
+#include <generated/compile.h>
 
 const char kernel_version[] =
 	UTS_RELEASE " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") "
init/Makefile +3 -3
index 4a243df..2bcd810 100644
@@ -16,11 +16,11 @@ mounts-$(CONFIG_BLK_DEV_INITRD)	+= do_mounts_initrd.o
 mounts-$(CONFIG_BLK_DEV_MD)	+= do_mounts_md.o
 
 # files to be removed upon make clean
-clean-files := ../include/linux/compile.h
+clean-files := ../include/generated/compile.h
 
 # dependencies on generated files need to be listed explicitly
 
-$(obj)/version.o: include/linux/compile.h
+$(obj)/version.o: include/generated/compile.h
 
 # compile.h changes depending on hostname, generation number, etc,
 # so we regenerate it always.
@@ -30,7 +30,7 @@ $(obj)/version.o: include/linux/compile.h
        chk_compile.h = :
  quiet_chk_compile.h = echo '  CHK     $@'
 silent_chk_compile.h = :
-include/linux/compile.h: FORCE
+include/generated/compile.h: FORCE
 	@$($(quiet)chk_compile.h)
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
 	"$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"
init/version.c +1 -1
index 52a8b98..82328aa 100644
@@ -6,7 +6,7 @@
  *  May be freely distributed as part of Linux.
  */
 
-#include <linux/compile.h>
+#include <generated/compile.h>
 #include <linux/module.h>
 #include <linux/uts.h>
 #include <linux/utsname.h>
Signature · 1 line
1.6.2.5
#11 lore raw

PATCH 8/10 drop unneeded include of autoconf.h

In reply to Sam Ravnborg

kbuild.h forces include of autoconf.h on the
commandline using -include - so we do not need to
include the file explicit.

---
 arch/cris/arch-v32/kernel/head.S                |    1 -
 arch/cris/kernel/asm-offsets.c                  |    1 -
 arch/cris/kernel/vmlinux.lds.S                  |    1 -
 arch/ia64/kvm/asm-offsets.c                     |    1 -
 drivers/accessibility/braille/braille_console.c |    1 -
 drivers/hid/hid-lg.h                            |    2 --
 drivers/platform/x86/compal-laptop.c            |    1 -
 include/linux/mmdebug.h                         |    2 --
 8 files changed, 0 insertions(+), 10 deletions(-)
arch/cris/arch-v32/kernel/head.S +0 -1
index 3db478e..76266f8 100644
@@ -10,7 +10,6 @@
  * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so
  * -traditional must not be used when assembling this file.
  */
-#include <linux/autoconf.h>
 #include <arch/memmap.h>
 #include <hwregs/reg_rdwr.h>
 #include <hwregs/intr_vect.h>
arch/cris/kernel/asm-offsets.c +0 -1
index ddd6fbb..dd7b8e9 100644
@@ -1,6 +1,5 @@
 #include <linux/sched.h>
 #include <asm/thread_info.h>
-#include <linux/autoconf.h>
 
 /*
  * Generate definitions needed by assembly language modules.
arch/cris/kernel/vmlinux.lds.S +0 -1
index 0d2adfc..8a80d78 100644
@@ -8,7 +8,6 @@
  * the kernel has booted.
  */
 
-#include <linux/autoconf.h>
 #include <asm-generic/vmlinux.lds.h>
 #include <asm/page.h>
 
arch/ia64/kvm/asm-offsets.c +0 -1
index 0c3564a..9324c87 100644
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/autoconf.h>
 #include <linux/kvm_host.h>
 #include <linux/kbuild.h>
 
drivers/accessibility/braille/braille_console.c +0 -1
index d672cfe..cb423f5 100644
@@ -21,7 +21,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/autoconf.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
drivers/hid/hid-lg.h +0 -2
index 27ae750..bf31592 100644
@@ -1,8 +1,6 @@
 #ifndef __HID_LG_H
 #define __HID_LG_H
 
-#include <linux/autoconf.h>
-
 #ifdef CONFIG_LOGITECH_FF
 int lgff_init(struct hid_device *hdev);
 #else
drivers/platform/x86/compal-laptop.c +0 -1
index 11003bb..1a387e7 100644
@@ -51,7 +51,6 @@
 #include <linux/dmi.h>
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
-#include <linux/autoconf.h>
 
 #define COMPAL_DRIVER_VERSION "0.2.6"
 
include/linux/mmdebug.h +0 -2
index 8a55098..ee24ef8 100644
@@ -1,8 +1,6 @@
 #ifndef LINUX_MM_DEBUG_H
 #define LINUX_MM_DEBUG_H 1
 
-#include <linux/autoconf.h>
-
 #ifdef CONFIG_DEBUG_VM
 #define VM_BUG_ON(cond) BUG_ON(cond)
 #else
Signature · 1 line
1.6.2.5
#12 lore raw

PATCH 9/10 kbuild: move autoconf.h to include/generated

In reply to Sam Ravnborg
---
 .gitignore                       |    1 -
 Documentation/kbuild/kconfig.txt |    3 ++-
 Makefile                         |   11 ++++++-----
 arch/m68k/kernel/head.S          |    2 +-
 scripts/basic/fixdep.c           |   10 +++++-----
 scripts/kconfig/confdata.c       |    2 +-
 scripts/mkcompile_h              |    2 +-
 7 files changed, 16 insertions(+), 15 deletions(-)
.gitignore +0 -1
index 0f594d9..91f8e0c 100644
@@ -45,7 +45,6 @@ Module.symvers
 # Generated include files
 #
 include/config
-include/linux/autoconf.h
 include/linux/version.h
 include/linux/utsrelease.h
 include/generated
Documentation/kbuild/kconfig.txt +2 -1
index 849b5e5..ab8dc35 100644
@@ -106,7 +106,8 @@ This environment variable can be set to specify the path & name of the
 KCONFIG_AUTOHEADER
 --------------------------------------------------
 This environment variable can be set to specify the path & name of the
-"autoconf.h" (header) file.  Its default value is "include/linux/autoconf.h".
+"autoconf.h" (header) file.
+Its default value is "include/generated/autoconf.h".
 
 
 ======================================================================
Makefile +6 -5
index 100dfd1..044a3f4 100644
@@ -336,7 +336,7 @@ CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage
 LINUXINCLUDE    := -Iinclude \
                    $(if $(KBUILD_SRC), -I$(srctree)/include)           \
                    -I$(srctree)/arch/$(hdr-arch)/include               \
-                   -include include/linux/autoconf.h
+                   -include include/generated/autoconf.h
 
 KBUILD_CPPFLAGS := -D__KERNEL__
 
@@ -490,17 +490,18 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
 # if auto.conf.cmd is missing then we are probably in a cleaned tree so
 # we execute the config step to be sure to catch updated Kconfig files
 include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
+	$(Q)mkdir -p include/generated
 	$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
 else
-# external modules needs include/linux/autoconf.h and include/config/auto.conf
+# external modules needs include/generated/autoconf.h and include/config/auto.conf
 # but do not care if they are up-to-date. Use auto.conf to trigger the test
 PHONY += include/config/auto.conf
 
 include/config/auto.conf:
-	$(Q)test -e include/linux/autoconf.h -a -e $@ || (		\
+	$(Q)test -e include/generated/autoconf.h -a -e $@ || (		\
 	echo;								\
 	echo "  ERROR: Kernel configuration is invalid.";		\
-	echo "         include/linux/autoconf.h or $@ are missing.";	\
+	echo "         include/generated/autoconf.h or $@ are missing.";\
 	echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
 	echo;								\
 	/bin/false)
@@ -1154,7 +1155,7 @@ CLEAN_FILES +=	vmlinux System.map \
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config usr/include include/generated
 MRPROPER_FILES += .config .config.old .version .old_version             \
-                  include/linux/autoconf.h include/linux/version.h      \
+                  include/linux/version.h                               \
                   include/linux/utsrelease.h                            \
 		  Module.symvers Module.markers tags TAGS cscope*
 
arch/m68k/kernel/head.S +1 -1
index 86edb5f..ef54128 100644
@@ -196,7 +196,7 @@
  * for them and trying to understand what they mean.
  *
  * CONFIG_xxx:	These are the obvious machine configuration defines created
- * during configuration.  These are defined in include/linux/autoconf.h.
+ * during configuration.  These are defined in autoconf.h.
  *
  * CONSOLE:	There is support for head.S console in this file.  This
  * console can talk to a Mac frame buffer, but could easily be extrapolated
scripts/basic/fixdep.c +5 -5
index 72c1520..0aaa208 100644
@@ -17,15 +17,15 @@
  *
  * To use this list as-is however has the drawback that virtually
  * every file in the kernel includes <linux/config.h> which then again
- * includes <linux/autoconf.h>
+ * includes autoconf.h
  *
- * If the user re-runs make *config, linux/autoconf.h will be
+ * If the user re-runs make *config, autoconf.h will be
  * regenerated.  make notices that and will rebuild every file which
  * includes autoconf.h, i.e. basically all files. This is extremely
  * annoying if the user just changed CONFIG_HIS_DRIVER from n to m.
  *
  * So we play the same trick that "mkdep" played before. We replace
- * the dependency on linux/autoconf.h by a dependency on every config
+ * the dependency on autoconf.h by a dependency on every config
  * option which is mentioned in any of the listed prequisites.
  *
  * kconfig populates a tree in include/config/ with an empty file
@@ -74,7 +74,7 @@
  *   cmd_<target> = <cmdline>
  *
  * and then basically copies the .<target>.d file to stdout, in the
- * process filtering out the dependency on linux/autoconf.h and adding
+ * process filtering out the dependency on autoconf.h and adding
  * dependencies on include/config/my/option.h for every
  * CONFIG_MY_OPTION encountered in any of the prequisites.
  *
@@ -326,7 +326,7 @@ void parse_dep_file(void *map, size_t len)
 			p++;
 		}
 		memcpy(s, m, p-m); s[p-m] = 0;
-		if (strrcmp(s, "include/linux/autoconf.h") &&
+		if (strrcmp(s, "include/generated/autoconf.h") &&
 		    strrcmp(s, "arch/um/include/uml-config.h") &&
 		    strrcmp(s, ".ver")) {
 			printf("  %s \\\n", s);
scripts/kconfig/confdata.c +1 -1
index a04da34..600fc72 100644
@@ -776,7 +776,7 @@ int conf_write_autoconf(void)
 
 	name = getenv("KCONFIG_AUTOHEADER");
 	if (!name)
-		name = "include/linux/autoconf.h";
+		name = "include/generated/autoconf.h";
 	if (rename(".tmpconfig.h", name))
 		return 1;
 	name = conf_get_autoconfig_name();
scripts/mkcompile_h +1 -1
index 6a12dd9..b48d04d 100755
@@ -12,7 +12,7 @@ vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
 # So "sudo make install" won't change the "compiled by <user>"
 # do "compiled by root"
 
-if [ -r $TARGET -a ! -O include/linux/autoconf.h ]; then
+if [ -r $TARGET -a ! -O include/generated/autoconf.h ]; then
   vecho "  SKIPPED $TARGET"
   exit 0
 fi
Signature · 1 line
1.6.2.5
#13 lore raw

PATCH 10/10 kbuild: move utsrelease.h to include/generated

In reply to Sam Ravnborg

Fix up all users of utsrelease.h

---
 .gitignore                                   |    1 -
 Makefile                                     |    5 ++---
 arch/alpha/boot/bootp.c                      |    2 +-
 arch/alpha/boot/bootpz.c                     |    2 +-
 arch/alpha/boot/main.c                       |    2 +-
 arch/frv/kernel/setup.c                      |    2 +-
 arch/powerpc/platforms/52xx/efika.c          |    2 +-
 arch/powerpc/platforms/amigaone/setup.c      |    2 +-
 arch/powerpc/platforms/chrp/setup.c          |    2 +-
 arch/powerpc/platforms/powermac/bootx_init.c |    2 +-
 arch/x86/boot/header.S                       |    2 +-
 arch/x86/boot/version.c                      |    2 +-
 drivers/staging/panel/panel.c                |    2 +-
 include/linux/vermagic.h                     |    2 +-
 init/version.c                               |    2 +-
 kernel/kexec.c                               |    2 +-
 kernel/trace/trace.c                         |    2 +-
 17 files changed, 17 insertions(+), 19 deletions(-)
.gitignore +0 -1
index 91f8e0c..4980606 100644
@@ -46,7 +46,6 @@ Module.symvers
 #
 include/config
 include/linux/version.h
-include/linux/utsrelease.h
 include/generated
 
 # stgit generated dirs
Makefile +2 -3
index 044a3f4..985e165 100644
@@ -963,7 +963,7 @@ endif
 # prepare2 creates a makefile if using a separate output directory
 prepare2: prepare3 outputmakefile
 
-prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
+prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
                    include/config/auto.conf
 	$(cmd_crmodverdir)
 
@@ -1005,7 +1005,7 @@ endef
 include/linux/version.h: $(srctree)/Makefile FORCE
 	$(call filechk,version.h)
 
-include/linux/utsrelease.h: include/config/kernel.release FORCE
+include/generated/utsrelease.h: include/config/kernel.release FORCE
 	$(call filechk,utsrelease.h)
 
 PHONY += headerdep
@@ -1156,7 +1156,6 @@ CLEAN_FILES +=	vmlinux System.map \
 MRPROPER_DIRS  += include/config usr/include include/generated
 MRPROPER_FILES += .config .config.old .version .old_version             \
                   include/linux/version.h                               \
-                  include/linux/utsrelease.h                            \
 		  Module.symvers Module.markers tags TAGS cscope*
 
 # clean - Delete most, but leave enough to build external modules
arch/alpha/boot/bootp.c +1 -1
index 3af21c7..3c8d1b2 100644
@@ -9,7 +9,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <linux/mm.h>
 
 #include <asm/system.h>
arch/alpha/boot/bootpz.c +1 -1
index 1036b51..ade3f12 100644
@@ -11,7 +11,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <linux/mm.h>
 
 #include <asm/system.h>
arch/alpha/boot/main.c +1 -1
index 89f3be0..644b7db 100644
@@ -7,7 +7,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <linux/mm.h>
 
 #include <asm/system.h>
arch/frv/kernel/setup.c +1 -1
index 55e4fab..75cf7f4 100644
@@ -10,7 +10,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
arch/powerpc/platforms/52xx/efika.c +1 -1
index bcc69e1..45c0cb9 100644
@@ -10,7 +10,7 @@
  */
 
 #include <linux/init.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <linux/pci.h>
 #include <linux/of.h>
 #include <asm/prom.h>
arch/powerpc/platforms/amigaone/setup.c +1 -1
index 4430353..91c55f7 100644
@@ -14,7 +14,7 @@
 
 #include <linux/kernel.h>
 #include <linux/seq_file.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 
 #include <asm/machdep.h>
 #include <asm/cputable.h>
arch/powerpc/platforms/chrp/setup.c +1 -1
index cd4ad9a..0a6f5ab 100644
@@ -23,7 +23,7 @@
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <linux/pci.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <linux/adb.h>
 #include <linux/module.h>
 #include <linux/delay.h>
arch/powerpc/platforms/powermac/bootx_init.c +1 -1
index cf66091..9dd789a 100644
@@ -12,7 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/init.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <asm/sections.h>
 #include <asm/prom.h>
 #include <asm/page.h>
arch/x86/boot/header.S +1 -1
index b31cc54..93e689f 100644
@@ -16,7 +16,7 @@
  */
 
 #include <asm/segment.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <asm/boot.h>
 #include <asm/e820.h>
 #include <asm/page_types.h>
arch/x86/boot/version.c +1 -1
index 4d88763..2b15aa4 100644
@@ -13,7 +13,7 @@
  */
 
 #include "boot.h"
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <generated/compile.h>
 
 const char kernel_version[] =
drivers/staging/panel/panel.c +1 -1
index c2747bc..4b5d243 100644
@@ -55,7 +55,7 @@
 #include <linux/list.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 
 #include <linux/io.h>
 #include <asm/uaccess.h>
include/linux/vermagic.h +1 -1
index 79b9837..cf97b5b 100644
@@ -1,4 +1,4 @@
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <linux/module.h>
 
 /* Simply sanity version stamp for modules. */
init/version.c +1 -1
index 82328aa..adff586 100644
@@ -10,7 +10,7 @@
 #include <linux/module.h>
 #include <linux/uts.h>
 #include <linux/utsname.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <linux/version.h>
 
 #ifndef CONFIG_KALLSYMS
kernel/kexec.c +1 -1
index ae1c352..6e11ded 100644
@@ -21,7 +21,7 @@
 #include <linux/hardirq.h>
 #include <linux/elf.h>
 #include <linux/elfcore.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <linux/utsname.h>
 #include <linux/numa.h>
 #include <linux/suspend.h>
kernel/trace/trace.c +1 -1
index 8bc8d8a..35b6bba 100644
@@ -12,7 +12,7 @@
  *  Copyright (C) 2004 William Lee Irwin III
  */
 #include <linux/ring_buffer.h>
-#include <linux/utsrelease.h>
+#include <generated/utsrelease.h>
 #include <linux/stacktrace.h>
 #include <linux/writeback.h>
 #include <linux/kallsyms.h>
Signature · 1 line
1.6.2.5
#14 lore raw
In reply to Sam Ravnborg
Quoted 3 lines · Sam Ravnborg

In 2.6.30 we introduced support for adding generated files to a dedicated directory named "include/generated".

Personally, I don't like this, I hate to see
#include <generated/foo.h>
.

Quoted 3 lines

This had a number of benefits:

- avoid mixing generated and normal files

I don't think this is an advantage...

Quoted 1 line

- allow us to finally kill the asm symlink

This makes sense, but it looks like only when 'make O=xxx', no?

Quoted 2 lines

- simpler .gitignore rules
- simpler list of mrproper files

Neither these two.

The benifits we get is little, I think.

Thanks.

maintainer
#15 lore raw
Quoted 6 lines · Amerigo Wang
Quoted 2 lines · Sam Ravnborg

In 2.6.30 we introduced support for adding generated files to a dedicated directory named "include/generated".

Personally, I don't like this, I hate to see
#include <generated/foo.h>

I think that moving the generated files to a common location makes a lot of sense, but it seems easier to move them to include/generated/linux/ or even to (generated/linux/) and then add -Iinclude/generated/ to the gcc command line so you don't need to actually change all the users.

For the files in asm/, you could either add a generated/asm directory or move them to generated/linux/ and change the users.

	Arnd <><
#16 lore raw
Quoted 5 lines · Arnd Bergmann
Quoted 4 lines · Amerigo Wang
Quoted 2 lines · Sam Ravnborg

In 2.6.30 we introduced support for adding generated files to a dedicated directory named "include/generated".

Quoted 8 lines
Quoted 2 lines

Personally, I don't like this, I hate to see
#include <generated/foo.h>

I think that moving the generated files to a common location makes a lot of sense, but it seems easier to move them to include/generated/linux/ or even to (generated/linux/) and then add -Iinclude/generated/ to the gcc command line so you don't need to actually change all the users.

To put some numbers on this..
utsrelease.h - incuded in 19 files
autoconf.h - included in 0 files
bounds.h - included in 2 files
compile.h - included in 1 file
asm-offsets.h - included in 240 files
version.h - included in 184 files

So the only relevant files to discuss here is asm-offsets.h and version.h.

We cannot break "#include <linux/version.h>" because that would break each and every external module.

The solution to this is a simple file:
cat include/linux/version.h
#include <generated.version.h>

For asm-offsets.h the patch-set create an architecture specific asm-offsets.h that include the generated version. But I would prefer to see this redone so they include the generated version directly.
This would also document that asm-offsets.h is a generated file.

The amount of includes pr arch is listed below - not a huge deal to fix up.

alpha      5
arm        30
avr32      3
blackfin   9
cris       3
frv        5
h8300      2
ia64       15
m32r       0
m68k       6
m68knommu  5
microblaze 5
mips       25
mn10300    6
parisc     14
powerpc    43
s390       13
sh         8
sparc      6
um         2
x86        24
xtensa     8

Sam