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 ifneq ($(filter-out clean,${MAKECMDGOALS}),)
5 include ${TOPDIR}/rules.mk
9 HOSTCFLAGS
+=-DKBUILD_NO_NLS
11 all: ncurses conf mconf
14 ifeq (/usr
/include/ncurses
/ncurses.h
, $(wildcard /usr
/include/ncurses
/ncurses.h
))
15 HOSTNCURSES
+= -I
/usr
/include/ncurses
-DCURSES_LOC
="<ncurses.h>"
17 ifeq (/usr
/include/ncurses
/curses.h
, $(wildcard /usr
/include/ncurses
/curses.h
))
18 HOSTNCURSES
+= -I
/usr
/include/ncurses
-DCURSES_LOC
="<ncurses/curses.h>"
20 ifeq (/usr
/local
/include/ncurses
/ncurses.h
, $(wildcard /usr
/local
/include/ncurses
/ncurses.h
))
21 HOSTCFLAGS
+= -I
/usr
/local
/include/ncurses
-DCURSES_LOC
="<ncurses.h>"
23 ifeq (/usr
/local
/include/ncurses
/curses.h
, $(wildcard /usr
/local
/include/ncurses
/curses.h
))
24 HOSTCFLAGS
+= -I
/usr
/local
/include/ncurses
-DCURSES_LOC
="<ncurses/curses.h>"
26 ifeq (/usr
/pkg
/include/ncurses.h
, $(wildcard /usr
/pkg
/include/ncurses.h
))
27 HOSTCFLAGS
+= -I
/usr
/pkg
/include -DCURSES_LOC
="<ncurses.h>"
28 LIBS
+= -L
/usr
/pkg
/lib
-Wl
,-rpath
-Wl
,/usr
/pkg
/lib
30 ifeq (/usr
/include/ncurses.h
, $(wildcard /usr
/include/ncurses.h
))
31 HOSTNCURSES
+= -DCURSES_LOC
="<ncurses.h>"
33 HOSTNCURSES
+= -DCURSES_LOC
="<curses.h>"
43 MCONF_SRC
=mconf.c
$(wildcard lxdialog
/*.c
)
44 SHARED_SRC
=zconf.tab.c
45 SHARED_DEPS
:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h
46 CONF_OBJS
=$(patsubst %.c
,%.o
, $(CONF_SRC
))
47 MCONF_OBJS
=$(patsubst %.c
,%.o
, $(MCONF_SRC
))
48 SHARED_OBJS
=$(patsubst %.c
,%.o
, $(SHARED_SRC
))
50 conf
: $(CONF_OBJS
) $(SHARED_OBJS
)
51 $(HOSTCC
) $(HOSTCFLAGS
) $(NATIVE_LDFLAGS
) $^
-o
$@
53 mconf
: $(MCONF_OBJS
) $(SHARED_OBJS
)
54 $(HOSTCC
) $(HOSTCFLAGS
) $(NATIVE_LDFLAGS
) $^
-o
$@
$(LIBS
)
56 $(CONF_OBJS
): %.o
: %.c
$(SHARED_DEPS
)
57 $(HOSTCC
) $(HOSTCFLAGS
) -I.
-c
$< -o
$@
59 $(MCONF_OBJS
): %.o
: %.c
$(SHARED_DEPS
)
60 $(HOSTCC
) $(HOSTCFLAGS
) $(HOSTNCURSES
) -I.
-c
$< -o
$@
62 glob.o
: glob.c
$(SHARED_DEPS
)
63 $(HOSTCC
) $(HOSTCFLAGS
) -I.
-c glob.c
-o
$@
65 lkc_defs.h
: lkc_proto.h
66 @sed
< $< > $@
's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
69 # The following requires flex/bison
70 # By default we use the _shipped versions, uncomment the
71 # following line if you are modifying the flex/bison src.
77 bison
-t
-d
-v
-b
$* -p
$(notdir $*) $<
83 flex
-P
$(notdir $*) -o
$@
$<
85 lex.zconf.o
: lex.zconf.c
$(SHARED_DEPS
)
86 $(HOSTCC
) $(HOSTCFLAGS
) -I.
-c
$< -o
$@
88 zconf.tab.o
: zconf.tab.c zconf.hash.c
lex.zconf.c confdata.c expr.c symbol.c menu.c
$(SHARED_DEPS
)
89 $(HOSTCC
) $(HOSTCFLAGS
) -I.
-c
$< -o
$@
93 lex.zconf.o
: lex.zconf.c
$(SHARED_DEPS
)
94 $(HOSTCC
) $(HOSTCFLAGS
) -I.
-c
$< -o
$@
96 lex.zconf.c
: lex.zconf.c_shipped
97 $(CP
) lex.zconf.c_shipped
lex.zconf.c
99 zconf.hash.c
: zconf.hash.c_shipped
100 $(CP
) zconf.hash.c_shipped zconf.hash.c
102 zconf.tab.o
: zconf.tab.c zconf.hash.c
lex.zconf.c confdata.c expr.c symbol.c menu.c
$(SHARED_DEPS
)
103 $(HOSTCC
) $(HOSTCFLAGS
) -I.
-c
$< -o
$@
105 zconf.tab.c
: zconf.tab.c_shipped
106 $(CP
) zconf.tab.c_shipped zconf.tab.c
108 zconf.tab.h
: zconf.tab.h_shipped
109 $(CP
) zconf.tab.h_shipped zconf.tab.h
115 @echo
"int main(void) { return -1; }" > lxtemp.c
116 @if
$(HOSTCC
) $(HOSTCFLAGS
) lxtemp.c
$(LIBS
) ; then \
117 rm -f lxtemp.c a.out
; \
121 echo
">> Unable to find the Ncurses libraries." ;\
123 echo
">> You must have Ncurses installed in order" ;\
124 echo
">> to use 'make menuconfig'" ;\
130 @
rm -f
*.o
*~ core
$(TARGETS
) $(MCONF_OBJS
) $(CONF_OBJS
) zconf.hash.c \
131 conf mconf zconf.tab.c zconf.tab.h
lex.zconf.c lkc_defs.h