Added httping
[openwrt.git] / package / config / Makefile
1 # Makefile for buildroot2
2 #
3 # Copyright (C) 2002-2004 Erik Andersen <andersen@codepoet.org>
4
5 CP=cp -fpR
6
7 # Select the compiler needed to build binaries for your development system
8 HOSTCC = gcc
9 HOSTCFLAGS= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
10 # Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc.
11 LC_ALL:= C
12 CP:=cp -a
13
14
15 all: ncurses conf mconf
16
17 LIBS = -lncurses
18 ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h))
19 HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"
20 else
21 ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h))
22 HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"
23 else
24 ifeq (/usr/local/include/ncurses/ncurses.h, $(wildcard /usr/local/include/ncurses/ncurses.h))
25 HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses.h>"
26 else
27 ifeq (/usr/local/include/ncurses/curses.h, $(wildcard /usr/local/include/ncurses/curses.h))
28 HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"
29 else
30 ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h))
31 HOSTNCURSES += -DCURSES_LOC="<ncurses.h>"
32 else
33 HOSTNCURSES += -DCURSES_LOC="<curses.h>"
34 endif
35 endif
36 endif
37 endif
38 endif
39
40 CONF_SRC =conf.c
41 MCONF_SRC =mconf.c checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c
42 SHARED_SRC=zconf.tab.c
43 SHARED_DEPS:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h
44 CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC))
45 MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC))
46 SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC))
47
48 conf: $(CONF_OBJS) $(SHARED_OBJS)
49 $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@
50
51 mconf: $(MCONF_OBJS) $(SHARED_OBJS)
52 $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS)
53
54 $(CONF_OBJS): %.o : %.c $(SHARED_DEPS)
55 $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
56
57 $(MCONF_OBJS): %.o : %.c $(SHARED_DEPS)
58 $(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@
59
60 lkc_defs.h: lkc_proto.h
61 @sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
62
63 ###
64 # The following requires flex/bison
65 # By default we use the _shipped versions, uncomment the
66 # following line if you are modifying the flex/bison src.
67 #LKC_GENPARSER := 1
68
69 ifdef LKC_GENPARSER
70
71 %.tab.c %.tab.h: %.y
72 bison -t -d -v -b $* -p $(notdir $*) $<
73
74 lex.%.c: %.l
75 flex -P$(notdir $*) -o$@ $<
76 else
77
78 lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
79 $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
80
81 lex.zconf.c: lex.zconf.c_shipped
82 $(CP) lex.zconf.c_shipped lex.zconf.c
83
84 zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(SHARED_DEPS)
85 $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
86
87 zconf.tab.c: zconf.tab.c_shipped
88 $(CP) zconf.tab.c_shipped zconf.tab.c
89
90 zconf.tab.h: zconf.tab.h_shipped
91 $(CP) zconf.tab.h_shipped zconf.tab.h
92 endif
93
94 .PHONY: ncurses
95
96 ncurses:
97 @echo "main() {}" > lxtemp.c
98 @if $(HOSTCC) lxtemp.c $(LIBS) ; then \
99 rm -f lxtemp.c a.out; \
100 else \
101 rm -f lxtemp.c; \
102 echo -e "\007" ;\
103 echo ">> Unable to find the Ncurses libraries." ;\
104 echo ">>" ;\
105 echo ">> You must have Ncurses installed in order" ;\
106 echo ">> to use 'make menuconfig'" ;\
107 echo ;\
108 exit 1 ;\
109 fi
110
111 clean:
112 rm -f *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \
113 conf mconf zconf.tab.c zconf.tab.h lex.zconf.c lkc_defs.h
114
This page took 0.040268 seconds and 5 git commands to generate.