aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-12-22 04:12:01 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-22 11:55:51 -0500
commitef129412b4cbd6686d0749612cb9b76e207271f4 (patch)
tree54492763733c957405d938a74fb0ac99da927f9b /Makefile
parent0888f06ac99f993df2bb4c479f5b9306dafe154f (diff)
[PATCH] build compile.h earlier
compile.h is created super-late in the build. But proc_misc.c want to include it, and it's generally not sane to have a header file in include/linux be created at the end of the build: it's either not present or, worse, wrong for most of the build. So the patch arranges for compile.h to be built at the start of the build process. It also consolidates the compile.h rules with those for version.h and utsname.h, so they all get built together. I hope. My chances of having got this right are about 2%. Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 22 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 4a4720387936..97155a8fd73c 100644
--- a/Makefile
+++ b/Makefile
@@ -368,10 +368,14 @@ endif
368# Detect when mixed targets is specified, and make a second invocation 368# Detect when mixed targets is specified, and make a second invocation
369# of make so .config is not included in this case either (for *config). 369# of make so .config is not included in this case either (for *config).
370 370
371no-dot-config-targets := clean mrproper distclean \ 371PHONY += generated_headers
372
373generated_headers: include/linux/version.h include/linux/compile.h \
374 include/linux/utsrelease.h
375
376no-dot-config-targets := generated_headers clean mrproper distclean \
372 cscope TAGS tags help %docs check% \ 377 cscope TAGS tags help %docs check% \
373 include/linux/version.h headers_% \ 378 headers_% kernelrelease kernelversion
374 kernelrelease kernelversion
375 379
376config-targets := 0 380config-targets := 0
377mixed-targets := 0 381mixed-targets := 0
@@ -734,6 +738,16 @@ debug_kallsyms: .tmp_map$(last_kallsyms)
734 738
735endif # ifdef CONFIG_KALLSYMS 739endif # ifdef CONFIG_KALLSYMS
736 740
741# compile.h changes depending on hostname, generation number, etc,
742# so we regenerate it always.
743# mkcompile_h will make sure to only update the
744# actual file if its content has changed.
745
746include/linux/compile.h: FORCE
747 @echo ' CHK $@'
748 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
749 "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(CFLAGS)"
750
737# vmlinux image - including updated kernel symbols 751# vmlinux image - including updated kernel symbols
738vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE 752vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
739ifdef CONFIG_HEADERS_CHECK 753ifdef CONFIG_HEADERS_CHECK
@@ -852,8 +866,8 @@ endif
852# prepare2 creates a makefile if using a separate output directory 866# prepare2 creates a makefile if using a separate output directory
853prepare2: prepare3 outputmakefile 867prepare2: prepare3 outputmakefile
854 868
855prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ 869prepare1: prepare2 generated_headers include/asm include/config/auto.conf
856 include/asm include/config/auto.conf 870
857ifneq ($(KBUILD_MODULES),) 871ifneq ($(KBUILD_MODULES),)
858 $(Q)mkdir -p $(MODVERDIR) 872 $(Q)mkdir -p $(MODVERDIR)
859 $(Q)rm -f $(MODVERDIR)/* 873 $(Q)rm -f $(MODVERDIR)/*
@@ -922,14 +936,14 @@ export INSTALL_HDR_PATH
922HDRARCHES=$(filter-out generic,$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild))) 936HDRARCHES=$(filter-out generic,$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild)))
923 937
924PHONY += headers_install_all 938PHONY += headers_install_all
925headers_install_all: include/linux/version.h scripts_basic FORCE 939headers_install_all: generated_headers scripts_basic FORCE
926 $(Q)$(MAKE) $(build)=scripts scripts/unifdef 940 $(Q)$(MAKE) $(build)=scripts scripts/unifdef
927 $(Q)for arch in $(HDRARCHES); do \ 941 $(Q)for arch in $(HDRARCHES); do \
928 $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\ 942 $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\
929 done 943 done
930 944
931PHONY += headers_install 945PHONY += headers_install
932headers_install: include/linux/version.h scripts_basic FORCE 946headers_install: generated_headers scripts_basic FORCE
933 @if [ ! -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \ 947 @if [ ! -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \
934 echo '*** Error: Headers not exportable for this architecture ($(ARCH))'; \ 948 echo '*** Error: Headers not exportable for this architecture ($(ARCH))'; \
935 exit 1 ; fi 949 exit 1 ; fi
@@ -1026,8 +1040,7 @@ CLEAN_FILES += vmlinux System.map \
1026# Directories & files removed with 'make mrproper' 1040# Directories & files removed with 'make mrproper'
1027MRPROPER_DIRS += include/config include2 usr/include 1041MRPROPER_DIRS += include/config include2 usr/include
1028MRPROPER_FILES += .config .config.old include/asm .version .old_version \ 1042MRPROPER_FILES += .config .config.old include/asm .version .old_version \
1029 include/linux/autoconf.h include/linux/version.h \ 1043 include/linux/autoconf.h generated-headers \
1030 include/linux/utsrelease.h \
1031 Module.symvers tags TAGS cscope* 1044 Module.symvers tags TAGS cscope*
1032 1045
1033# clean - Delete most, but leave enough to build external modules 1046# clean - Delete most, but leave enough to build external modules