From 929f718b237bbc9193ad9be1d18457ac12c23905 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 13 Dec 2002 22:43:38 +0000 Subject: Only build the ncurses stuff when it is needed, based on a patch from Stefan Allius (though the extra/config/Makefile rework is mine), -Erik --- extra/config/Makefile | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'extra/config/Makefile') diff --git a/extra/config/Makefile b/extra/config/Makefile index 50d9ac096..442fbfbed 100644 --- a/extra/config/Makefile +++ b/extra/config/Makefile @@ -19,51 +19,44 @@ TOPDIR=../../ include $(TOPDIR)Rules.mak - all: ncurses conf mconf LIBS = -lncurses ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h)) - HOSTCFLAGS += -I/usr/include/ncurses -DCURSES_LOC="" + HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="" else ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h)) - HOSTCFLAGS += -I/usr/include/ncurses -DCURSES_LOC="" + HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="" else ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h)) - HOSTCFLAGS += -DCURSES_LOC="" + HOSTNCURSES += -DCURSES_LOC="" else - HOSTCFLAGS += -DCURSES_LOC="" + HOSTNCURSES += -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_SRC =conf.c +MCONF_SRC =mconf.c checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c +SHARED_SRC=zconf.tab.c +SHARED_DEPS:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC)) MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC)) -LXDLG_OBJS=$(patsubst %.c,%.o, $(LXDLG_SRC)) - -conf: $(CONF_OBJS) - $(HOSTCC) $(HOSTCFLAGS) $(NATIVE_LDFLAGS) $^ -o $@ - -mconf: $(MCONF_OBJS) $(LXDLG_OBJS) - $(HOSTCC) $(HOSTCFLAGS) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS) - -lkc_deps:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h - -conf.o: conf.c $(lkc_deps) - -mconf.o: mconf.c $(lkc_deps) +SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC)) -zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(lkc_deps) +conf: $(CONF_OBJS) $(SHARED_OBJS) + $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ -lex.zconf.o: lex.zconf.c $(lkc_deps) +mconf: $(MCONF_OBJS) $(SHARED_OBJS) + $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS) -%.o : %.c +$(CONF_OBJS): %.o : %.c $(SHARED_DEPS) $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ +$(MCONF_OBJS): %.o : %.c $(SHARED_DEPS) + $(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@ + lkc_defs.h: lkc_proto.h @sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' @@ -82,9 +75,15 @@ lex.%.c: %.l flex -P$(notdir $*) -o$@ $< else +lex.zconf.o: lex.zconf.c $(SHARED_DEPS) + $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ + lex.zconf.c: lex.zconf.c_shipped cp lex.zconf.c_shipped lex.zconf.c +zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(SHARED_DEPS) + $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ + zconf.tab.c: zconf.tab.c_shipped cp zconf.tab.c_shipped zconf.tab.c -- cgit v1.2.3