| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
ifneq ($(wildcard makeopts),) |
| 18 |
include makeopts |
| 19 |
endif |
| 20 |
|
| 21 |
.PHONY: clean dist-clean distclean test ntest ctest gtest |
| 22 |
|
| 23 |
|
| 24 |
OBJS:=menuselect.o strcompat.o |
| 25 |
|
| 26 |
|
| 27 |
CFLAGS+=-g -D_GNU_SOURCE -Wall -Wno-deprecated-declarations |
| 28 |
|
| 29 |
ifneq ($(findstring dragonfly,$(OSARCH)),) |
| 30 |
CFLAGS += -isystem /usr/local/include |
| 31 |
else ifneq ($(findstring netbsd,$(OSARCH)),) |
| 32 |
CFLAGS += -isystem /usr/pkg/include |
| 33 |
else ifneq ($(findstring bsd,$(OSARCH)),) |
| 34 |
CFLAGS += -isystem /usr/local/include |
| 35 |
endif |
| 36 |
|
| 37 |
ifeq ($(MENUSELECT_DEBUG),yes) |
| 38 |
CFLAGS += -DMENUSELECT_DEBUG |
| 39 |
endif |
| 40 |
|
| 41 |
ifdef NCURSES_LIB |
| 42 |
C_OBJS += menuselect_curses.o |
| 43 |
C_LIBS += $(NCURSES_LIB) $(TINFO_LIB) |
| 44 |
C_INCLUDE += $(NCURSES_INCLUDE) $(TINFO_INCLUDE) |
| 45 |
ALL_TGTS += cmenuselect |
| 46 |
CFLAGS += -DHAVE_NCURSES |
| 47 |
ifeq ($(HAVE_NCURSES_SUBDIR),yes) |
| 48 |
CFLAGS += -DHAVE_NCURSES_SUBDIR |
| 49 |
endif |
| 50 |
else |
| 51 |
ifdef CURSES_LIB |
| 52 |
C_OBJS += menuselect_curses.o |
| 53 |
C_LIBS += $(CURSES_LIB) $(TINFO_LIB) |
| 54 |
C_INCLUDE += $(CURSES_INCLUDE) $(TINFO_INCLUDE) |
| 55 |
ALL_TGTS += cmenuselect |
| 56 |
endif |
| 57 |
endif |
| 58 |
|
| 59 |
ifdef GTK2_LIB |
| 60 |
G_OBJS += menuselect_gtk.o |
| 61 |
G_LIBS += $(GTK2_LIB) |
| 62 |
G_INCLUDE += $(GTK2_INCLUDE) |
| 63 |
ALL_TGTS += gmenuselect |
| 64 |
endif |
| 65 |
|
| 66 |
ifdef NEWT_LIB |
| 67 |
N_OBJS += menuselect_newt.o |
| 68 |
N_LIBS += $(NEWT_LIB) |
| 69 |
N_INCLUDE += $(NEWT_INCLUDE) |
| 70 |
ALL_TGTS += nmenuselect |
| 71 |
endif |
| 72 |
|
| 73 |
M_OBJS += menuselect_stub.o |
| 74 |
M_LIBS += $(LIBXML2_LIB) |
| 75 |
ALL_TGTS += menuselect |
| 76 |
|
| 77 |
all: $(ALL_TGTS) |
| 78 |
|
| 79 |
$(OBJS) $(C_OBJS) $(N_OBJS) $(G_OBJS) $(M_OBJS): autoconfig.h menuselect.h |
| 80 |
|
| 81 |
makeopts: configure |
| 82 |
@./configure $(CONFIGURE_SILENT) |
| 83 |
@echo "****" |
| 84 |
@echo "**** The configure script was just executed, so 'make' needs to be" |
| 85 |
@echo "**** restarted." |
| 86 |
@echo "****" |
| 87 |
@exit 1 |
| 88 |
|
| 89 |
ifdef C_OBJS |
| 90 |
menuselect_curses.o: CFLAGS+=$(C_INCLUDE) |
| 91 |
cmenuselect: $(OBJS) $(C_OBJS) |
| 92 |
$(CC) $(LDFLAGS) -o $@ $^ $(C_LIBS) $(LIBXML2_LIB) |
| 93 |
else |
| 94 |
cmenuselect: |
| 95 |
endif |
| 96 |
|
| 97 |
ifdef G_OBJS |
| 98 |
menuselect_gtk.o: CFLAGS+=$(G_INCLUDE) |
| 99 |
gmenuselect: $(OBJS) $(G_OBJS) |
| 100 |
$(CC) $(LDFLAGS) -o $@ $^ $(G_LIBS) $(LIBXML2_LIB) |
| 101 |
else |
| 102 |
gmenuselect: |
| 103 |
endif |
| 104 |
|
| 105 |
ifdef N_OBJS |
| 106 |
menuselect_newt.o: CFLAGS+=$(N_INCLUDE) |
| 107 |
nmenuselect: $(OBJS) $(N_OBJS) |
| 108 |
$(CC) $(LDFLAGS) -o $@ $^ $(N_LIBS) $(LIBXML2_LIB) |
| 109 |
else |
| 110 |
nmenuselect: |
| 111 |
endif |
| 112 |
|
| 113 |
menuselect.o: CFLAGS+=$(LIBXML2_INCLUDE) |
| 114 |
|
| 115 |
menuselect: $(OBJS) $(M_OBJS) |
| 116 |
$(CC) $(LDFLAGS) -o $@ $^ $(M_LIBS) |
| 117 |
|
| 118 |
test: menuselect |
| 119 |
(cd test; ../$< menuselect.makeopts) |
| 120 |
|
| 121 |
ctest: cmenuselect |
| 122 |
(cd test; ../$< menuselect.makeopts) |
| 123 |
|
| 124 |
gtest: gmenuselect |
| 125 |
(cd test; ../$< menuselect.makeopts) |
| 126 |
|
| 127 |
ntest: nmenuselect |
| 128 |
(cd test; ../$< menuselect.makeopts) |
| 129 |
|
| 130 |
clean: |
| 131 |
rm -f menuselect cmenuselect gmenuselect nmenuselect $(OBJS) $(M_OBJS) $(C_OBJS) $(G_OBJS) $(N_OBJS) |
| 132 |
|
| 133 |
dist-clean: distclean |
| 134 |
|
| 135 |
distclean: clean |
| 136 |
rm -f autoconfig.h config.status config.log makeopts |
| 137 |
rm -rf autom4te.cache |