Skip to content

Commit 07aea3a

Browse files
Sam RavnborgSam Ravnborg
authored andcommitted
kbuild: use in-kernel unifdef
Let headers_install use in-kernel unifdef Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
1 parent 14a036d commit 07aea3a

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,8 @@ INSTALL_HDR_PATH=$(objtree)/usr
893893
export INSTALL_HDR_PATH
894894

895895
PHONY += headers_install
896-
headers_install: include/linux/version.h
897-
$(Q)unifdef -Ux /dev/null
896+
headers_install: include/linux/version.h scripts_basic FORCE
897+
$(Q)$(MAKE) $(build)=scripts scripts/unifdef
898898
$(Q)rm -rf $(INSTALL_HDR_PATH)/include
899899
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include
900900

scripts/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ hostprogs-$(CONFIG_IKCONFIG) += bin2c
1515

1616
always := $(hostprogs-y)
1717

18+
# The following hostprogs-y programs are only build on demand
19+
hostprogs-y += unifdef
20+
1821
subdir-$(CONFIG_MODVERSIONS) += genksyms
1922
subdir-$(CONFIG_MODULES) += mod
2023

scripts/Makefile.headersinst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# ==========================================================================
99

10-
UNIFDEF := unifdef -U__KERNEL__
10+
UNIFDEF := scripts/unifdef -U__KERNEL__
1111

1212
# Eliminate the contents of (and inclusions of) compiler.h
1313
HDRSED := sed -e "s/ inline / __inline__ /g" \

0 commit comments

Comments
 (0)