From 2cc210c92fec4dd2977dd6022ddc1e0b77f4c269 Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Sun, 20 Jun 2010 23:05:32 +0200 Subject: kconfig: build in BUILD_DIR/buildroot-config This way the main buildroot dir can be completely read-only for out-of-tree builds Signed-off-by: Peter Korsgaard --- package/config/Makefile | 24 ++++++++++++++---------- package/config/gconf.c | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'package/config') diff --git a/package/config/Makefile b/package/config/Makefile index 197c50026..34cc4b705 100644 --- a/package/config/Makefile +++ b/package/config/Makefile @@ -1,4 +1,3 @@ -obj := . src := . top_srcdir=../../ top_builddir=../../ @@ -16,23 +15,28 @@ host-cmulti := $(foreach m,$(__hostprogs),\ $(if $($(m)-cxxobjs),,$(if $($(m)-objs),$(m)))) host-cxxmulti := $(foreach m,$(__hostprogs),\ $(if $($(m)-cxxobjs),$(m),$(if $($(m)-objs),))) -host-cobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-objs))) -host-cxxobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-cxxobjs))) +host-cobjs := $(addprefix $(obj)/,$(sort $(foreach m,$(__hostprogs),$($(m)-objs)))) +host-cxxobjs := $(addprefix $(obj)/,$(sort $(foreach m,$(__hostprogs),$($(m)-cxxobjs)))) + +HOST_EXTRACFLAGS += -I$(obj) $(host-csingle): %: %.c - $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $< $(HOST_LOADLIBES) -o $@ + $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $< $(HOST_LOADLIBES) -o $(obj)/$@ $(host-cmulti): %: $(host-cobjs) $(host-cshlib) - $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $($@-objs) $(HOST_LOADLIBES) $(HOSTLOADLIBES_$@) -o $@ + $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $(addprefix $(obj)/,$($(@F)-objs)) $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) -o $(obj)/$@ $(host-cxxmulti): %: $(host-cxxobjs) $(host-cobjs) $(host-cshlib) - $(HOSTCXX) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCXXFLAGS_$@) $($@-objs) $($@-cxxobjs) $(HOSTLOADLIBES_$@) -o $@ + $(HOSTCXX) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCXXFLAGS_$@) $(addprefix $(obj)/,$($(@F)-objs) $($(@F)-cxxobjs)) $(HOSTLOADLIBES_$(@F)) -o $(obj)/$@ + +$(obj)/%.o: %.c + $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$(@F)) -c $< -o $@ -$(host-cobjs): %.o: %.c - $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) -c $< -o $@ +$(obj)/%.o: $(obj)/%.c + $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$(@F)) -c $< -o $@ -$(host-cxxobjs): %.o: %.cc - $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCXXFLAGS_$@) -c $< -o $@ +$(obj)/%.o: %.cc + $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCXXFLAGS_$(@F)) -c $< -o $@ $(obj)/%:: $(src)/%_shipped $(Q)cat $< > $@ diff --git a/package/config/gconf.c b/package/config/gconf.c index b8a1661a9..7c4c76cf6 100644 --- a/package/config/gconf.c +++ b/package/config/gconf.c @@ -1576,7 +1576,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, "/package/config/gconf.glade", NULL); else if (av[0][0] == '/') glade_file = g_strconcat(av[0], ".glade", NULL); else -- cgit v1.2.3