-rw-r--r-- | scripts/lxdialog/Makefile | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/lxdialog/Makefile b/scripts/lxdialog/Makefile new file mode 100644 index 0000000..75b7bac --- a/dev/null +++ b/scripts/lxdialog/Makefile | |||
@@ -0,0 +1,44 @@ | |||
1 | HOST_CFLAGS := -DLOCALE | ||
2 | HOST_LDFLAGS := -lncurses | ||
3 | |||
4 | ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h)) | ||
5 | HOST_CFLAGS += -I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>" | ||
6 | else | ||
7 | ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h)) | ||
8 | HOST_CFLAGS += -I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>" | ||
9 | else | ||
10 | ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h)) | ||
11 | HOST_CFLAGS += -DCURSES_LOC="<ncurses.h>" | ||
12 | else | ||
13 | HOST_CFLAGS += -DCURSES_LOC="<curses.h>" | ||
14 | endif | ||
15 | endif | ||
16 | endif | ||
17 | |||
18 | host-progs := lxdialog | ||
19 | |||
20 | lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \ | ||
21 | util.o lxdialog.o msgbox.o | ||
22 | |||
23 | EXTRA_TARGETS := lxdialog | ||
24 | |||
25 | first_rule: ncurses | ||
26 | |||
27 | include $(TOPDIR)/Rules.make | ||
28 | |||
29 | .PHONY: ncurses | ||
30 | |||
31 | ncurses: | ||
32 | @echo "main() {}" > lxtemp.c | ||
33 | @if $(HOSTCC) $(HOST_CFLAGS) lxtemp.c $(HOST_LDFLAGS); then \ | ||
34 | rm -f lxtemp.c a.out; \ | ||
35 | else \ | ||
36 | rm -f lxtemp.c; \ | ||
37 | echo -e "\007" ;\ | ||
38 | echo ">> Unable to find the Ncurses libraries." ;\ | ||
39 | echo ">>" ;\ | ||
40 | echo ">> You must have Ncurses installed in order" ;\ | ||
41 | echo ">> to use 'make menuconfig'" ;\ | ||
42 | echo ;\ | ||
43 | exit 1 ;\ | ||
44 | fi | ||