aboutsummaryrefslogtreecommitdiff
path: root/scripts/config
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-10-08 07:46:08 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-10-08 07:46:08 +0000
commitf6d0a8e7cb47688ed3786894219b373e87ac8a49 (patch)
treee81ce57a92acc0653374e1d262039562855d16ec /scripts/config
parent5ba0134aa31b2cd9a11772fcd9e39d722347467e (diff)
downloadbusybox-w32-f6d0a8e7cb47688ed3786894219b373e87ac8a49.tar.gz
busybox-w32-f6d0a8e7cb47688ed3786894219b373e87ac8a49.tar.bz2
busybox-w32-f6d0a8e7cb47688ed3786894219b373e87ac8a49.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 git-svn-id: svn://busybox.net/trunk/busybox@9320 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'scripts/config')
-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: