[BusyBox-cvs] CVS busybox/scripts/config

CVS User andersen andersen at codepoet.org
Fri Oct 8 07:45:50 UTC 2004


Update of /var/cvs/busybox/scripts/config
In directory nail:/tmp/cvs-serv8052/scripts/config

Modified Files:
	Makefile 
Log Message:
egor duda writes:

Hi!

I've created a patch to busybox' build system to allow building it in
separate tree in a manner similar to kbuild from kernel version 2.6.

That is, one runs command like
'make O=/build/some/where/for/specific/target/and/options'
and everything is built in this exact directory, provided that it exists.

I understand that applyingc such invasive changes during 'release
candidates' stage of development is at best unwise. So, i'm currently
asking for comments about this patch, starting from whether such thing
is needed at all to whether it coded properly.

'make check' should work now, and one make creates Makefile in build
directory, so one can run 'make' in build directory after that.

One possible caveat is that if we build in some directory other than
source one, the source directory should be 'distclean'ed first.

egor




--- /var/cvs/busybox/scripts/config/Makefile	2004/03/15 08:29:08	1.4
+++ /var/cvs/busybox/scripts/config/Makefile	2004/10/08 07:45:49	1.5
@@ -2,8 +2,10 @@
 #
 # Copyright (C) 2002 Erik Andersen <andersen at codepoet.org>
 
-TOPDIR=../../
-include $(TOPDIR)Rules.mak
+top_srcdir=../..
+top_builddir=../..
+srcdir=$(top_srcdir)/scripts/config
+include $(top_builddir)/Rules.mak
 
 all: ncurses conf mconf
 
@@ -33,7 +35,8 @@
 CONF_SRC  =conf.c
 MCONF_SRC =mconf.c checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c
 SHARED_SRC=zconf.tab.c
-SHARED_DEPS:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h
+SHARED_DEPS:=$(srcdir)/lkc.h $(srcdir)/lkc_proto.h \
+  lkc_defs.h $(srcdir)/expr.h zconf.tab.h
 CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC))
 MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC))
 SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC))
@@ -44,13 +47,13 @@
 mconf: $(MCONF_OBJS) $(SHARED_OBJS)
 	$(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS)
 
-$(CONF_OBJS): %.o : %.c $(SHARED_DEPS)
+$(CONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
 	$(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
 
-$(MCONF_OBJS): %.o : %.c $(SHARED_DEPS)
+$(MCONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
 	$(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@
 
-lkc_defs.h: lkc_proto.h
+lkc_defs.h: $(srcdir)/lkc_proto.h
 	@sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
 
 ###
@@ -61,29 +64,30 @@
 
 ifdef LKC_GENPARSER
 
-%.tab.c %.tab.h: %.y
+%.tab.c %.tab.h: $(srcdir)/%.y
 	bison -t -d -v -b $* -p $(notdir $*) $<
 
-lex.%.c: %.l
+lex.%.c: $(srcdir)/%.l
 	flex -P$(notdir $*) -o$@ $<
 else
 
 lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
-	$(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
-
-lex.zconf.c: lex.zconf.c_shipped
-	cp lex.zconf.c_shipped lex.zconf.c
+	$(HOSTCC) $(HOSTCFLAGS) -I$(srcdir) -c $< -o $@
 
-zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(SHARED_DEPS)
-	$(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
+lex.zconf.c: $(srcdir)/lex.zconf.c_shipped
+	cp $< $@
 
-zconf.tab.c: zconf.tab.c_shipped
-	cp zconf.tab.c_shipped zconf.tab.c
+zconf.tab.c: $(srcdir)/zconf.tab.c_shipped
+	cp $< $@
 
-zconf.tab.h: zconf.tab.h_shipped
-	cp zconf.tab.h_shipped zconf.tab.h
+zconf.tab.h: $(srcdir)/zconf.tab.h_shipped
+	cp $< $@
 endif
 
+zconf.tab.o: zconf.tab.c lex.zconf.c $(srcdir)/confdata.c $(srcdir)/expr.c \
+             $(srcdir)/symbol.c $(srcdir)/menu.c $(SHARED_DEPS)
+	$(HOSTCC) $(HOSTCFLAGS) -I$(srcdir) -I. -c $< -o $@
+
 .PHONY: ncurses
 
 ncurses:



More information about the busybox-cvs mailing list