--- Makefile | 15 +++++++++++++++ tools/kconfig/Makefile | 29 ++++++++++++++++++----------- tools/kconfig/POTFILES.in | 24 ++++++++++++------------ tools/kconfig/gconf.c | 2 +- tools/kconfig/kconfig_load.c | 2 +- 5 files changed, 47 insertions(+), 25 deletions(-)
diff --git a/Makefile b/Makefile index 384bf79..b67c8fc 100644 --- a/Makefile +++ b/Makefile @@ -193,10 +193,25 @@ src/%.hex: src/%.dsl
$(OUT)ccode32flat.o: src/acpi-dsdt.hex
+####### Kconfig rules +export HOSTCC := $(CC) +export CONFIG_SHELL := sh +export KCONFIG_AUTOHEADER := autoconf.h +export KCONFIG_CONFIG := $(CURDIR)/.config +MAKEFLAGS += --no-print-directory + +%onfig: + $(Q)mkdir -p $(OUT)/tools/kconfig/lxdialog + $(Q)mkdir -p $(OUT)/include/config + $(Q)$(MAKE) -C $(OUT) -f $(CURDIR)/tools/kconfig/Makefile srctree=$(CURDIR) src=tools/kconfig obj=tools/kconfig Q=$(Q) Kconfig=$(CURDIR)/src/Kconfig $@ + ####### Generic rules clean: $(Q)rm -rf $(OUT)
+distclean: clean + $(Q)rm -f .config .config.old + $(OUT): $(Q)mkdir $@
diff --git a/tools/kconfig/Makefile b/tools/kconfig/Makefile index 368ae30..890243b 100644 --- a/tools/kconfig/Makefile +++ b/tools/kconfig/Makefile @@ -30,8 +30,9 @@ oldconfig: $(obj)/conf $< --$@ $(Kconfig)
silentoldconfig: $(obj)/conf + @echo " Build Kconfig config file" $(Q)mkdir -p include/generated - $< --$@ $(Kconfig) + $(Q)$< --$@ $(Kconfig)
# if no path is given, then use src directory to find file ifdef LSMOD @@ -80,7 +81,7 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h $(Q)xgettext --default-domain=linux \ --add-comments --keyword=_ --keyword=N_ \ --from-code=UTF-8 \ - --files-from=scripts/kconfig/POTFILES.in \ + --files-from=tools/kconfig/POTFILES.in \ --output $(obj)/config.pot $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot $(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch @@ -109,15 +110,8 @@ savedefconfig: $(obj)/conf $< --$@=defconfig $(Kconfig)
defconfig: $(obj)/conf -ifeq ($(KBUILD_DEFCONFIG),) - $< --defconfig $(Kconfig) -else - @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" - $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) -endif - -%_defconfig: $(obj)/conf - $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) + @echo " Build default config" + $(Q)$< --defconfig=/dev/null $(Kconfig)
# Help text used by make help help: @@ -352,3 +346,16 @@ lex.%.c: %.l cp $@ $@_shipped
endif + +VPATH := $(srctree) + +$(obj)/%:: $(src)/%_shipped + $(Q)cat $< > $@ + +host-cobjs := $(sort $(foreach m,$(hostprogs-y),$($(m)-objs))) +host-cobjs := $(addprefix $(obj)/,$(host-cobjs)) +hostprogs-y := $(addprefix $(obj)/,$(hostprogs-y)) +$(host-cobjs) : $(obj)/%.o : $(src)/%.c + $(Q)$(HOSTCC) -I$(obj) -I$(srctree)/$(src) $(HOSTCFLAGS) $(HOSTCFLAGS_$(@F)) $(HOST_EXTRACFLAGS) -c -o $@ $< +$(hostprogs-y) : $(obj)/% : $(host-cobjs) + $(Q)$(HOSTCC) $(HOSTLDFLAGS) -o $@ $(addprefix $(obj)/,$($(@F)-objs)) $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) diff --git a/tools/kconfig/POTFILES.in b/tools/kconfig/POTFILES.in index 9674573..f0baccd 100644 --- a/tools/kconfig/POTFILES.in +++ b/tools/kconfig/POTFILES.in @@ -1,12 +1,12 @@ -scripts/kconfig/lxdialog/checklist.c -scripts/kconfig/lxdialog/inputbox.c -scripts/kconfig/lxdialog/menubox.c -scripts/kconfig/lxdialog/textbox.c -scripts/kconfig/lxdialog/util.c -scripts/kconfig/lxdialog/yesno.c -scripts/kconfig/mconf.c -scripts/kconfig/conf.c -scripts/kconfig/confdata.c -scripts/kconfig/gconf.c -scripts/kconfig/gconf.glade.h -scripts/kconfig/qconf.cc +tools/kconfig/lxdialog/checklist.c +tools/kconfig/lxdialog/inputbox.c +tools/kconfig/lxdialog/menubox.c +tools/kconfig/lxdialog/textbox.c +tools/kconfig/lxdialog/util.c +tools/kconfig/lxdialog/yesno.c +tools/kconfig/mconf.c +tools/kconfig/conf.c +tools/kconfig/confdata.c +tools/kconfig/gconf.c +tools/kconfig/gconf.glade.h +tools/kconfig/qconf.cc diff --git a/tools/kconfig/gconf.c b/tools/kconfig/gconf.c index 4558961..b7f31f2 100644 --- a/tools/kconfig/gconf.c +++ b/tools/kconfig/gconf.c @@ -1521,7 +1521,7 @@ int main(int ac, char *av[]) /* Determine GUI path */ env = getenv(SRCTREE); if (env) - glade_file = g_strconcat(env, "/scripts/kconfig/gconf.glade", NULL); + glade_file = g_strconcat(env, "/tools/kconfig/gconf.glade", NULL); else if (av[0][0] == '/') glade_file = g_strconcat(av[0], ".glade", NULL); else diff --git a/tools/kconfig/kconfig_load.c b/tools/kconfig/kconfig_load.c index dbdcaad..2d0cff8 100644 --- a/tools/kconfig/kconfig_load.c +++ b/tools/kconfig/kconfig_load.c @@ -15,7 +15,7 @@ void kconfig_load(void)
handle = dlopen("./libkconfig.so", RTLD_LAZY); if (!handle) { - handle = dlopen("./scripts/kconfig/libkconfig.so", RTLD_LAZY); + handle = dlopen("./tools/kconfig/libkconfig.so", RTLD_LAZY); if (!handle) { fprintf(stderr, "%s\n", dlerror()); exit(1);