summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--Makefile204
-rw-r--r--package/config/.gitignore1
-rw-r--r--package/config/Makefile1
-rw-r--r--package/config/confdata.c53
-rw-r--r--package/config/lkc.h1
-rw-r--r--package/config/util.c33
7 files changed, 178 insertions, 116 deletions
diff --git a/CHANGES b/CHANGES
index ff8300cf1..c06b3cc44 100644
--- a/CHANGES
+++ b/CHANGES
@@ -24,6 +24,7 @@
#401: new package: ffmpeg
#835: Package Dataflashboot-1.05 does not compile with buildroot...
+ #1213: Move .config into output directory
#1753: lmbench: convert to generic package infrastructure
#1771: Fakeroot and the target/generic/device_table.txt create bad...
#1807: LZMA 4.32.7, Required header file(s) are missing
diff --git a/Makefile b/Makefile
index 794a2987b..ef78de120 100644
--- a/Makefile
+++ b/Makefile
@@ -43,10 +43,28 @@ comma:=,
empty:=
space:=$(empty) $(empty)
+ifneq ("$(origin O)", "command line")
+O:=output
+CONFIG_DIR:=$(TOPDIR)
+else
+# other packages might also support Linux-style out of tree builds
+# with the O=<dir> syntax (E.G. Busybox does). As make automatically
+# forwards command line variable definitions those packages get very
+# confused. Fix this by telling make to not do so
+MAKEOVERRIDES =
+# strangely enough O is still passed to submakes with MAKEOVERRIDES
+# (with make 3.81 atleast), the only thing that changes is the output
+# of the origin function (command line -> environment).
+# Unfortunately some packages don't look at origin (E.G. uClibc 0.9.31+)
+# To really make O go away, we have to override it.
+override O:=$(O)
+CONFIG_DIR:=$(O)
+endif
+
# $(shell find . -name *_defconfig |sed 's/.*\///')
# Pull in the user's configuration file
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
--include .config
+-include $(CONFIG_DIR)/.config
endif
# Override BR2_DL_DIR if shell variable defined
@@ -135,6 +153,16 @@ FCFLAGS_FOR_BUILD:=-g -O2
endif
export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD
+# bash prints the name of the directory on 'cd <dir>' if CDPATH is
+# set, so unset it here to not cause problems. Notice that the export
+# line doesn't affect the environment of $(shell ..) calls, so
+# explictly throw away any output from 'cd' here.
+export CDPATH:=
+BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
+$(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
+
+BUILD_DIR:=$(BASE_DIR)/build
+
ifeq ($(BR2_HAVE_DOT_CONFIG),y)
@@ -225,37 +253,11 @@ ZCAT:=$(call qstrip,$(BR2_ZCAT))
BZCAT:=$(call qstrip,$(BR2_BZCAT))
TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf
-ifneq ("$(origin O)", "command line")
-O:=output
-else
-# other packages might also support Linux-style out of tree builds
-# with the O=<dir> syntax (E.G. Busybox does). As make automatically
-# forwards command line variable definitions those packages get very
-# confused. Fix this by telling make to not do so
-MAKEOVERRIDES =
-# strangely enough O is still passed to submakes with MAKEOVERRIDES
-# (with make 3.81 atleast), the only thing that changes is the output
-# of the origin function (command line -> environment).
-# Unfortunately some packages don't look at origin (E.G. uClibc 0.9.31+)
-# To really make O go away, we have to override it.
-override O:=$(O)
-endif
-
-# bash prints the name of the directory on 'cd <dir>' if CDPATH is
-# set, so unset it here to not cause problems. Notice that the export
-# line doesn't affect the environment of $(shell ..) calls, so
-# explictly throw away any output from 'cd' here.
-export CDPATH:=
-BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
-$(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
-
DL_DIR=$(call qstrip,$(BR2_DL_DIR))
ifeq ($(DL_DIR),)
DL_DIR:=$(TOPDIR)/dl
endif
-BUILD_DIR:=$(BASE_DIR)/build
-
GNU_TARGET_SUFFIX:=-$(call qstrip,$(BR2_GNU_TARGET_SUFFIX))
STAGING_DIR:=$(call qstrip,$(BR2_STAGING_DIR))
@@ -285,7 +287,7 @@ include package/Makefile.in
all: world
# In this section, we need .config
-include .config.cmd
+include $(CONFIG_DIR)/.config.cmd
# We also need the various per-package makefiles, which also add
# each selected package to TARGETS if that package was selected
@@ -332,10 +334,10 @@ TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS))
# all targets depend on the crosscompiler and it's prerequisites
$(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
-$(BR2_DEPENDS_DIR): .config
- rm -rf $@
- mkdir -p $(@D)
- cp -dpRf $(CONFIG)/buildroot-config $@
+$(BR2_DEPENDS_DIR): $(CONFIG_DIR)/.config
+# rm -rf $@
+# mkdir -p $(@D)
+# cp -dpRf $(CONFIG)/buildroot-config $@
dirs: $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
$(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
@@ -443,7 +445,7 @@ show-targets:
ifeq ($(BR2_CONFIG_CACHE),y)
# drop configure cache if configuration is changed
-$(BUILD_DIR)/tgt-config.cache: .config
+$(BUILD_DIR)/tgt-config.cache: $(CONFIG_DIR)/.config
rm -f $@
touch $@
@@ -461,99 +463,99 @@ HOSTCFLAGS=$(CFLAGS_FOR_BUILD)
export HOSTCFLAGS
$(CONFIG)/%onf:
- mkdir -p $(CONFIG)/buildroot-config
+ mkdir -p $(BUILD_DIR)/buildroot-config
$(MAKE) CC="$(HOSTCC)" -C $(CONFIG) $(notdir $@)
- -@if [ ! -f .config ]; then \
- cp $(CONFIG_DEFCONFIG) .config; \
+ -@if [ ! -f $(CONFIG_DIR)/.config ]; then \
+ cp $(CONFIG_DEFCONFIG) $(CONFIG_DIR)/.config; \
fi
xconfig: $(CONFIG)/qconf
- @mkdir -p $(CONFIG)/buildroot-config
- @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- $(CONFIG)/qconf $(CONFIG_CONFIG_IN); then \
- test -f .config.cmd || rm -f .config; \
+ @mkdir -p $(BUILD_DIR)/buildroot-config
+ @if ! KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/qconf $(CONFIG_CONFIG_IN); then \
+ test -f $(CONFIG_DIR)/.config.cmd || rm -f $(CONFIG_DIR)/.config; \
fi
gconfig: $(CONFIG)/gconf
- @mkdir -p $(CONFIG)/buildroot-config
- @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- $(CONFIG)/gconf $(CONFIG_CONFIG_IN); then \
- test -f .config.cmd || rm -f .config; \
+ @mkdir -p $(BUILD_DIR)/buildroot-config
+ @if ! KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/gconf $(CONFIG_CONFIG_IN); then \
+ test -f $(CONFIG_DIR)/.config.cmd || rm -f $(CONFIG_DIR)/.config; \
fi
menuconfig: $(CONFIG)/mconf
- @mkdir -p $(CONFIG)/buildroot-config
- @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- $(CONFIG)/mconf $(CONFIG_CONFIG_IN); then \
- test -f .config.cmd || rm -f .config; \
+ @mkdir -p $(BUILD_DIR)/buildroot-config
+ @if ! KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/mconf $(CONFIG_CONFIG_IN); then \
+ test -f $(CONFIG_DIR)/.config.cmd || rm -f $(CONFIG_DIR)/.config; \
fi
config: $(CONFIG)/conf
- @mkdir -p $(CONFIG)/buildroot-config
- @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- $(CONFIG)/conf $(CONFIG_CONFIG_IN)
+ @mkdir -p $(BUILD_DIR)/buildroot-config
+ @KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/conf $(CONFIG_CONFIG_IN)
oldconfig: $(CONFIG)/conf
- mkdir -p $(CONFIG)/buildroot-config
- @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- $(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
+ mkdir -p $(BUILD_DIR)/buildroot-config
+ @KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
randconfig: $(CONFIG)/conf
- @mkdir -p $(CONFIG)/buildroot-config
- @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
+ @mkdir -p $(BUILD_DIR)/buildroot-config
+ @KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
allyesconfig: $(CONFIG)/conf
- cat $(CONFIG_DEFCONFIG) > .config
- @mkdir -p $(CONFIG)/buildroot-config
- @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- $(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
+ cat $(CONFIG_DEFCONFIG) > $(CONFIG_DIR)/.config
+ @mkdir -p $(BUILD_DIR)/buildroot-config
+ @KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
allnoconfig: $(CONFIG)/conf
- @mkdir -p $(CONFIG)/buildroot-config
- @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- $(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
+ @mkdir -p $(BUILD_DIR)/buildroot-config
+ @KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
randpackageconfig: $(CONFIG)/conf
- @mkdir -p $(CONFIG)/buildroot-config
- @grep -v BR2_PACKAGE_ .config > .config.nopkg
- @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- KCONFIG_ALLCONFIG=.config.nopkg \
- $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
- @rm -f .config.nopkg
+ @mkdir -p $(BUILD_DIR)/buildroot-config
+ @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
+ @KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
+ @rm -f $(CONFIG_DIR)/.config.nopkg
allyespackageconfig: $(CONFIG)/conf
- @mkdir -p $(CONFIG)/buildroot-config
- @grep -v BR2_PACKAGE_ .config > .config.nopkg
- @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- KCONFIG_ALLCONFIG=.config.nopkg \
- $(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
- @rm -f .config.nopkg
+ @mkdir -p $(BUILD_DIR)/buildroot-config
+ @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
+ @KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
+ @rm -f $(CONFIG_DIR)/.config.nopkg
allnopackageconfig: $(CONFIG)/conf
- @mkdir -p $(CONFIG)/buildroot-config
- @grep -v BR2_PACKAGE_ .config > .config.nopkg
- @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- KCONFIG_ALLCONFIG=.config.nopkg \
- $(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
- @rm -f .config.nopkg
+ @mkdir -p $(BUILD_DIR)/buildroot-config
+ @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg
+ @KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
+ @rm -f $(CONFIG_DIR)/.config.nopkg
defconfig: $(CONFIG)/conf
- @mkdir -p $(CONFIG)/buildroot-config
- @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
- KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
- $(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
+ @mkdir -p $(BUILD_DIR)/buildroot-config
+ @KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \
+ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
+ BUILDROOT_CONFIG=$(CONFIG_DIR)/.config $(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
# check if download URLs are outdated
source-check: allyesconfig
@@ -577,15 +579,15 @@ endif
ifeq ($(O),output)
rm -rf $(O)
endif
- rm -rf .config .config.old .config.cmd .auto.deps
- -$(MAKE) -C $(CONFIG) clean
+ rm -rf $(CONFIG_DIR)/.config $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/.config.cmd $(CONFIG_DIR)/.auto.deps
+ -$(MAKE) -C $(CONFIG) distclean
flush:
rm -f $(BUILD_DIR)/tgt-config.cache
%_defconfig: $(TOPDIR)/configs/%_defconfig
- cp $^ .config
- @$(MAKE) oldconfig
+ cp $^ $(CONFIG_DIR)/.config
+ @$(MAKE) O=$(O) oldconfig
configured: dirs host-sed kernel-headers uclibc-config busybox-config linux26-config
diff --git a/package/config/.gitignore b/package/config/.gitignore
index 161a19ada..1ea18a233 100644
--- a/package/config/.gitignore
+++ b/package/config/.gitignore
@@ -1,4 +1,3 @@
-/buildroot-config
/conf
/mconf
/qconf
diff --git a/package/config/Makefile b/package/config/Makefile
index a10085007..197c50026 100644
--- a/package/config/Makefile
+++ b/package/config/Makefile
@@ -43,7 +43,6 @@ distclean: clean
$(Q)rm -f $(lxdialog) $(conf-objs) $(mconf-objs) $(kxgettext-objs) \
$(hostprogs-y) $(qconf-cxxobjs) $(qconf-objs) $(gconf-objs) \
mconf .depend
- $(Q)rm -rf buildroot-config
FORCE:
.PHONY: FORCE clean distclean
diff --git a/package/config/confdata.c b/package/config/confdata.c
index 52199123a..fe1fc2e8e 100644
--- a/package/config/confdata.c
+++ b/package/config/confdata.c
@@ -423,8 +423,17 @@ int conf_write(const char *name)
basename = conf_get_configname();
} else
basename = name;
- } else
+ } else {
+ char *slash;
+
basename = conf_get_configname();
+ if((slash = strrchr(basename, '/'))) {
+ int size = slash - basename + 1;
+ memcpy(dirname, basename, size);
+ dirname[size] = 0;
+ basename = slash + 1;
+ }
+ }
sprintf(newname, "%s%s", dirname, basename);
env = getenv("KCONFIG_OVERWRITECONFIG");
@@ -688,19 +697,51 @@ int conf_write_autoconf(void)
FILE *out, *out_h;
time_t now;
int i, l;
+ char buf[PATH_MAX+1];
+ char buf2[PATH_MAX+1];
sym_clear_all_valid();
- file_write_dep(".config.cmd");
+ name = conf_get_configname();
+ str = strrchr(name, '/');
+
+ memset(buf, 0, PATH_MAX+1);
+ if(str)
+ {
+ strncpy(buf, name, str - name + 1);
+ }
+ strcat(buf, ".config.cmd");
+ file_write_dep(buf);
+
+ memset(buf, 0, PATH_MAX+1);
+ if(str)
+ {
+ strncpy(buf, name, str - name + 1);
+ }
+ strcat(buf, ".auto.deps");
+ write_make_deps(buf);
if (conf_split_config())
return 1;
- out = fopen(".tmpconfig", "w");
+ memset(buf, 0, PATH_MAX+1);
+ if(str)
+ {
+ strncpy(buf, name, str - name + 1);
+ }
+ strcat(buf, ".tmpconfig");
+ memset(buf2, 0, PATH_MAX+1);
+ if(str)
+ {
+ strncpy(buf2, name, str - name + 1);
+ }
+ strcat(buf2, ".tmpconfig.h");
+
+ out = fopen(buf, "w");
if (!out)
return 1;
- out_h = fopen(".tmpconfig.h", "w");
+ out_h = fopen(buf2, "w");
if (!out_h) {
fclose(out);
return 1;
@@ -782,14 +823,14 @@ int conf_write_autoconf(void)
name = getenv("KCONFIG_AUTOHEADER");
if (!name)
name = "include/linux/autoconf.h";
- if (rename(".tmpconfig.h", name))
+ if (rename(buf2, name))
return 1;
name = conf_get_autoconfig_name();
/*
* This must be the last step, kbuild has a dependency on auto.conf
* and this marks the successful completion of the previous steps.
*/
- if (rename(".tmpconfig", name))
+ if (rename(buf, name))
return 1;
return 0;
diff --git a/package/config/lkc.h b/package/config/lkc.h
index f379b0bf8..e5661c0e8 100644
--- a/package/config/lkc.h
+++ b/package/config/lkc.h
@@ -102,6 +102,7 @@ void menu_set_type(int type);
/* util.c */
struct file *file_lookup(const char *name);
int file_write_dep(const char *name);
+int write_make_deps(const char *name);
struct gstr {
size_t len;
diff --git a/package/config/util.c b/package/config/util.c
index 42038385b..a1e9dea21 100644
--- a/package/config/util.c
+++ b/package/config/util.c
@@ -51,17 +51,26 @@ static char* br2_symbol_printer(const char * const in)
}
/* write dependencies of the infividual config-symbols */
-static int write_make_deps(const char *name)
+int write_make_deps(const char *name)
{
+ const char *str;
+ char buf[PATH_MAX+1];
struct menu *menu;
struct symbol *sym;
struct property *prop, *p;
unsigned done;
- const char * const name_tmp = "..make.deps.tmp";
FILE *out;
if (!name)
name = ".auto.deps";
- out = fopen(name_tmp, "w");
+
+ str = strrchr(name, '/');
+ memset(buf, 0, PATH_MAX+1);
+ if(str)
+ {
+ strncpy(buf, name, str - name + 1);
+ }
+ strcat(buf, "..make.deps.tmp");
+ out = fopen(buf, "w");
if (!out)
return 1;
fprintf(out, "# ATTENTION! This does not handle 'depends', just 'select'! \n"
@@ -120,7 +129,7 @@ next:
}
}
fclose(out);
- rename(name_tmp, name);
+ rename(buf, name);
printf(_("#\n"
"# make dependencies written to %s\n"
"# ATTENTION buildroot devels!\n"
@@ -132,6 +141,8 @@ next:
/* write a dependency file as used by kbuild to track dependencies */
int file_write_dep(const char *name)
{
+ const char *str;
+ char buf[PATH_MAX+1];
struct symbol *sym, *env_sym;
struct expr *e;
struct file *file;
@@ -139,7 +150,16 @@ int file_write_dep(const char *name)
if (!name)
name = ".kconfig.d";
- out = fopen("..config.tmp", "w");
+
+ str = strrchr(name, '/');
+ memset(buf, 0, PATH_MAX+1);
+ if(str)
+ {
+ strncpy(buf, name, str - name + 1);
+ }
+ strcat(buf, "..config.tmp");
+
+ out = fopen(buf, "w");
if (!out)
return 1;
fprintf(out, "deps_config := \\\n");
@@ -170,8 +190,7 @@ int file_write_dep(const char *name)
fprintf(out, "\n$(deps_config): ;\n");
fclose(out);
- rename("..config.tmp", name);
- return write_make_deps(NULL);
+ rename(buf, name);
}