Makefile 1.2 KB

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