21d6b004ee5f986bc4b8b607e5fc7fa07a1cde17
[asterisk/asterisk.git] / addons / Makefile
1 #
2 # Asterisk -- A telephony toolkit for Linux.
3 #
4 # Makefile for Add-on Modules
5 #
6 # Copyright (C) 2009, Digium, Inc.
7 #
8 # This program is free software, distributed under the terms of
9 # the GNU General Public License
10 #
11
12 -include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps
13
14 MENUSELECT_CATEGORY=ADDONS
15 MENUSELECT_DESCRIPTION=Add-ons (See README-addons.txt)
16
17 H323OBJS:=ooCmdChannel.o ooLogChan.o ooUtils.o ooGkClient.o context.o \
18         ooDateTime.o decode.o dlist.o encode.o errmgmt.o \
19         memheap.o ootrace.o oochannels.o ooh245.o ooports.o \
20         ooq931.o ooCapability.o ooSocket.o perutil.o eventHandler.o \
21         ooCalls.o ooStackCmds.o ooh323.o ooh323ep.o printHandler.o \
22         rtctype.o ooTimer.o h323/H235-SECURITY-MESSAGESDec.o \
23         h323/H235-SECURITY-MESSAGESEnc.o h323/H323-MESSAGES.o h323/H323-MESSAGESDec.o \
24         h323/H323-MESSAGESEnc.o h323/MULTIMEDIA-SYSTEM-CONTROL.o \
25         h323/MULTIMEDIA-SYSTEM-CONTROLDec.o h323/MULTIMEDIA-SYSTEM-CONTROLEnc.o
26
27 H323CFLAGS:=-Iooh323c/src -Iooh323c/src/h323
28
29 ALL_C_MODS:=app_mysql \
30             app_saycountpl \
31             cdr_mysql \
32             chan_mobile \
33             chan_ooh323 \
34             format_mp3 \
35             res_config_mysql
36
37 all: check_mp3 _all
38
39 check_mp3:
40 ifeq ($(filter format_mp3,$(MENUSELECT_ADDONS)),)
41         @if [ ! -f mp3/Makefile ] ; then \
42                 echo ; \
43                 echo "**************************************************************" ; \
44                 echo "***                                                        ***" ; \
45                 echo "***   --->  READ THIS OR YOUR BUILD WILL FAIL  <---        ***" ; \
46                 echo "***                                                        ***" ; \
47                 echo "*** format_mp3 has been selected to be installed, but the  ***" ; \
48                 echo "*** mp3 decoder library has not yet been downloaded into   ***" ; \
49                 echo "*** the source tree.  To do so, please run the following   ***" ; \
50                 echo "*** command:                                               ***" ; \
51                 echo "***                                                        ***" ; \
52                 echo "***          $$ contrib/scripts/get_mp3_source.sh           ***" ; \
53                 echo "***                                                        ***" ; \
54                 echo "**************************************************************" ; \
55                 echo ; \
56         fi
57 endif
58
59 include $(ASTTOPDIR)/Makefile.moddir_rules
60
61 clean::
62         if [ -f mp3/Makefile ] ; then $(MAKE) -C mp3 clean ; fi
63         rm -f $(addprefix ooh323c/src/,$(H323OBJS))
64
65 $(if $(filter format_mp3,$(EMBEDDED_MODS)),modules.link,format_mp3.so): mp3/common.o mp3/dct64_i386.o mp3/decode_ntom.o mp3/layer3.o mp3/tabinit.o mp3/interface.o
66
67 chan_ooh323.o: _ASTCFLAGS+=$(H323CFLAGS)
68
69 $(if $(filter chan_ooh323,$(EMBEDDED_MODS)),modules.link,chan_ooh323.so): _ASTCFLAGS+=$(H323CFLAGS)
70 $(if $(filter chan_ooh323,$(EMBEDDED_MODS)),modules.link,chan_ooh323.so): $(addprefix ooh323c/src/,$(H323OBJS)) chan_ooh323.o ooh323cDriver.o
71 $(addprefix ooh323c/src/,$(H323OBJS)) chan_ooh323.o ooh323cDriver.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,chan_ooh323)
72
73 .PHONY: check_mp3