aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2008-06-09 15:24:28 -0400
committerSam Ravnborg <sam@ravnborg.org>2008-07-25 16:11:44 -0400
commit88181ec30f58a28cd78b26aaac38bef4062b23dc (patch)
tree91f83bc96d0b07e0d18ec1182f9d17cc9c9c730d
parentf6ecd4c84a279a7c82f45687a612302becd7b844 (diff)
kbuild: only one call for include/ in make headers_*
Move it to the top-level file to decide if we install/check the generic headers or the arch specific headers. This revealed a long standing bug where "make headers_check_all" relied on the files in asm/ for the current architecture. So make headers_check_all is now broken by this commit. In addition: o add a simpler way to detect if an arch support exporting header files. o add 'set -e;' so we error out early if make headers_check_all fails. o add sparc64 and cris to arch we do not process in make headers_*_all because: sparc64 - use sparc to export headers cris - is know seriously broken Includes suggestions from: David Woodhouse <dwmw2@infradead.org>. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: David Woodhouse <dwmw2@infradead.org>
-rw-r--r--Makefile24
-rw-r--r--include/Kbuild5
-rw-r--r--scripts/Makefile.headersinst9
3 files changed, 16 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 33e735c90655..2f0136401ba0 100644
--- a/Makefile
+++ b/Makefile
@@ -1014,7 +1014,7 @@ firmware_install: FORCE
1014#Default location for installed headers 1014#Default location for installed headers
1015export INSTALL_HDR_PATH = $(objtree)/usr 1015export INSTALL_HDR_PATH = $(objtree)/usr
1016 1016
1017hdr-filter := generic um ppc 1017hdr-filter := generic um ppc sparc64 cris
1018hdr-archs := $(filter-out $(hdr-filter), \ 1018hdr-archs := $(filter-out $(hdr-filter), \
1019 $(patsubst $(srctree)/include/asm-%/Kbuild,%, \ 1019 $(patsubst $(srctree)/include/asm-%/Kbuild,%, \
1020 $(wildcard $(srctree)/include/asm-*/Kbuild))) 1020 $(wildcard $(srctree)/include/asm-*/Kbuild)))
@@ -1026,29 +1026,31 @@ __headers: include/linux/version.h scripts_basic FORCE
1026 1026
1027PHONY += headers_install_all 1027PHONY += headers_install_all
1028headers_install_all: __headers 1028headers_install_all: __headers
1029 $(Q)$(MAKE) $(hdr-inst)=include
1029 $(Q)set -e; for arch in $(hdr-archs); do \ 1030 $(Q)set -e; for arch in $(hdr-archs); do \
1030 $(MAKE) ARCH=$$arch SRCARCH=$$arch $(hdr-inst)=include \ 1031 $(MAKE) $(hdr-inst)=include/asm-$$arch \
1031 BIASMDIR=-bi-$$arch ;\ 1032 SRCARCH=$$arch dst=include/asm-$$arch; \
1032 done 1033 done
1033 1034
1034PHONY += headers_install 1035PHONY += headers_install
1035headers_install: __headers 1036headers_install: __headers
1036 $(Q)if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ 1037 $(if $(wildcard $(srctree)/include/asm-$(SRCARCH)/Kbuild),, \
1037 echo '*** Error: Headers not exportable for this architecture ($(SRCARCH))'; \ 1038 $(error Headers not exportable for this architecture ($(SRCARCH))))
1038 exit 1 ; \ 1039 $(Q)$(MAKE) $(hdr-inst)=include
1039 fi 1040 $(Q)$(MAKE) $(hdr-inst)=include/asm-$(SRCARCH) dst=include/asm
1040 $(Q)$(MAKE) $(hdr-inst)=include ARCH=$(SRCARCH)
1041 1041
1042PHONY += headers_check_all 1042PHONY += headers_check_all
1043headers_check_all: headers_install_all 1043headers_check_all: headers_install_all
1044 $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
1044 $(Q)set -e; for arch in $(hdr-archs); do \ 1045 $(Q)set -e; for arch in $(hdr-archs); do \
1045 $(MAKE) ARCH=$$arch SRCARCH=$$arch $(hdr-inst)=include \ 1046 $(MAKE) SRCARCH=$$arch $(hdr-inst)=include/asm-$$arch HDRCHECK=1 ;\
1046 BIASMDIR=-bi-$$arch HDRCHECK=1 ;\
1047 done 1047 done
1048 1048
1049PHONY += headers_check 1049PHONY += headers_check
1050headers_check: headers_install 1050headers_check: headers_install
1051 $(Q)$(MAKE) $(hdr-inst)=include ARCH=$(SRCARCH) HDRCHECK=1 1051 $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
1052 $(Q)$(MAKE) $(hdr-inst)=include/asm-$(SRCARCH) \
1053 dst=include/asm HDRCHECK=1
1052 1054
1053# --------------------------------------------------------------------------- 1055# ---------------------------------------------------------------------------
1054# Modules 1056# Modules
diff --git a/include/Kbuild b/include/Kbuild
index bdca155028ec..d8c3e3cbf416 100644
--- a/include/Kbuild
+++ b/include/Kbuild
@@ -1,3 +1,6 @@
1# Top-level Makefile calls into asm-$(ARCH)
2# List only non-arch directories below
3
1header-y += asm-generic/ 4header-y += asm-generic/
2header-y += linux/ 5header-y += linux/
3header-y += sound/ 6header-y += sound/
@@ -5,5 +8,3 @@ header-y += mtd/
5header-y += rdma/ 8header-y += rdma/
6header-y += video/ 9header-y += video/
7header-y += drm/ 10header-y += drm/
8
9header-y += asm-$(ARCH)/
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 599adc63b84c..599503f0e5f2 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -28,15 +28,6 @@ include $(kbuild-file)
28 28
29include scripts/Kbuild.include 29include scripts/Kbuild.include
30 30
31# If this is include/asm-$(ARCH) then override $(_dst) so that
32# we install to include/asm directly.
33# Unless $(BIASMDIR) is set, in which case we're probably doing
34# a 'headers_install_all' build and we should keep the -$(ARCH)
35# in the directory name.
36ifeq ($(obj),include/asm-$(ARCH)$(BIASMDIR))
37 _dst := include/asm
38endif
39
40install := $(INSTALL_HDR_PATH)/$(_dst) 31install := $(INSTALL_HDR_PATH)/$(_dst)
41 32
42header-y := $(sort $(header-y) $(unifdef-y)) 33header-y := $(sort $(header-y) $(unifdef-y))