aboutsummaryrefslogtreecommitdiffstats
path: root/apps/Makefile
blob: 104aa405488693bd7725646dd9609336e4a6dc8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#
# Asterisk -- A telephony toolkit for Linux.
# 
# Makefile for PBX applications
#
# Copyright (C) 1999-2005, Digium
#
# Mark Spencer <markster@digium.com>
#
# This program is free software, distributed under the terms of
# the GNU General Public License
#

USE_MYSQL_VM_INTERFACE=0
USE_POSTGRES_VM_INTERFACE=0

#APPS=app_dial.so app_playback.so app_directory.so app_intercom.so app_mp3.so 
APPS=app_dial.so app_playback.so app_voicemail.so app_directory.so app_mp3.so\
     app_system.so app_echo.so app_record.so app_image.so app_url.so app_disa.so \
     app_adsiprog.so app_getcpeid.so app_milliwatt.so \
     app_zapateller.so app_setcallerid.so app_festival.so \
     app_queue.so app_senddtmf.so app_parkandannounce.so app_striplsd.so \
     app_setcidname.so app_lookupcidname.so app_substring.so app_macro.so \
     app_authenticate.so app_softhangup.so app_lookupblacklist.so \
     app_waitforring.so app_privacy.so app_db.so app_chanisavail.so \
     app_enumlookup.so app_transfer.so app_setcidnum.so app_cdr.so \
     app_hasnewvoicemail.so app_sayunixtime.so app_cut.so app_read.so \
     app_setcdruserfield.so app_random.so app_ices.so app_eval.so \
     app_nbscat.so app_sendtext.so app_exec.so app_sms.so \
     app_groupcount.so app_txtcidname.so app_controlplayback.so \
     app_talkdetect.so app_alarmreceiver.so app_userevent.so app_verbose.so \
     app_test.so app_forkcdr.so app_math.so app_realtime.so \
     app_dumpchan.so app_waitforsilence.so app_while.so app_setrdnis.so \
     app_md5.so app_readfile.so app_chanspy.so app_settransfercapability.so \
     app_dictate.so

ifneq (${OSARCH},Darwin)
ifneq (${OSARCH},SunOS)
#APPS+=app_intercom.so
endif
endif

#
# Obsolete things...
#

#APPS+=app_sql_postgres.so
#APPS+=app_sql_odbc.so
#APPS+=app_rpt.so
#
# Experimental things
#
#APPS+=app_ivrdemo.so
#APPS+=app_skel.so

APPS+=$(shell if [ -f $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
APPS+=$(shell if [ -f $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
APPS+=$(shell if [ -f $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi)

CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
ifneq ($(shell if [[ 0x`$(CROSS_COMPILE_BIN)curl-config --vernum` -ge 0x70907 ]]; then echo "OK" ; fi),)
	ifneq (${CURLLIBS},)
		APPS+=app_curl.so
		ifeq (${OSARCH},OpenBSD)
			CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
		endif
	endif 
endif
CFLAGS+=-fPIC
#
# If you have MySQL 4.1 or later you can use ODBC
# storage
#
#CFLAGS+=-DUSE_ODBC_STORAGE

all: $(APPS)

clean:
	rm -f *.so *.o look .depend

%.so : %.o
	$(CC) $(SOLINK) -o $@ $<

app_rpt.so : app_rpt.o
	$(CC) $(SOLINK) -o $@ $< -ltonezone

install: all
	for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
	rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
	rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so

app_curl.so: app_curl.o
	$(CC) $(SOLINK) -o $@ $< $(CURLLIBS)

app_voicemail.so : app_voicemail.o
ifeq ($(USE_MYSQL_VM_INTERFACE),1)
	$(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L/usr/lib/mysql -lmysqlclient -lz
else
ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
	$(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lpq
else
	$(CC) $(SOLINK) -o $@ $(MLFLAGS) $< 
endif
endif

app_sql_postgres.o: app_sql_postgres.c
	$(CC) -pipe -I/usr/local/pgsql/include $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c

app_sql_postgres.so: app_sql_postgres.o
	$(CC) $(SOLINK) -o $@ $< -L/usr/local/pgsql/lib -lpq

app_sql_odbc.so: app_sql_odbc.o
	$(CC) $(SOLINK) -o $@ $< -lodbc

look:	look.c
	$(CC) -pipe -O6 -g look.c -o look -lncurses

ifeq (SunOS,$(shell uname))
app_chanspy.so: app_chanspy.o
	$(CC) $(SOLINK) -o $@ $< -lrt
endif


ifneq ($(wildcard .depend),)
include .depend
endif

depend: .depend

.depend:
	../build_tools/mkdep $(CFLAGS) `ls *.c`

env:
	env