From 64eb982edd933033879bbc8983e42149ff8f849b Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 4 Dec 2002 20:52:25 +0000 Subject: This is based on a patch posted to lkml by Petr Baudis on 23 Nov, which was then considerably hacked up by me. This eliminates the separate lxdialog and instead directly uses the lxdialog internals. This allows 'make menuconfig' to be much faster. -Erik --- extra/config/Makefile | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) (limited to 'extra/config/Makefile') diff --git a/extra/config/Makefile b/extra/config/Makefile index 383dee551..e2fc8c5a7 100644 --- a/extra/config/Makefile +++ b/extra/config/Makefile @@ -20,21 +20,37 @@ TOPDIR=../../ include $(TOPDIR)Rules.mak -all: conf mconf +all: ncurses conf mconf -NATIVE_CFLAGS=-Wall -g -O0 +#NATIVE_CFLAGS=-Wall -g -O0 +LIBS = -lncurses +ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h)) + NATIVE_CFLAGS += -I/usr/include/ncurses -DCURSES_LOC="" +else +ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h)) + NATIVE_CFLAGS += -I/usr/include/ncurses -DCURSES_LOC="" +else +ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h)) + NATIVE_CFLAGS += -DCURSES_LOC="" +else + NATIVE_CFLAGS += -DCURSES_LOC="" +endif +endif +endif CONF_SRC =conf.c zconf.tab.c MCONF_SRC =mconf.c zconf.tab.c +LXDLG_SRC =checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC)) MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC)) +LXDLG_OBJS=$(patsubst %.c,%.o, $(LXDLG_SRC)) conf: $(CONF_OBJS) $(NATIVE_CC) $(NATIVE_CFLAGS) $(NATIVE_LDFLAGS) $^ -o $@ -mconf: $(MCONF_OBJS) - $(NATIVE_CC) $(NATIVE_CFLAGS) $(NATIVE_LDFLAGS) $^ -o $@ +mconf: $(MCONF_OBJS) $(LXDLG_OBJS) + $(NATIVE_CC) $(NATIVE_CFLAGS) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS) lkc_deps:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h @@ -77,8 +93,24 @@ zconf.tab.h: zconf.tab.h_shipped cp zconf.tab.h_shipped zconf.tab.h endif +.PHONY: ncurses + +ncurses: + @echo "main() {}" > lxtemp.c + @if $(NATIVE_CC) lxtemp.c $(LIBS) ; then \ + rm -f lxtemp.c a.out; \ + else \ + rm -f lxtemp.c; \ + echo -e "\007" ;\ + echo ">> Unable to find the Ncurses libraries." ;\ + echo ">>" ;\ + echo ">> You must have Ncurses installed in order" ;\ + echo ">> to use 'make menuconfig'" ;\ + echo ;\ + exit 1 ;\ + fi + clean: rm -f *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \ conf mconf zconf.tab.c zconf.tab.h lex.zconf.c lkc_defs.h - $(MAKE) -C lxdialog clean -- cgit v1.2.3