source: MondoRescue/branches/stable/mindi-busybox/scripts/config/Makefile@ 821

Last change on this file since 821 was 821, checked in by Bruno Cornec, 18 years ago

Addition of busybox 1.2.1 as a mindi-busybox new package
This should avoid delivering binary files in mindi not built there (Fedora and Debian are quite serious about that)

File size: 3.3 KB
Line 
1# Makefile for BusyBox
2#
3# Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
4
5top_srcdir=../..
6top_builddir=../..
7srcdir=$(top_srcdir)/scripts/config
8include $(top_srcdir)/Rules.mak
9
10all: ncurses conf mconf
11
12ifeq ($(shell uname),SunOS)
13LIBS = -lcurses
14else
15LIBS = -lncurses
16endif
17ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h))
18 HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"
19else
20ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h))
21 HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"
22else
23ifeq (/usr/local/include/ncurses/ncurses.h, $(wildcard /usr/local/include/ncurses/ncurses.h))
24 HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses.h>"
25else
26ifeq (/usr/local/include/ncurses/curses.h, $(wildcard /usr/local/include/ncurses/curses.h))
27 HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"
28else
29ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h))
30 HOSTNCURSES += -DCURSES_LOC="<ncurses.h>"
31else
32 HOSTNCURSES += -DCURSES_LOC="<curses.h>"
33endif
34endif
35endif
36endif
37endif
38
39CONF_SRC = conf.c
40MCONF_SRC = mconf.c
41LXD_SRC = lxdialog/checklist.c lxdialog/menubox.c lxdialog/textbox.c \
42 lxdialog/yesno.c lxdialog/inputbox.c lxdialog/util.c \
43 lxdialog/msgbox.c
44
45SHARED_SRC = zconf.tab.c
46SHARED_DEPS := $(srcdir)/lkc.h $(srcdir)/lkc_proto.h \
47 lkc_defs.h $(srcdir)/expr.h zconf.tab.h
48CONF_OBJS = $(patsubst %.c,%.o, $(CONF_SRC))
49MCONF_OBJS = $(patsubst %.c,%.o, $(MCONF_SRC) $(LXD_SRC))
50SHARED_OBJS = $(patsubst %.c,%.o, $(SHARED_SRC))
51
52conf: $(CONF_OBJS) $(SHARED_OBJS)
53 $(SECHO) " "HOSTCC $@ ; true
54 $(Q)$(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@
55
56mconf: $(MCONF_OBJS) $(SHARED_OBJS)
57 $(SECHO) " "HOSTCC $@ ; true
58 $(Q)$(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS)
59
60$(CONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
61 $(compile.h) -I.
62
63$(MCONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
64 @[ -d $(@D) ] || mkdir $(@D)
65 $(compile.h) $(HOSTNCURSES) -I.
66
67lkc_defs.h: $(srcdir)/lkc_proto.h
68 @$(SED) < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
69
70###
71# The following requires flex/bison
72# By default we use the _shipped versions, uncomment the
73# following line if you are modifying the flex/bison src.
74#LKC_GENPARSER := 1
75
76ifdef LKC_GENPARSER
77
78%.tab.c %.tab.h: $(srcdir)/%.y
79 bison -t -d -v -b $* -p $(notdir $*) $<
80
81lex.%.c: $(srcdir)/%.l
82 flex -P$(notdir $*) -o$@ $<
83else
84
85lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
86 $(compile.h) -I$(srcdir)
87
88lex.zconf.c: $(srcdir)/lex.zconf.c_shipped
89 $(Q)cp $< $@
90
91zconf.tab.c: $(srcdir)/zconf.tab.c_shipped
92 $(Q)cp $< $@
93
94zconf.tab.h: $(srcdir)/zconf.tab.h_shipped
95 $(Q)cp $< $@
96endif
97
98zconf.tab.o: zconf.tab.c lex.zconf.c $(srcdir)/confdata.c $(srcdir)/expr.c \
99 $(srcdir)/symbol.c $(srcdir)/menu.c $(SHARED_DEPS)
100 $(compile.h) -I$(srcdir) -I.
101
102.PHONY: ncurses
103
104ncurses:
105 @echo "main() {}" > lxtemp.c
106 @if $(HOSTCC) lxtemp.c $(LIBS) ; then \
107 rm -f lxtemp.c a.out; \
108 else \
109 rm -f lxtemp.c; \
110 echo -e "\007" ;\
111 echo ">> Unable to find the Ncurses libraries." ;\
112 echo ">>" ;\
113 echo ">> You must have Ncurses installed in order" ;\
114 echo ">> to use 'make menuconfig'" ;\
115 echo ;\
116 exit 1 ;\
117 fi
118
119clean:
120 rm -f *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \
121 conf mconf zconf.tab.c zconf.tab.h lex.zconf.c lkc_defs.h
122
Note: See TracBrowser for help on using the repository browser.