[BusyBox] [patch] building out-of-tree

Bernhard Fischer rep.nop at aon.at
Tue Aug 23 21:25:27 UTC 2005


Hi,

building out of tree didn't work.

Attached patch corrects this. Verified that building in-tree works as
before and out-of-tree work as expected.

Please apply.

-------------- next part --------------
\\ make -f ~/src/busybox/Makefile top_builddir=. top_srcdir=~/src/busybox
diff --exclude='*.diff' -aruNp busybox.oorig/e2fsprogs/Makefile.in busybox/e2fsprogs/Makefile.in
--- busybox.oorig/e2fsprogs/Makefile.in	2005-07-28 18:51:59.000000000 +0200
+++ busybox/e2fsprogs/Makefile.in	2005-08-23 22:28:25.000000000 +0200
@@ -18,12 +18,12 @@
 #
 
 E2FSPROGS_AR:=e2fsprogs.a
-ifndef $(E2FSPROGS_DIR)
+
 E2FSPROGS_DIR:=$(top_builddir)/e2fsprogs/
-endif
+
 srcdir=$(top_srcdir)/e2fsprogs
 
-E2FSPROGS_CFLAGS := -I$(E2FSPROGS_DIR) -include $(E2FSPROGS_DIR)e2fsbb.h
+E2FSPROGS_CFLAGS := -I$(srcdir) -include $(srcdir)/e2fsbb.h
 
 BLKID_SRC   := cache.c dev.c devname.c devno.c getsize.c llseek.c probe.c \
                read.c resolve.c save.c tag.c resolve.c
@@ -63,5 +63,7 @@ libraries-y+=$(E2FSPROGS_DIR)$(E2FSPROGS
 $(E2FSPROGS_DIR)$(E2FSPROGS_AR): $(patsubst %,$(E2FSPROGS_DIR)%, $(E2FSPROGS-y))
 	$(AR) $(ARFLAGS) $@ $(patsubst %,$(E2FSPROGS_DIR)%, $(E2FSPROGS-y))
 
+# for e2p/*: check if the dir exists, dude
 $(E2FSPROGS_DIR)%.o: $(srcdir)/%.c
+	@[ -d $(@D) ] || mkdir -v $(@D)
 	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(E2FSPROGS_CFLAGS) -c -o $@ $<
diff --exclude='*.diff' -aruNp busybox.oorig/Makefile busybox/Makefile
--- busybox.oorig/Makefile	2005-08-17 22:56:12.000000000 +0200
+++ busybox/Makefile	2005-08-23 22:29:20.000000000 +0200
@@ -37,7 +37,7 @@ endif
 export srctree=$(top_srcdir)
 vpath %/Config.in $(srctree)
 
-include $(top_builddir)/Rules.mak
+include $(top_srcdir)/Rules.mak
 
 DIRS:=applets archival archival/libunarchive coreutils console-tools \
 	debianutils editors findutils init miscutils modutils networking \
@@ -219,7 +219,8 @@ include/bb_config.h: include/config.h
 	echo "#endif" >> $@
 
 include/bbconfigopts.h: .config
-	scripts/config/mkconfigs >include/bbconfigopts.h
+	@[ -d $(@D) ] || mkdir -v $(@D)
+	$(top_srcdir)/scripts/config/mkconfigs >include/bbconfigopts.h
 
 finished2:
 	$(SECHO)
@@ -236,13 +237,13 @@ all: menuconfig
 $(ALL_MAKEFILES): %/Makefile: $(top_srcdir)/%/Makefile
 	d=`dirname $@`; [ -d "$$d" ] || mkdir -p "$$d"; cp $< $@
 
-scripts/config/conf: scripts/config/Makefile Rules.mak
+scripts/config/conf: scripts/config/Makefile $(top_srcdir)/Rules.mak
 	$(MAKE) -C scripts/config conf
 	- at if [ ! -f .config ] ; then \
 		cp $(CONFIG_DEFCONFIG) .config; \
 	fi
 
-scripts/config/mconf: scripts/config/Makefile Rules.mak
+scripts/config/mconf: scripts/config/Makefile $(top_srcdir)/Rules.mak
 	$(MAKE) -C scripts/config ncurses conf mconf
 	- at if [ ! -f .config ] ; then \
 		cp $(CONFIG_DEFCONFIG) .config; \
diff --exclude='*.diff' -aruNp busybox.oorig/scripts/config/Makefile busybox/scripts/config/Makefile
--- busybox.oorig/scripts/config/Makefile	2005-04-24 21:31:01.000000000 +0200
+++ busybox/scripts/config/Makefile	2005-08-23 22:22:05.000000000 +0200
@@ -5,7 +5,7 @@
 top_srcdir=../..
 top_builddir=../..
 srcdir=$(top_srcdir)/scripts/config
-include $(top_builddir)/Rules.mak
+include $(top_srcdir)/Rules.mak
 
 all: ncurses conf mconf
 
@@ -41,6 +41,7 @@ MCONF_SRC    = mconf.c
 LXD_SRC      = lxdialog/checklist.c lxdialog/menubox.c lxdialog/textbox.c \
                lxdialog/yesno.c lxdialog/inputbox.c lxdialog/util.c \
                lxdialog/msgbox.c
+
 SHARED_SRC   = zconf.tab.c
 SHARED_DEPS := $(srcdir)/lkc.h $(srcdir)/lkc_proto.h \
                lkc_defs.h $(srcdir)/expr.h zconf.tab.h
@@ -58,6 +59,7 @@ $(CONF_OBJS): %.o : $(srcdir)/%.c $(SHAR
 	$(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
 
 $(MCONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
+	@[ -d $(@D) ] || mkdir -v $(@D)
 	$(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@
 
 lkc_defs.h: $(srcdir)/lkc_proto.h


More information about the busybox mailing list