2002-12-05 08:41:41 +00:00
|
|
|
# Makefile for BusyBox
|
|
|
|
#
|
|
|
|
# Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
|
|
|
|
|
2004-10-08 07:46:08 +00:00
|
|
|
top_srcdir=../..
|
|
|
|
top_builddir=../..
|
|
|
|
srcdir=$(top_srcdir)/scripts/config
|
2005-08-24 00:41:52 +00:00
|
|
|
include $(top_srcdir)/Rules.mak
|
2002-12-05 08:41:41 +00:00
|
|
|
|
|
|
|
all: ncurses conf mconf
|
|
|
|
|
2005-04-19 09:55:06 +00:00
|
|
|
ifeq ($(shell uname),SunOS)
|
|
|
|
LIBS = -lcurses
|
|
|
|
else
|
2002-12-05 08:41:41 +00:00
|
|
|
LIBS = -lncurses
|
2005-04-19 09:55:06 +00:00
|
|
|
endif
|
2002-12-05 08:41:41 +00:00
|
|
|
ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h))
|
2002-12-13 22:53:28 +00:00
|
|
|
HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"
|
2002-12-05 08:41:41 +00:00
|
|
|
else
|
|
|
|
ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h))
|
2002-12-13 22:53:28 +00:00
|
|
|
HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"
|
2002-12-05 08:41:41 +00:00
|
|
|
else
|
2003-01-11 18:07:38 +00:00
|
|
|
ifeq (/usr/local/include/ncurses/ncurses.h, $(wildcard /usr/local/include/ncurses/ncurses.h))
|
|
|
|
HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses.h>"
|
|
|
|
else
|
|
|
|
ifeq (/usr/local/include/ncurses/curses.h, $(wildcard /usr/local/include/ncurses/curses.h))
|
|
|
|
HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"
|
|
|
|
else
|
2002-12-05 08:41:41 +00:00
|
|
|
ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h))
|
2002-12-13 22:53:28 +00:00
|
|
|
HOSTNCURSES += -DCURSES_LOC="<ncurses.h>"
|
2002-12-05 08:41:41 +00:00
|
|
|
else
|
2002-12-13 22:53:28 +00:00
|
|
|
HOSTNCURSES += -DCURSES_LOC="<curses.h>"
|
2002-12-05 08:41:41 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
2003-01-11 18:07:38 +00:00
|
|
|
endif
|
|
|
|
endif
|
2002-12-05 08:41:41 +00:00
|
|
|
|
2005-04-19 09:55:06 +00:00
|
|
|
CONF_SRC = conf.c
|
|
|
|
MCONF_SRC = mconf.c
|
|
|
|
LXD_SRC = lxdialog/checklist.c lxdialog/menubox.c lxdialog/textbox.c \
|
|
|
|
lxdialog/yesno.c lxdialog/inputbox.c lxdialog/util.c \
|
|
|
|
lxdialog/msgbox.c
|
2005-08-24 00:41:52 +00:00
|
|
|
|
2005-04-19 09:55:06 +00:00
|
|
|
SHARED_SRC = zconf.tab.c
|
|
|
|
SHARED_DEPS := $(srcdir)/lkc.h $(srcdir)/lkc_proto.h \
|
|
|
|
lkc_defs.h $(srcdir)/expr.h zconf.tab.h
|
|
|
|
CONF_OBJS = $(patsubst %.c,%.o, $(CONF_SRC))
|
|
|
|
MCONF_OBJS = $(patsubst %.c,%.o, $(MCONF_SRC) $(LXD_SRC))
|
|
|
|
SHARED_OBJS = $(patsubst %.c,%.o, $(SHARED_SRC))
|
2002-12-05 08:41:41 +00:00
|
|
|
|
2004-03-15 08:29:22 +00:00
|
|
|
conf: $(CONF_OBJS) $(SHARED_OBJS)
|
2006-03-13 19:04:00 +00:00
|
|
|
$(SECHO) " "HOSTCC $@ ; true
|
|
|
|
$(Q)$(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@
|
2002-12-05 08:41:41 +00:00
|
|
|
|
2002-12-13 22:53:28 +00:00
|
|
|
mconf: $(MCONF_OBJS) $(SHARED_OBJS)
|
2006-03-13 19:04:00 +00:00
|
|
|
$(SECHO) " "HOSTCC $@ ; true
|
|
|
|
$(Q)$(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS)
|
2002-12-05 08:41:41 +00:00
|
|
|
|
2004-10-08 07:46:08 +00:00
|
|
|
$(CONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
|
2006-02-02 01:41:53 +00:00
|
|
|
$(compile.h) -I.
|
2002-12-05 08:41:41 +00:00
|
|
|
|
2004-10-08 07:46:08 +00:00
|
|
|
$(MCONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
|
2006-03-01 22:54:48 +00:00
|
|
|
@[ -d $(@D) ] || mkdir $(@D)
|
2006-02-02 01:41:53 +00:00
|
|
|
$(compile.h) $(HOSTNCURSES) -I.
|
2002-12-13 22:53:28 +00:00
|
|
|
|
2004-10-08 07:46:08 +00:00
|
|
|
lkc_defs.h: $(srcdir)/lkc_proto.h
|
2006-03-01 22:54:48 +00:00
|
|
|
@$(SED) < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
|
2002-12-05 08:41:41 +00:00
|
|
|
|
|
|
|
###
|
|
|
|
# The following requires flex/bison
|
2004-03-15 08:29:22 +00:00
|
|
|
# By default we use the _shipped versions, uncomment the
|
2002-12-05 08:41:41 +00:00
|
|
|
# following line if you are modifying the flex/bison src.
|
|
|
|
#LKC_GENPARSER := 1
|
|
|
|
|
|
|
|
ifdef LKC_GENPARSER
|
|
|
|
|
2004-10-08 07:46:08 +00:00
|
|
|
%.tab.c %.tab.h: $(srcdir)/%.y
|
2002-12-05 08:41:41 +00:00
|
|
|
bison -t -d -v -b $* -p $(notdir $*) $<
|
|
|
|
|
2004-10-08 07:46:08 +00:00
|
|
|
lex.%.c: $(srcdir)/%.l
|
2002-12-05 08:41:41 +00:00
|
|
|
flex -P$(notdir $*) -o$@ $<
|
|
|
|
else
|
|
|
|
|
2002-12-13 22:53:28 +00:00
|
|
|
lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
|
2006-02-02 01:41:53 +00:00
|
|
|
$(compile.h) -I$(srcdir)
|
2002-12-05 08:41:41 +00:00
|
|
|
|
2004-10-08 07:46:08 +00:00
|
|
|
lex.zconf.c: $(srcdir)/lex.zconf.c_shipped
|
2006-02-02 01:41:53 +00:00
|
|
|
$(Q)cp $< $@
|
2002-12-13 22:53:28 +00:00
|
|
|
|
2004-10-08 07:46:08 +00:00
|
|
|
zconf.tab.c: $(srcdir)/zconf.tab.c_shipped
|
2006-02-02 01:41:53 +00:00
|
|
|
$(Q)cp $< $@
|
2002-12-05 08:41:41 +00:00
|
|
|
|
2004-10-08 07:46:08 +00:00
|
|
|
zconf.tab.h: $(srcdir)/zconf.tab.h_shipped
|
2006-02-02 01:41:53 +00:00
|
|
|
$(Q)cp $< $@
|
2002-12-05 08:41:41 +00:00
|
|
|
endif
|
|
|
|
|
2004-10-08 07:46:08 +00:00
|
|
|
zconf.tab.o: zconf.tab.c lex.zconf.c $(srcdir)/confdata.c $(srcdir)/expr.c \
|
|
|
|
$(srcdir)/symbol.c $(srcdir)/menu.c $(SHARED_DEPS)
|
2006-02-02 01:41:53 +00:00
|
|
|
$(compile.h) -I$(srcdir) -I.
|
2004-10-08 07:46:08 +00:00
|
|
|
|
2002-12-05 08:41:41 +00:00
|
|
|
.PHONY: ncurses
|
|
|
|
|
|
|
|
ncurses:
|
|
|
|
@echo "main() {}" > lxtemp.c
|
|
|
|
@if $(HOSTCC) 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
|
|
|
|
|