2002-12-05 14:11:41 +05:30
|
|
|
# Makefile for BusyBox
|
|
|
|
#
|
|
|
|
# Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
|
|
|
|
|
2004-10-08 13:16:08 +05:30
|
|
|
top_srcdir=../..
|
|
|
|
top_builddir=../..
|
|
|
|
srcdir=$(top_srcdir)/scripts/config
|
2005-08-24 06:11:52 +05:30
|
|
|
include $(top_srcdir)/Rules.mak
|
2002-12-05 14:11:41 +05:30
|
|
|
|
|
|
|
all: ncurses conf mconf
|
|
|
|
|
2005-04-19 15:25:06 +05:30
|
|
|
ifeq ($(shell uname),SunOS)
|
|
|
|
LIBS = -lcurses
|
|
|
|
else
|
2002-12-05 14:11:41 +05:30
|
|
|
LIBS = -lncurses
|
2005-04-19 15:25:06 +05:30
|
|
|
endif
|
2002-12-05 14:11:41 +05:30
|
|
|
ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h))
|
2002-12-14 04:23:28 +05:30
|
|
|
HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"
|
2002-12-05 14:11:41 +05:30
|
|
|
else
|
|
|
|
ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h))
|
2002-12-14 04:23:28 +05:30
|
|
|
HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"
|
2002-12-05 14:11:41 +05:30
|
|
|
else
|
2003-01-11 23:37:38 +05:30
|
|
|
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 14:11:41 +05:30
|
|
|
ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h))
|
2002-12-14 04:23:28 +05:30
|
|
|
HOSTNCURSES += -DCURSES_LOC="<ncurses.h>"
|
2002-12-05 14:11:41 +05:30
|
|
|
else
|
2002-12-14 04:23:28 +05:30
|
|
|
HOSTNCURSES += -DCURSES_LOC="<curses.h>"
|
2002-12-05 14:11:41 +05:30
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
2003-01-11 23:37:38 +05:30
|
|
|
endif
|
|
|
|
endif
|
2002-12-05 14:11:41 +05:30
|
|
|
|
2005-04-19 15:25:06 +05:30
|
|
|
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 06:11:52 +05:30
|
|
|
|
2005-04-19 15:25:06 +05:30
|
|
|
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 14:11:41 +05:30
|
|
|
|
2004-03-15 13:59:22 +05:30
|
|
|
conf: $(CONF_OBJS) $(SHARED_OBJS)
|
2006-03-14 00:34:00 +05:30
|
|
|
$(SECHO) " "HOSTCC $@ ; true
|
|
|
|
$(Q)$(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@
|
2002-12-05 14:11:41 +05:30
|
|
|
|
2002-12-14 04:23:28 +05:30
|
|
|
mconf: $(MCONF_OBJS) $(SHARED_OBJS)
|
2006-03-14 00:34:00 +05:30
|
|
|
$(SECHO) " "HOSTCC $@ ; true
|
|
|
|
$(Q)$(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS)
|
2002-12-05 14:11:41 +05:30
|
|
|
|
2004-10-08 13:16:08 +05:30
|
|
|
$(CONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
|
2006-02-02 07:11:53 +05:30
|
|
|
$(compile.h) -I.
|
2002-12-05 14:11:41 +05:30
|
|
|
|
2004-10-08 13:16:08 +05:30
|
|
|
$(MCONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
|
2006-03-02 04:24:48 +05:30
|
|
|
@[ -d $(@D) ] || mkdir $(@D)
|
2006-02-02 07:11:53 +05:30
|
|
|
$(compile.h) $(HOSTNCURSES) -I.
|
2002-12-14 04:23:28 +05:30
|
|
|
|
2004-10-08 13:16:08 +05:30
|
|
|
lkc_defs.h: $(srcdir)/lkc_proto.h
|
2006-03-02 04:24:48 +05:30
|
|
|
@$(SED) < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
|
2002-12-05 14:11:41 +05:30
|
|
|
|
|
|
|
###
|
|
|
|
# The following requires flex/bison
|
2004-03-15 13:59:22 +05:30
|
|
|
# By default we use the _shipped versions, uncomment the
|
2002-12-05 14:11:41 +05:30
|
|
|
# following line if you are modifying the flex/bison src.
|
|
|
|
#LKC_GENPARSER := 1
|
|
|
|
|
|
|
|
ifdef LKC_GENPARSER
|
|
|
|
|
2004-10-08 13:16:08 +05:30
|
|
|
%.tab.c %.tab.h: $(srcdir)/%.y
|
2002-12-05 14:11:41 +05:30
|
|
|
bison -t -d -v -b $* -p $(notdir $*) $<
|
|
|
|
|
2004-10-08 13:16:08 +05:30
|
|
|
lex.%.c: $(srcdir)/%.l
|
2002-12-05 14:11:41 +05:30
|
|
|
flex -P$(notdir $*) -o$@ $<
|
|
|
|
else
|
|
|
|
|
2002-12-14 04:23:28 +05:30
|
|
|
lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
|
2006-02-02 07:11:53 +05:30
|
|
|
$(compile.h) -I$(srcdir)
|
2002-12-05 14:11:41 +05:30
|
|
|
|
2004-10-08 13:16:08 +05:30
|
|
|
lex.zconf.c: $(srcdir)/lex.zconf.c_shipped
|
2006-02-02 07:11:53 +05:30
|
|
|
$(Q)cp $< $@
|
2002-12-14 04:23:28 +05:30
|
|
|
|
2004-10-08 13:16:08 +05:30
|
|
|
zconf.tab.c: $(srcdir)/zconf.tab.c_shipped
|
2006-02-02 07:11:53 +05:30
|
|
|
$(Q)cp $< $@
|
2002-12-05 14:11:41 +05:30
|
|
|
|
2004-10-08 13:16:08 +05:30
|
|
|
zconf.tab.h: $(srcdir)/zconf.tab.h_shipped
|
2006-02-02 07:11:53 +05:30
|
|
|
$(Q)cp $< $@
|
2002-12-05 14:11:41 +05:30
|
|
|
endif
|
|
|
|
|
2004-10-08 13:16:08 +05:30
|
|
|
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 07:11:53 +05:30
|
|
|
$(compile.h) -I$(srcdir) -I.
|
2004-10-08 13:16:08 +05:30
|
|
|
|
2002-12-05 14:11:41 +05:30
|
|
|
.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
|
|
|
|
|