aboutsummaryrefslogtreecommitdiff
path: root/scripts/config/Makefile
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-10-08 07:46:08 +0000
committerEric Andersen <andersen@codepoet.org>2004-10-08 07:46:08 +0000
commit7daa076d3e24e84ce1f4e9b6133783816575c4c8 (patch)
treee81ce57a92acc0653374e1d262039562855d16ec /scripts/config/Makefile
parent2842659cc02233274ca165ffb83a31b161d815cd (diff)
downloadbusybox-7daa076d3e24e84ce1f4e9b6133783816575c4c8.tar.gz
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
Diffstat (limited to 'scripts/config/Makefile')
-rw-r--r--scripts/config/Makefile40
1 files changed, 22 insertions, 18 deletions
diff --git a/scripts/config/Makefile b/scripts/config/Makefile
index e15ec399c..c0b5b9d35 100644
--- a/scripts/config/Makefile
+++ b/scripts/config/Makefile
@@ -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 $@
-
-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: