1 # Makefile for buildroot2
3 # Copyright (C) 2002-2004 Erik Andersen <andersen@codepoet.org>
6 # Select the compiler needed to build binaries for your development system
8 HOSTCFLAGS
= -Wall
-Wstrict-prototypes
-O2
-fomit-frame-pointer
9 # Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc.
13 all: ncurses conf mconf
16 ifeq (/usr
/include/ncurses
/ncurses.h
, $(wildcard /usr
/include/ncurses
/ncurses.h
))
17 HOSTNCURSES
+= -I
/usr
/include/ncurses
-DCURSES_LOC
="<ncurses.h>"
19 ifeq (/usr
/include/ncurses
/curses.h
, $(wildcard /usr
/include/ncurses
/curses.h
))
20 HOSTNCURSES
+= -I
/usr
/include/ncurses
-DCURSES_LOC
="<ncurses/curses.h>"
22 ifeq (/usr
/local
/include/ncurses
/ncurses.h
, $(wildcard /usr
/local
/include/ncurses
/ncurses.h
))
23 HOSTCFLAGS
+= -I
/usr
/local
/include/ncurses
-DCURSES_LOC
="<ncurses.h>"
25 ifeq (/usr
/local
/include/ncurses
/curses.h
, $(wildcard /usr
/local
/include/ncurses
/curses.h
))
26 HOSTCFLAGS
+= -I
/usr
/local
/include/ncurses
-DCURSES_LOC
="<ncurses/curses.h>"
28 ifeq (/usr
/include/ncurses.h
, $(wildcard /usr
/include/ncurses.h
))
29 HOSTNCURSES
+= -DCURSES_LOC
="<ncurses.h>"
31 HOSTNCURSES
+= -DCURSES_LOC
="<curses.h>"
39 MCONF_SRC
=mconf.c checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c
40 SHARED_SRC
=zconf.tab.c
41 SHARED_DEPS
:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h
42 CONF_OBJS
=$(patsubst %.c
,%.o
, $(CONF_SRC
))
43 MCONF_OBJS
=$(patsubst %.c
,%.o
, $(MCONF_SRC
))
44 SHARED_OBJS
=$(patsubst %.c
,%.o
, $(SHARED_SRC
))
46 conf
: $(CONF_OBJS
) $(SHARED_OBJS
)
47 $(HOSTCC
) $(NATIVE_LDFLAGS
) $^
-o
$@
49 mconf
: $(MCONF_OBJS
) $(SHARED_OBJS
)
50 $(HOSTCC
) $(NATIVE_LDFLAGS
) $^
-o
$@
$(LIBS
)
52 $(CONF_OBJS
): %.o
: %.c
$(SHARED_DEPS
)
53 $(HOSTCC
) $(HOSTCFLAGS
) -I.
-c
$< -o
$@
55 $(MCONF_OBJS
): %.o
: %.c
$(SHARED_DEPS
)
56 $(HOSTCC
) $(HOSTCFLAGS
) $(HOSTNCURSES
) -I.
-c
$< -o
$@
58 lkc_defs.h
: lkc_proto.h
59 @sed
< $< > $@
's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
62 # The following requires flex/bison
63 # By default we use the _shipped versions, uncomment the
64 # following line if you are modifying the flex/bison src.
70 bison
-t
-d
-v
-b
$* -p
$(notdir $*) $<
73 flex
-P
$(notdir $*) -o
$@
$<
76 lex.zconf.o
: lex.zconf.c
$(SHARED_DEPS
)
77 $(HOSTCC
) $(HOSTCFLAGS
) -I.
-c
$< -o
$@
79 lex.zconf.c
: lex.zconf.c_shipped
80 $(CP
) lex.zconf.c_shipped
lex.zconf.c
82 zconf.tab.o
: zconf.tab.c
lex.zconf.c confdata.c expr.c symbol.c menu.c
$(SHARED_DEPS
)
83 $(HOSTCC
) $(HOSTCFLAGS
) -I.
-c
$< -o
$@
85 zconf.tab.c
: zconf.tab.c_shipped
86 $(CP
) zconf.tab.c_shipped zconf.tab.c
88 zconf.tab.h
: zconf.tab.h_shipped
89 $(CP
) zconf.tab.h_shipped zconf.tab.h
95 @echo
"main() {}" > lxtemp.c
96 @if
$(HOSTCC
) lxtemp.c
$(LIBS
) ; then \
97 rm -f lxtemp.c a.out
; \
101 echo
">> Unable to find the Ncurses libraries." ;\
103 echo
">> You must have Ncurses installed in order" ;\
104 echo
">> to use 'make menuconfig'" ;\
110 rm -f
*.o
*~ core
$(TARGETS
) $(MCONF_OBJS
) $(CONF_OBJS
) \
111 conf mconf zconf.tab.c zconf.tab.h
lex.zconf.c lkc_defs.h