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
Unified · Split
| @@ -1010,36 +1010,43 @@ firmware_install: FORCE · 1009 unmodified lines | ||
| 1010 | 1010 | |
| 1011 | 1011 | # --------------------------------------------------------------------------- |
| 1012 | 1012 | # Kernel headers |
| 1013 | −INSTALL_HDR_PATH=$(objtree)/usr | |
| 1014 | −export INSTALL_HDR_PATH | |
| 1015 | 1013 | |
| 1016 | −HDRFILTER=generic i386 x86_64 | |
| 1017 | −HDRARCHES=$(filter-out $(HDRFILTER),$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild))) | |
| 1014 | +#Default location for installed headers | |
| 1015 | +export INSTALL_HDR_PATH = $(objtree)/usr | |
| 1018 | 1016 | |
| 1019 | −PHONY += headers_install_all | |
| 1020 | −headers_install_all: include/linux/version.h scripts_basic FORCE | |
| 1017 | +hdr-filter := generic um ppc | |
| 1018 | +hdr-archs := $(filter-out $(hdr-filter), \ | |
| 1019 | + $(patsubst $(srctree)/include/asm-%/Kbuild,%, \ | |
| 1020 | + $(wildcard $(srctree)/include/asm-*/Kbuild))) | |
| 1021 | +hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj | |
| 1022 | + | |
| 1023 | +PHONY += __headers | |
| 1024 | +__headers: include/linux/version.h scripts_basic FORCE | |
| 1021 | 1025 | $(Q)$(MAKE) $(build)=scripts scripts/unifdef |
| 1022 | − $(Q)for arch in $(HDRARCHES); do \ | |
| 1023 | − $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\ | |
| 1026 | + | |
| 1027 | +PHONY += headers_install_all | |
| 1028 | +headers_install_all: __headers | |
| 1029 | + $(Q)for arch in $(hdr-archs); do \ | |
| 1030 | + $(MAKE) ARCH=$$arch $(hdr-inst)=include BIASMDIR=-bi-$$arch ;\ | |
| 1024 | 1031 | done |
| 1025 | 1032 | |
| 1026 | 1033 | PHONY += headers_install |
| 1027 | −headers_install: include/linux/version.h scripts_basic FORCE | |
| 1028 | − @if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ | |
| 1034 | +headers_install: __headers | |
| 1035 | + $(Q)if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ | |
| 1029 | 1036 | echo '*** Error: Headers not exportable for this architecture ($(SRCARCH))'; \ |
| 1030 | − exit 1 ; fi | |
| 1031 | − $(Q)$(MAKE) $(build)=scripts scripts/unifdef | |
| 1032 | − $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include | |
| 1037 | + exit 1 ; \ | |
| 1038 | + fi | |
| 1039 | + $(Q)$(MAKE) $(hdr-inst)=include ARCH=$(SRCARCH) | |
| 1033 | 1040 | |
| 1034 | 1041 | PHONY += headers_check_all |
| 1035 | 1042 | headers_check_all: headers_install_all |
| 1036 | − $(Q)for arch in $(HDRARCHES); do \ | |
| 1037 | − $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch HDRCHECK=1 ;\ | |
| 1043 | + $(Q)for arch in $(hdr-archs); do \ | |
| 1044 | + $(MAKE) ARCH=$$arch $(hdr-inst)=include BIASMDIR=-bi-$$arch HDRCHECK=1 ;\ | |
| 1038 | 1045 | done |
| 1039 | 1046 | |
| 1040 | 1047 | PHONY += headers_check |
| 1041 | 1048 | headers_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 | 1052 | # Modules |