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 CFLAGS_FOR_BUILD
+=-DKBUILD_NO_NLS
11 all: ncurses conf mconf
14 ifeq (/usr
/include/ncurses
/ncurses.h
, $(wildcard /usr
/include/ncurses
/ncurses.h
))
15 CFLAGS_FOR_BUILD
+= -I
/usr
/include/ncurses
-DCURSES_LOC
="<ncurses.h>"
17 ifeq (/usr
/include/ncurses
/curses.h
, $(wildcard /usr
/include/ncurses
/curses.h
))
18 CFLAGS_FOR_BUILD
+= -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 CFLAGS_FOR_BUILD
+= -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 CFLAGS_FOR_BUILD
+= -I
/usr
/local
/include/ncurses
-DCURSES_LOC
="<ncurses/curses.h>"
26 ifeq (/usr
/pkg
/include/ncurses.h
, $(wildcard /usr
/pkg
/include/ncurses.h
))
27 CFLAGS_FOR_BUILD
+= -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 CFLAGS_FOR_BUILD
+= -DCURSES_LOC
="<ncurses.h>"
33 CFLAGS_FOR_BUILD
+= -DCURSES_LOC
="<curses.h>"
42 GTKLIBS
= `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
43 GTKCFLAGS
= `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0`
46 MCONF_SRC
=mconf.c
$(wildcard lxdialog
/*.c
)
48 SHARED_SRC
=zconf.tab.c
49 SHARED_DEPS
:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h
50 CONF_OBJS
=$(patsubst %.c
,%.o
, $(CONF_SRC
))
51 MCONF_OBJS
=$(patsubst %.c
,%.o
, $(MCONF_SRC
))
52 GCONF_OBJS
=$(patsubst %.c
,%.o
, $(GCONF_SRC
))
53 SHARED_OBJS
=$(patsubst %.c
,%.o
, $(SHARED_SRC
))
55 conf
: $(CONF_OBJS
) $(SHARED_OBJS
)
56 @
$(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) $(NATIVE_LDFLAGS
) $^
-o
$@
58 mconf
: $(MCONF_OBJS
) $(SHARED_OBJS
)
59 @
$(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) $(NATIVE_LDFLAGS
) $^
-o
$@
$(LIBS
)
61 gconf
: $(GCONF_OBJS
) $(SHARED_OBJS
)
62 @
$(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) $(NATIVE_LDFLAGS
) $^
-o
$@
$(GTKLIBS
)
64 $(CONF_OBJS
): %.o
: %.c
$(SHARED_DEPS
)
65 @
$(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) -I.
-c
$< -o
$@
67 $(MCONF_OBJS
): %.o
: %.c
$(SHARED_DEPS
)
68 @
$(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) $(HOSTNCURSES
) -I.
-c
$< -o
$@
70 $(GCONF_OBJS
): %.o
: %.c
$(SHARED_DEPS
)
71 @
$(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) $(GTKCFLAGS
) -DLKC_DIRECT_LINK
-I.
-c
$< -o
$@
73 glob.o
: glob.c
$(SHARED_DEPS
)
74 @
$(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) -I.
-c glob.c
-o
$@
76 lkc_defs.h
: lkc_proto.h
77 @sed
< $< > $@
's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
80 # The following requires flex/bison
81 # By default we use the _shipped versions, uncomment the
82 # following line if you are modifying the flex/bison src.
88 bison
-t
-d
-v
-b
$* -p
$(notdir $*) $<
94 flex
-P
$(notdir $*) -o
$@
$<
96 lex.zconf.o
: lex.zconf.c
$(SHARED_DEPS
)
97 $(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) -I.
-c
$< -o
$@
99 zconf.tab.o
: zconf.tab.c zconf.hash.c
lex.zconf.c confdata.c expr.c symbol.c menu.c
$(SHARED_DEPS
)
100 $(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) -I.
-c
$< -o
$@
104 lex.zconf.o
: lex.zconf.c
$(SHARED_DEPS
)
105 $(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) -I.
-c
$< -o
$@
107 lex.zconf.c
: lex.zconf.c_shipped
108 @
$(CP
) lex.zconf.c_shipped
lex.zconf.c
110 zconf.hash.c
: zconf.hash.c_shipped
111 @
$(CP
) zconf.hash.c_shipped zconf.hash.c
113 zconf.tab.o
: zconf.tab.c zconf.hash.c
lex.zconf.c confdata.c expr.c symbol.c menu.c
$(SHARED_DEPS
)
114 @
$(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) -I.
-c
$< -o
$@
116 zconf.tab.c
: zconf.tab.c_shipped
117 @
$(CP
) zconf.tab.c_shipped zconf.tab.c
119 zconf.tab.h
: zconf.tab.h_shipped
120 @
$(CP
) zconf.tab.h_shipped zconf.tab.h
126 @echo
"int main(void) { return -1; }" > lxtemp.c
127 @if
$(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) lxtemp.c
$(LIBS
) ; then \
128 rm -f lxtemp.c a.out
; \
132 echo
">> Unable to find the Ncurses libraries." ;\
134 echo
">> You must have Ncurses installed in order" ;\
135 echo
">> to use 'make menuconfig'" ;\
141 @
rm -f
*.o
*~ core
$(TARGETS
) $(MCONF_OBJS
) $(CONF_OBJS
) zconf.hash.c \
142 conf mconf zconf.tab.c zconf.tab.h
lex.zconf.c lkc_defs.h