aboutsummaryrefslogtreecommitdiff
path: root/scripts
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
parent2842659cc02233274ca165ffb83a31b161d815cd (diff)
downloadbusybox-w32-7daa076d3e24e84ce1f4e9b6133783816575c4c8.tar.gz
busybox-w32-7daa076d3e24e84ce1f4e9b6133783816575c4c8.tar.bz2
busybox-w32-7daa076d3e24e84ce1f4e9b6133783816575c4c8.zip
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')
-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 @@
2# 2#
3# Copyright (C) 2002 Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
4 4
5TOPDIR=../../ 5top_srcdir=../..
6include $(TOPDIR)Rules.mak 6top_builddir=../..
7srcdir=$(top_srcdir)/scripts/config
8include $(top_builddir)/Rules.mak
7 9
8all: ncurses conf mconf 10all: ncurses conf mconf
9 11
@@ -33,7 +35,8 @@ endif
33CONF_SRC =conf.c 35CONF_SRC =conf.c
34MCONF_SRC =mconf.c checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c 36MCONF_SRC =mconf.c checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c
35SHARED_SRC=zconf.tab.c 37SHARED_SRC=zconf.tab.c
36SHARED_DEPS:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h 38SHARED_DEPS:=$(srcdir)/lkc.h $(srcdir)/lkc_proto.h \
39 lkc_defs.h $(srcdir)/expr.h zconf.tab.h
37CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC)) 40CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC))
38MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC)) 41MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC))
39SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC)) 42SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC))
@@ -44,13 +47,13 @@ conf: $(CONF_OBJS) $(SHARED_OBJS)
44mconf: $(MCONF_OBJS) $(SHARED_OBJS) 47mconf: $(MCONF_OBJS) $(SHARED_OBJS)
45 $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS) 48 $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS)
46 49
47$(CONF_OBJS): %.o : %.c $(SHARED_DEPS) 50$(CONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
48 $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ 51 $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
49 52
50$(MCONF_OBJS): %.o : %.c $(SHARED_DEPS) 53$(MCONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
51 $(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@ 54 $(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@
52 55
53lkc_defs.h: lkc_proto.h 56lkc_defs.h: $(srcdir)/lkc_proto.h
54 @sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' 57 @sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
55 58
56### 59###
@@ -61,29 +64,30 @@ lkc_defs.h: lkc_proto.h
61 64
62ifdef LKC_GENPARSER 65ifdef LKC_GENPARSER
63 66
64%.tab.c %.tab.h: %.y 67%.tab.c %.tab.h: $(srcdir)/%.y
65 bison -t -d -v -b $* -p $(notdir $*) $< 68 bison -t -d -v -b $* -p $(notdir $*) $<
66 69
67lex.%.c: %.l 70lex.%.c: $(srcdir)/%.l
68 flex -P$(notdir $*) -o$@ $< 71 flex -P$(notdir $*) -o$@ $<
69else 72else
70 73
71lex.zconf.o: lex.zconf.c $(SHARED_DEPS) 74lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
72 $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ 75 $(HOSTCC) $(HOSTCFLAGS) -I$(srcdir) -c $< -o $@
73
74lex.zconf.c: lex.zconf.c_shipped
75 cp lex.zconf.c_shipped lex.zconf.c
76 76
77zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(SHARED_DEPS) 77lex.zconf.c: $(srcdir)/lex.zconf.c_shipped
78 $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ 78 cp $< $@
79 79
80zconf.tab.c: zconf.tab.c_shipped 80zconf.tab.c: $(srcdir)/zconf.tab.c_shipped
81 cp zconf.tab.c_shipped zconf.tab.c 81 cp $< $@
82 82
83zconf.tab.h: zconf.tab.h_shipped 83zconf.tab.h: $(srcdir)/zconf.tab.h_shipped
84 cp zconf.tab.h_shipped zconf.tab.h 84 cp $< $@
85endif 85endif
86 86
87zconf.tab.o: zconf.tab.c lex.zconf.c $(srcdir)/confdata.c $(srcdir)/expr.c \
88 $(srcdir)/symbol.c $(srcdir)/menu.c $(SHARED_DEPS)
89 $(HOSTCC) $(HOSTCFLAGS) -I$(srcdir) -I. -c $< -o $@
90
87.PHONY: ncurses 91.PHONY: ncurses
88 92
89ncurses: 93ncurses: