summaryrefslogtreecommitdiff
path: root/menuselect/Makefile
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-07-17 18:42:43 +0000
committerMatthew Jordan <mjordan@digium.com>2014-07-17 18:42:43 +0000
commitc7d3570248cfee32fb35fdf9d683ccb23e8da10b (patch)
tree792b25aea89fbbebf8eee3914037448729760cc1 /menuselect/Makefile
parentcd6c7744568e07124bd2cbf01d57eb0e15c82013 (diff)
menuselect: Add menuselect to Asterisk trunk (Patch 1)
This is the first patch that adds menuselect to Asterisk trunk, and removes the svn:externals property. This is being done for two reasons: (1) The removal of external repositories eases a future migration to git (2) Asterisk is now the only thing that uses menuselect; as a result, there's little need to keep it in an external repository Subsequent patches will remove the mxml dependency from menuselect and tidy up the build system. ASTERISK-20703 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'menuselect/Makefile')
-rw-r--r--menuselect/Makefile123
1 files changed, 123 insertions, 0 deletions
diff --git a/menuselect/Makefile b/menuselect/Makefile
new file mode 100644
index 000000000..2ddf35b90
--- /dev/null
+++ b/menuselect/Makefile
@@ -0,0 +1,123 @@
+#
+# Asterisk -- A telephony toolkit for Linux.
+#
+# Makefile for Menuselect
+#
+# Copyright (C) 2005-2008, Digium, Inc.
+#
+# Russell Bryant <russell@digium.com>
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License
+#
+
+# even though we could use '-include makeopts' here, use a wildcard
+# lookup anyway, so that make won't try to build makeopts if it doesn't
+# exist (other rules will force it to be built if needed)
+ifneq ($(wildcard makeopts),)
+ include makeopts
+endif
+
+.PHONY: clean dist-clean distclean test ntest ctest gtest
+
+# Basic set of sources and flags/libraries/includes
+OBJS:=menuselect.o strcompat.o
+CFLAGS+=-g -D_GNU_SOURCE -Wall
+
+ifeq ($(MENUSELECT_DEBUG),yes)
+ CFLAGS += -DMENUSELECT_DEBUG
+endif
+
+ifdef NCURSES_LIB
+ C_OBJS += menuselect_curses.o
+ C_LIBS +=$(NCURSES_LIB)
+ C_INCLUDE += $(NCURSES_INCLUDE)
+ ALL_TGTS += cmenuselect
+else
+ ifdef CURSES_LIB
+ C_OBJS += menuselect_curses.o
+ C_LIBS +=$(CURSES_LIB)
+ C_INCLUDE += $(CURSES_INCLUDE)
+ ALL_TGTS += cmenuselect
+ endif
+endif
+
+ifdef GTK2_LIB
+ G_OBJS += menuselect_gtk.o
+ G_LIBS += $(GTK2_LIB)
+ G_INCLUDE += $(GTK2_INCLUDE)
+ ALL_TGTS += gmenuselect
+endif
+
+ifdef NEWT_LIB
+ N_OBJS += menuselect_newt.o
+ N_LIBS += $(NEWT_LIB)
+ N_INCLUDE += $(NEWT_INCLUDE)
+ ALL_TGTS += nmenuselect
+endif
+
+M_OBJS += menuselect_stub.o
+ALL_TGTS += menuselect
+
+all: $(ALL_TGTS)
+
+$(OBJS) $(C_OBJS) $(N_OBJS) $(G_OBJS) $(M_OBJS): autoconfig.h menuselect.h
+
+makeopts autoconfig.h: autoconfig.h.in makeopts.in
+ @./configure $(CONFIGURE_SILENT)
+
+$(ALL_TGTS): mxml/libmxml.a
+
+ifdef C_OBJS
+menuselect_curses.o: CFLAGS+=$(C_INCLUDE)
+cmenuselect: $(OBJS) $(C_OBJS)
+ $(CC) $(LDFLAGS) -o $@ $^ $(C_LIBS)
+else
+cmenuselect:
+endif
+
+ifdef G_OBJS
+menuselect_gtk.o: CFLAGS+=$(G_INCLUDE)
+gmenuselect: $(OBJS) $(G_OBJS)
+ $(CC) $(LDFLAGS) -o $@ $^ $(G_LIBS)
+else
+gmenuselect:
+endif
+
+ifdef N_OBJS
+menuselect_newt.o: CFLAGS+=$(N_INCLUDE)
+nmenuselect: $(OBJS) $(N_OBJS)
+ $(CC) $(LDFLAGS) -o $@ $^ $(N_LIBS)
+else
+nmenuselect:
+endif
+
+menuselect: $(OBJS) $(M_OBJS)
+ $(CC) $(LDFLAGS) -o $@ $^ $(M_LIBS)
+
+mxml/libmxml.a:
+ @if test ! -f mxml/Makefile ; then cd mxml && ./configure ; fi
+ @$(MAKE) -C mxml libmxml.a
+
+test: menuselect
+ (cd test; ../$< menuselect.makeopts)
+
+ctest: cmenuselect
+ (cd test; ../$< menuselect.makeopts)
+
+gtest: gmenuselect
+ (cd test; ../$< menuselect.makeopts)
+
+ntest: nmenuselect
+ (cd test; ../$< menuselect.makeopts)
+
+clean:
+ rm -f menuselect cmenuselect gmenuselect nmenuselect $(OBJS) $(M_OBJS) $(C_OBJS) $(G_OBJS) $(N_OBJS)
+ @if test -f mxml/Makefile ; then $(MAKE) -C mxml clean ; fi
+
+dist-clean: distclean
+
+distclean: clean
+ @if test -f mxml/Makefile ; then $(MAKE) -C mxml distclean ; fi
+ rm -f autoconfig.h config.status config.log makeopts
+ rm -rf autom4te.cache