mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
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>
This commit is contained in:
parent
5047887caf
commit
e6883b1879
1 changed files with 23 additions and 16 deletions
39
Makefile
39
Makefile
|
@ -1010,36 +1010,43 @@ firmware_install: FORCE
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Kernel headers
|
# Kernel headers
|
||||||
INSTALL_HDR_PATH=$(objtree)/usr
|
|
||||||
export INSTALL_HDR_PATH
|
|
||||||
|
|
||||||
HDRFILTER=generic i386 x86_64
|
#Default location for installed headers
|
||||||
HDRARCHES=$(filter-out $(HDRFILTER),$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild)))
|
export INSTALL_HDR_PATH = $(objtree)/usr
|
||||||
|
|
||||||
|
hdr-filter := generic um ppc
|
||||||
|
hdr-archs := $(filter-out $(hdr-filter), \
|
||||||
|
$(patsubst $(srctree)/include/asm-%/Kbuild,%, \
|
||||||
|
$(wildcard $(srctree)/include/asm-*/Kbuild)))
|
||||||
|
hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
|
||||||
|
|
||||||
|
PHONY += __headers
|
||||||
|
__headers: include/linux/version.h scripts_basic FORCE
|
||||||
|
$(Q)$(MAKE) $(build)=scripts scripts/unifdef
|
||||||
|
|
||||||
PHONY += headers_install_all
|
PHONY += headers_install_all
|
||||||
headers_install_all: include/linux/version.h scripts_basic FORCE
|
headers_install_all: __headers
|
||||||
$(Q)$(MAKE) $(build)=scripts scripts/unifdef
|
$(Q)for arch in $(hdr-archs); do \
|
||||||
$(Q)for arch in $(HDRARCHES); do \
|
$(MAKE) ARCH=$$arch $(hdr-inst)=include BIASMDIR=-bi-$$arch ;\
|
||||||
$(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\
|
|
||||||
done
|
done
|
||||||
|
|
||||||
PHONY += headers_install
|
PHONY += headers_install
|
||||||
headers_install: include/linux/version.h scripts_basic FORCE
|
headers_install: __headers
|
||||||
@if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \
|
$(Q)if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \
|
||||||
echo '*** Error: Headers not exportable for this architecture ($(SRCARCH))'; \
|
echo '*** Error: Headers not exportable for this architecture ($(SRCARCH))'; \
|
||||||
exit 1 ; fi
|
exit 1 ; \
|
||||||
$(Q)$(MAKE) $(build)=scripts scripts/unifdef
|
fi
|
||||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include
|
$(Q)$(MAKE) $(hdr-inst)=include ARCH=$(SRCARCH)
|
||||||
|
|
||||||
PHONY += headers_check_all
|
PHONY += headers_check_all
|
||||||
headers_check_all: headers_install_all
|
headers_check_all: headers_install_all
|
||||||
$(Q)for arch in $(HDRARCHES); do \
|
$(Q)for arch in $(hdr-archs); do \
|
||||||
$(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch HDRCHECK=1 ;\
|
$(MAKE) ARCH=$$arch $(hdr-inst)=include BIASMDIR=-bi-$$arch HDRCHECK=1 ;\
|
||||||
done
|
done
|
||||||
|
|
||||||
PHONY += headers_check
|
PHONY += headers_check
|
||||||
headers_check: headers_install
|
headers_check: headers_install
|
||||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include HDRCHECK=1
|
$(Q)$(MAKE) $(hdr-inst)=include ARCH=$(SRCARCH) HDRCHECK=1
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Modules
|
# Modules
|
||||||
|
|
Loading…
Reference in a new issue