1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include ${ADK_TOPDIR}/prereq.mk
6 ifneq ($(filter-out clean,${MAKECMDGOALS}),)
7 include ${ADK_TOPDIR}/rules.mk
11 HOST_CFLAGS
+=-DKBUILD_NO_NLS
-w
13 all: ncurses conf mconf
16 ifeq (/usr
/lib
/libtinfo.so
, $(wildcard /usr
/lib
/libtinfo.so
))
20 ifeq (/usr
/include/ncursesw
/curses.h
, $(wildcard /usr
/include/ncursesw
/curses.h
))
21 HOST_CFLAGS
+= -I
/usr
/include/ncursesw
-DCURSES_LOC
="<curses.h>"
24 ifeq (/usr
/include/ncurses
/ncurses.h
, $(wildcard /usr
/include/ncurses
/ncurses.h
))
25 HOST_CFLAGS
+= -I
/usr
/include/ncurses
-DCURSES_LOC
="<ncurses.h>"
28 ifeq (/usr
/include/ncurses
/curses.h
, $(wildcard /usr
/include/ncurses
/curses.h
))
29 HOST_CFLAGS
+= -I
/usr
/include/ncurses
-DCURSES_LOC
="<ncurses/curses.h>"
32 ifeq (/usr
/include/ncurses.h
, $(wildcard /usr
/include/ncurses.h
))
33 HOST_CFLAGS
+= -DCURSES_LOC
="<ncurses.h>"
36 ifeq (/usr
/local
/include/ncurses
/ncurses.h
, $(wildcard /usr
/local
/include/ncurses
/ncurses.h
))
37 HOST_CFLAGS
+= -I
/usr
/local
/include/ncurses
-DCURSES_LOC
="<ncurses.h>"
40 ifeq (/usr
/local
/include/ncurses
/curses.h
, $(wildcard /usr
/local
/include/ncurses
/curses.h
))
41 HOST_CFLAGS
+= -I
/usr
/local
/include/ncurses
-DCURSES_LOC
="<ncurses/curses.h>"
44 ifeq (/usr
/local
/opt
/ncurses
/include/ncursesw
/ncurses.h
, $(wildcard /usr
/local
/opt
/ncurses
/include/ncursesw
/ncurses.h
))
45 HOST_CFLAGS
+= -I
/usr
/local
/opt
/ncurses
/include -DCURSES_LOC
="<ncursesw/ncurses.h>"
46 LIBS
+= -L
/usr
/local
/opt
/ncurses
/lib
-Wl
,-rpath
-Wl
,/usr
/local
/opt
/ncurses
/lib
-lncursesw
48 ifeq (/usr
/pkg
/include/ncurses.h
, $(wildcard /usr
/pkg
/include/ncurses.h
))
49 HOST_CFLAGS
+= -I
/usr
/pkg
/include -DCURSES_LOC
="<ncurses.h>"
50 LIBS
+= -L
/usr
/pkg
/lib
-Wl
,-rpath
-Wl
,/usr
/pkg
/lib
-lncurses
52 HOST_CFLAGS
+= -DCURSES_LOC
="<curses.h>"
64 MCONF_SRC
=mconf.c
$(wildcard lxdialog
/*.c
)
65 SHARED_SRC
=zconf.tab.c
66 SHARED_DEPS
:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h
67 CONF_OBJS
=$(patsubst %.c
,%.o
, $(CONF_SRC
))
68 MCONF_OBJS
=$(patsubst %.c
,%.o
, $(MCONF_SRC
))
69 SHARED_OBJS
=$(patsubst %.c
,%.o
, $(SHARED_SRC
))
71 conf
: $(CONF_OBJS
) $(SHARED_OBJS
)
72 @
$(HOST_CC
) $(HOST_CFLAGS
) $^
-o
$@
2>/dev
/null
74 mconf
: $(MCONF_OBJS
) $(SHARED_OBJS
)
75 @
$(HOST_CC
) $(HOST_CFLAGS
) $^
-o
$@
$(LIBS
) 2>/dev
/null
77 $(CONF_OBJS
): %.o
: %.c
$(SHARED_DEPS
)
78 @
$(HOST_CC
) $(HOST_CFLAGS
) -I.
-c
$< -o
$@
2>/dev
/null
80 $(MCONF_OBJS
): %.o
: %.c
$(SHARED_DEPS
)
81 @
$(HOST_CC
) $(HOST_CFLAGS
) -I.
-c
$< -o
$@
2>/dev
/null
83 glob.o
: glob.c
$(SHARED_DEPS
)
84 @
$(HOST_CC
) $(HOST_CFLAGS
) -I.
-c glob.c
-o
$@
2>/dev
/null
86 lkc_defs.h
: lkc_proto.h
87 @sed
< $< > $@
's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
90 # The following requires flex/bison
91 # By default we use the _shipped versions, uncomment the
92 # following line if you are modifying the flex/bison src.
98 bison
-t
-d
-v
-b
$* -p
$(notdir $*) $<
101 gperf
-t
--output-file zconf.hash.c
-a
-C
-E
-g
-k
'1,3,$$' -p
-t zconf.gperf
104 flex
-P
$(notdir $*) -o
$@
$<
106 lex.zconf.o
: lex.zconf.c
$(SHARED_DEPS
)
107 @
$(HOST_CC
) $(HOST_CFLAGS
) -I.
-c
$< -o
$@
109 zconf.tab.o
: zconf.tab.c zconf.hash.c
lex.zconf.c confdata.c expr.c symbol.c menu.c
$(SHARED_DEPS
)
110 @
$(HOST_CC
) $(HOST_CFLAGS
) -I.
-c
$< -o
$@
114 lex.zconf.o
: lex.zconf.c
$(SHARED_DEPS
)
115 @
$(HOST_CC
) $(HOST_CFLAGS
) -I.
-c
$< -o
$@
117 lex.zconf.c
: lex.zconf.c_shipped
118 @
$(CP
) lex.zconf.c_shipped
lex.zconf.c
120 zconf.hash.c
: zconf.hash.c_shipped
121 @
$(CP
) zconf.hash.c_shipped zconf.hash.c
123 zconf.tab.o
: zconf.tab.c zconf.hash.c
lex.zconf.c confdata.c expr.c symbol.c menu.c
$(SHARED_DEPS
)
124 @
$(HOST_CC
) $(HOST_CFLAGS
) -I.
-c
$< -o
$@
126 zconf.tab.c
: zconf.tab.c_shipped
127 @
$(CP
) zconf.tab.c_shipped zconf.tab.c
129 zconf.tab.h
: zconf.tab.h_shipped
130 @
$(CP
) zconf.tab.h_shipped zconf.tab.h
136 @echo
"int main(void) { return -1; }" > lxtemp.c
137 @if
$(HOST_CC
) $(HOST_CFLAGS
) lxtemp.c
$(LIBS
) ; then \
138 rm -f lxtemp.c a.out
; \
142 echo
">> Unable to find the Ncurses libraries." ;\
144 echo
">> You must have Ncurses installed in order" ;\
145 echo
">> to use 'make menuconfig'" ;\
151 @
rm -f
*.o
*~ core
$(TARGETS
) $(MCONF_OBJS
) $(CONF_OBJS
) zconf.hash.c \
152 conf mconf zconf.tab.c zconf.tab.h
lex.zconf.c lkc_defs.h