Merge "ARI: Run 'make ari-stubs'"
[asterisk/asterisk.git] / apps / Makefile
index 482bf2d..589293c 100644 (file)
@@ -1,67 +1,41 @@
 #
-# Asterisk -- A telephony toolkit for Linux.
-# 
+# Asterisk -- An open source telephony toolkit.
+#
 # Makefile for PBX applications
 #
 # Copyright (C) 1999-2006, Digium, Inc.
 #
-# Mark Spencer <markster@digium.com>
-#
 # This program is free software, distributed under the terms of
 # the GNU General Public License
 #
 
-SELECTED_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c)))
-
-# If you have UnixODBC you can use ODBC voicemail
-# storage
-#
-# Uncomment to use ODBC storage
-#CFLAGS+=-DUSE_ODBC_STORAGE
-# Uncomment for extended ODBC voicemail storage
-#CFLAGS+=-DEXTENDED_ODBC_STORAGE
-# See doc/README.odbcstorage for more information
-
-MODS:=$(patsubst %,%.so,$(SELECTED_MODS))
-
-all: $(MODS)
-
-clean-depend:
-       rm -f .depend
+-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps
 
-clean: clean-depend
-       rm -f *.so *.o
+MODULE_PREFIX=app
+MENUSELECT_CATEGORY=APPS
+MENUSELECT_DESCRIPTION=Applications
 
-%.so: %.o
-       $(CC) $(SOLINK) -o $@ $<
-
-app_rpt.so: app_rpt.o
-       $(CC) $(SOLINK) -o $@ $< $(ZAPTEL_LIB)
+MENUSELECT_OPTS_app_directory:=$(MENUSELECT_OPTS_app_voicemail)
+ifneq ($(findstring ODBC_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
+  MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_ODBC_STORAGE)
+endif
+ifneq ($(findstring IMAP_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
+  MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_IMAP_STORAGE)
+endif
 
-app_rpt.o: app_rpt.c
-       $(CC) -c -o $@ $(CFLAGS) $(ZAPTEL_INCLUDE) $<
+all: _all
 
-install: all
-       for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
-       rm -f $(DESTDIR)$(MODULES_DIR)/app_cut.so
-       rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
-       rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
+include $(ASTTOPDIR)/Makefile.moddir_rules
 
-uninstall:
+$(call MOD_ADD_C,app_confbridge,$(wildcard confbridge/*.c))
 
-ifeq (SunOS,$(shell uname))
-app_chanspy.so: app_chanspy.o
-       $(CC) $(SOLINK) -o $@ $< -lrt
-endif
+app_confbridge.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
+app_meetme.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
+app_minivm.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
+app_voicemail.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
+app_while.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
 
-ifneq ($(wildcard .depend),)
- include .depend
+ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
+  LIBS+= -lres_ael_share.so -lres_monitor.so -lres_speech.so
+  LIBS+= -lres_smdi.so
 endif
-
-depend: .depend
-
-.depend:
-       ../build_tools/mkdep $(CFLAGS) `ls *.c`
-
-env:
-       env