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
This commit is contained in:
Eric Andersen
2004-10-08 07:46:08 +00:00
parent 2842659cc0
commit 7daa076d3e
66 changed files with 460 additions and 242 deletions

View File

@@ -2,8 +2,10 @@
#
# Copyright (C) 2002 Erik Andersen <andersen@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 @@ endif
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 @@ conf: $(CONF_OBJS) $(SHARED_OBJS)
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 @@ lkc_defs.h: lkc_proto.h
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 $@
$(HOSTCC) $(HOSTCFLAGS) -I$(srcdir) -c $< -o $@
lex.zconf.c: lex.zconf.c_shipped
cp lex.zconf.c_shipped lex.zconf.c
lex.zconf.c: $(srcdir)/lex.zconf.c_shipped
cp $< $@
zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(SHARED_DEPS)
$(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
zconf.tab.c: $(srcdir)/zconf.tab.c_shipped
cp $< $@
zconf.tab.c: zconf.tab.c_shipped
cp zconf.tab.c_shipped zconf.tab.c
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: