Skip to content

Commit

Permalink
make: use KConfiglib
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Braunwarth <[email protected]>
  • Loading branch information
d4nuu8 committed Jan 18, 2025
1 parent 7df4fae commit 994853f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ $(call set_if_default_or_unset,PKG_CONFIG,pkg-config)
AWK = awk
INSTALLKERNEL := installkernel
PERL = perl
PYTHON = python3

CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void $(CF)
Expand All @@ -226,6 +227,9 @@ KBUILD_AFLAGS := -D__ASSEMBLY__
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)

# KConfiglib
KCONFIGLIB = $(srctree)/scripts/KConfiglib

export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
export CPP AR NM STRIP OBJCOPY OBJDUMP
export MAKE AWK GENKSYMS INSTALLKERNEL PERL UTS_MACHINE
Expand Down Expand Up @@ -316,13 +320,13 @@ ifeq ($(config-targets),1)
#include $(srctree)/arch/$(SRCARCH)/Makefile
export KBUILD_DEFCONFIG KBUILD_KCONFIG

config: scripts_basic outputmakefile FORCE
%config: scripts_basic outputmakefile FORCE
$(Q)mkdir -p include/linux include/config
$(Q)$(MAKE) $(build)=scripts/kconfig $@
$(Q)$(PYTHON) $(KCONFIGLIB)/$@.py

%config: scripts_basic outputmakefile FORCE
%_defconfig: scripts_basic outputmakefile FORCE
$(Q)mkdir -p include/linux include/config
$(Q)$(MAKE) $(build)=scripts/kconfig $@
$(Q)$(PYTHON) $(KCONFIGLIB)/defconfig.py $(srctree)/configs/$@

else

Expand All @@ -344,8 +348,10 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
# if auto.conf.cmd is missing then we are probably in a cleaned tree so
# we execute the config step to be sure to catch updated Kconfig files
include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig

$(Q)mkdir -p $(srctree)/include/config $(srctree)/include/generated
$(Q)$(PYTHON) $(KCONFIGLIB)/genconfig.py \
--header-path $(srctree)/include/generated/autoconf.h \
--sync-deps $(srctree)/include/config

else
# Dummy target needed, because used as prerequisite
Expand Down

0 comments on commit 994853f

Please sign in to comment.