1 |
1325 |
phoenix |
# Makefile for uClibc
|
2 |
|
|
#
|
3 |
|
|
# Copyright (C) 2002 Erik Andersen
|
4 |
|
|
#
|
5 |
|
|
# This program is free software; you can redistribute it and/or modify it under
|
6 |
|
|
# the terms of the GNU Library General Public License as published by the Free
|
7 |
|
|
# Software Foundation; either version 2 of the License, or (at your option) any
|
8 |
|
|
# later version.
|
9 |
|
|
#
|
10 |
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
11 |
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
12 |
|
|
# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
|
13 |
|
|
# details.
|
14 |
|
|
#
|
15 |
|
|
# You should have received a copy of the GNU Library General Public License
|
16 |
|
|
# along with this program; if not, write to the Free Software Foundation, Inc.,
|
17 |
|
|
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
18 |
|
|
|
19 |
|
|
TOPDIR=../../
|
20 |
|
|
include $(TOPDIR)Rules.mak
|
21 |
|
|
|
22 |
|
|
all: ncurses conf mconf
|
23 |
|
|
|
24 |
|
|
LIBS = -lncurses
|
25 |
|
|
ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h))
|
26 |
|
|
HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC=""
|
27 |
|
|
else
|
28 |
|
|
ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h))
|
29 |
|
|
HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC=""
|
30 |
|
|
else
|
31 |
|
|
ifeq (/usr/local/include/ncurses/ncurses.h, $(wildcard /usr/local/include/ncurses/ncurses.h))
|
32 |
|
|
HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC=""
|
33 |
|
|
else
|
34 |
|
|
ifeq (/usr/local/include/ncurses/curses.h, $(wildcard /usr/local/include/ncurses/curses.h))
|
35 |
|
|
HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC=""
|
36 |
|
|
else
|
37 |
|
|
ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h))
|
38 |
|
|
HOSTNCURSES += -DCURSES_LOC=""
|
39 |
|
|
else
|
40 |
|
|
HOSTNCURSES += -DCURSES_LOC=""
|
41 |
|
|
endif
|
42 |
|
|
endif
|
43 |
|
|
endif
|
44 |
|
|
endif
|
45 |
|
|
endif
|
46 |
|
|
|
47 |
|
|
CONF_SRC =conf.c
|
48 |
|
|
MCONF_SRC =mconf.c checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c
|
49 |
|
|
SHARED_SRC=zconf.tab.c
|
50 |
|
|
SHARED_DEPS:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h
|
51 |
|
|
CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC))
|
52 |
|
|
MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC))
|
53 |
|
|
SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC))
|
54 |
|
|
|
55 |
|
|
conf: $(CONF_OBJS) $(SHARED_OBJS)
|
56 |
|
|
$(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@
|
57 |
|
|
|
58 |
|
|
mconf: $(MCONF_OBJS) $(SHARED_OBJS)
|
59 |
|
|
$(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS)
|
60 |
|
|
|
61 |
|
|
$(CONF_OBJS): %.o : %.c $(SHARED_DEPS)
|
62 |
|
|
$(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
|
63 |
|
|
|
64 |
|
|
$(MCONF_OBJS): %.o : %.c $(SHARED_DEPS)
|
65 |
|
|
$(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@
|
66 |
|
|
|
67 |
|
|
lkc_defs.h: 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 |
|
|
|
76 |
|
|
ifdef LKC_GENPARSER
|
77 |
|
|
|
78 |
|
|
%.tab.c %.tab.h: %.y
|
79 |
|
|
bison -t -d -v -b $* -p $(notdir $*) $<
|
80 |
|
|
|
81 |
|
|
lex.%.c: %.l
|
82 |
|
|
flex -P$(notdir $*) -o$@ $<
|
83 |
|
|
else
|
84 |
|
|
|
85 |
|
|
lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
|
86 |
|
|
$(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
|
87 |
|
|
|
88 |
|
|
lex.zconf.c: lex.zconf.c_shipped
|
89 |
|
|
cp lex.zconf.c_shipped lex.zconf.c
|
90 |
|
|
|
91 |
|
|
zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(SHARED_DEPS)
|
92 |
|
|
$(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
|
93 |
|
|
|
94 |
|
|
zconf.tab.c: zconf.tab.c_shipped
|
95 |
|
|
cp zconf.tab.c_shipped zconf.tab.c
|
96 |
|
|
|
97 |
|
|
zconf.tab.h: zconf.tab.h_shipped
|
98 |
|
|
cp zconf.tab.h_shipped zconf.tab.h
|
99 |
|
|
endif
|
100 |
|
|
|
101 |
|
|
.PHONY: ncurses
|
102 |
|
|
|
103 |
|
|
ncurses:
|
104 |
|
|
@echo "main() {}" > lxtemp.c
|
105 |
|
|
@if $(HOSTCC) lxtemp.c $(LIBS) ; then \
|
106 |
|
|
$(RM) lxtemp.c a.out; \
|
107 |
|
|
else \
|
108 |
|
|
$(RM) lxtemp.c; \
|
109 |
|
|
echo -e "\007" ;\
|
110 |
|
|
echo ">> Unable to find the Ncurses libraries." ;\
|
111 |
|
|
echo ">>" ;\
|
112 |
|
|
echo ">> You must have Ncurses installed in order" ;\
|
113 |
|
|
echo ">> to use 'make menuconfig'" ;\
|
114 |
|
|
echo ">>" ;\
|
115 |
|
|
echo ">> Maybe you want to try 'make config', which" ;\
|
116 |
|
|
echo ">> doesn't depend on the Ncurses libraries." ;\
|
117 |
|
|
echo ;\
|
118 |
|
|
exit 1 ;\
|
119 |
|
|
fi
|
120 |
|
|
|
121 |
|
|
clean:
|
122 |
|
|
$(RM) *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \
|
123 |
|
|
conf mconf zconf.tab.c zconf.tab.h lex.zconf.c lkc_defs.h
|
124 |
|
|
|