aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2008-06-05 10:43:46 -0400
committerSam Ravnborg <sam@ravnborg.org>2008-07-25 16:08:37 -0400
commite6883b187920e71ae57bbc9c07885afdd83ddc4e (patch)
tree4b4dac56f8de17f4505d39f355ebc0df4d1a4c5b
parent5047887caf1806f31652210df27fb62a7c43f27d (diff)
kbuild: refactor headers_* targets in Makefile
o Use lower case for local variables o Add a helper target for common targets o Use $(hdr-inst)= ... to make Make invocations simpler o Add -rR to make invocations In total this adds more lines than it removes but the benefit is better readability Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: David Woodhouse <dwmw2@infradead.org>
-rw-r--r--Makefile39
1 files changed, 23 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 4bcd1cf90cb1..f95066176ddf 100644
--- a/Makefile
+++ b/Makefile
@@ -1010,36 +1010,43 @@ firmware_install: FORCE
1010 1010
1011# --------------------------------------------------------------------------- 1011# ---------------------------------------------------------------------------
1012# Kernel headers 1012# Kernel headers
1013INSTALL_HDR_PATH=$(objtree)/usr
1014export INSTALL_HDR_PATH
1015 1013
1016HDRFILTER=generic i386 x86_64 1014#Default location for installed headers
1017HDRARCHES=$(filter-out $(HDRFILTER),$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild))) 1015export INSTALL_HDR_PATH = $(objtree)/usr
1018 1016
1019PHONY += headers_install_all 1017hdr-filter := generic um ppc
1020headers_install_all: include/linux/version.h scripts_basic FORCE 1018hdr-archs := $(filter-out $(hdr-filter), \
1019 $(patsubst $(srctree)/include/asm-%/Kbuild,%, \
1020 $(wildcard $(srctree)/include/asm-*/Kbuild)))
1021hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
1022
1023PHONY += __headers
1024__headers: include/linux/version.h scripts_basic FORCE
1021 $(Q)$(MAKE) $(build)=scripts scripts/unifdef 1025 $(Q)$(MAKE) $(build)=scripts scripts/unifdef
1022 $(Q)for arch in $(HDRARCHES); do \ 1026
1023 $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\ 1027PHONY += headers_install_all
1028headers_install_all: __headers
1029 $(Q)for arch in $(hdr-archs); do \
1030 $(MAKE) ARCH=$$arch $(hdr-inst)=include BIASMDIR=-bi-$$arch ;\
1024 done 1031 done
1025 1032
1026PHONY += headers_install 1033PHONY += headers_install
1027headers_install: include/linux/version.h scripts_basic FORCE 1034headers_install: __headers
1028 @if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ 1035 $(Q)if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \
1029 echo '*** Error: Headers not exportable for this architecture ($(SRCARCH))'; \ 1036 echo '*** Error: Headers not exportable for this architecture ($(SRCARCH))'; \
1030 exit 1 ; fi 1037 exit 1 ; \
1031 $(Q)$(MAKE) $(build)=scripts scripts/unifdef 1038 fi
1032 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include 1039 $(Q)$(MAKE) $(hdr-inst)=include ARCH=$(SRCARCH)
1033 1040
1034PHONY += headers_check_all 1041PHONY += headers_check_all
1035headers_check_all: headers_install_all 1042headers_check_all: headers_install_all
1036 $(Q)for arch in $(HDRARCHES); do \ 1043 $(Q)for arch in $(hdr-archs); do \
1037 $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch HDRCHECK=1 ;\ 1044 $(MAKE) ARCH=$$arch $(hdr-inst)=include BIASMDIR=-bi-$$arch HDRCHECK=1 ;\
1038 done 1045 done
1039 1046
1040PHONY += headers_check 1047PHONY += headers_check
1041headers_check: headers_install 1048headers_check: headers_install
1042 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include HDRCHECK=1 1049 $(Q)$(MAKE) $(hdr-inst)=include ARCH=$(SRCARCH) HDRCHECK=1
1043 1050
1044# --------------------------------------------------------------------------- 1051# ---------------------------------------------------------------------------
1045# Modules 1052# Modules