1HOSTCFLAGS += -DLOCALE 2LIBS = -lncurses 3 4ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h)) 5 HOSTCFLAGS += -I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>" 6else 7ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h)) 8 HOSTCFLAGS += -I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>" 9else 10ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h)) 11 HOSTCFLAGS += -DCURSES_LOC="<ncurses.h>" 12else 13 HOSTCFLAGS += -DCURSES_LOC="<curses.h>" 14endif 15endif 16endif 17 18 19OBJS = checklist.o menubox.o textbox.o yesno.o inputbox.o \ 20 util.o lxdialog.o msgbox.o 21 22%.o: %.c 23 $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $< 24 25all: ncurses lxdialog 26 27lxdialog: $(OBJS) 28 $(HOSTCC) -o lxdialog $(OBJS) $(LIBS) 29 30ncurses: 31 @echo "main() {}" > lxtemp.c 32 @if $(HOSTCC) -lncurses lxtemp.c ; then \ 33 rm -f lxtemp.c a.out; \ 34 else \ 35 rm -f lxtemp.c; \ 36 echo -e "\007" ;\ 37 echo ">> Unable to find the Ncurses libraries." ;\ 38 echo ">>" ;\ 39 echo ">> You must have Ncurses installed in order" ;\ 40 echo ">> to use 'make menuconfig'" ;\ 41 echo ;\ 42 exit 1 ;\ 43 fi 44 45clean: 46 rm -f core *.o *~ lxdialog 47