nettoyage du repertoire debian/
[asterisk-app-conference.git] / Makefile
1 # $Id: Makefile 889 2007-08-09 14:42:48Z sbalea $
2
3 #
4 # Makefile, based on the Asterisk Makefile, Coypright (C) 1999, Mark Spencer
5 #
6 # Copyright (C) 2002,2003 Junghanns.NET GmbH
7 #
8 # Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
9 #
10 # This program is free software and may be modified and
11 # distributed under the terms of the GNU Public License.
12 #
13
14 .EXPORT_ALL_VARIABLES:
15
16 #
17 # app_conference defines which can be passed on the command-line
18 #
19
20 INSTALL_PREFIX := $(DESTDIR)
21 INSTALL_MODULES_DIR := $(INSTALL_PREFIX)/usr/lib/asterisk/modules
22 INSTALL_SOUNDS := $(INSTALL_PREFIX)/usr/share/asterisk/sounds
23
24 ASTERISK_INCLUDE_DIR ?= ../asterisk/include
25
26 REVISION = $(shell svnversion -n .)
27
28 # turn app_conference debugging on or off ( 0 == OFF, 1 == ON )
29 APP_CONFERENCE_DEBUG ?= 0
30
31 # 0 = OFF 1 = astdsp 2 = speex
32 SILDET := 2
33
34 #
35 # app_conference objects to build
36 #
37
38 OBJS = app_conference.o conference.o member.o frame.o cli.o
39 TARGET = app_conference.so
40
41
42 #
43 # standard compile settings
44 #
45
46 PROC = $(shell uname -m)
47 INSTALL = install
48
49 INCLUDE = -I$(ASTERISK_INCLUDE_DIR)
50 DEBUG := -g
51
52 CC = gcc
53
54 CFLAGS = -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -MD -MP $(DEBUG)
55 CPPFLAGS = $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE -DREVISION=\"$(REVISION)\"
56
57 #CFLAGS += -O2
58 #CFLAGS += -O3 -march=pentium3 -msse -mfpmath=sse,387 -ffast-math
59 # PERF: below is 10% faster than -O2 or -O3 alone.
60 #CFLAGS += -O3 -ffast-math -funroll-loops
61 # below is another 5% faster or so.
62 #CFLAGS += -O3 -ffast-math -funroll-all-loops -fsingle-precision-constant
63 #CFLAGS += -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic
64 # adding -msse -mfpmath=sse has little effect.
65 #CFLAGS += -O3 -msse -mfpmath=sse
66 #CFLAGS += $(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
67 CFLAGS += $(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
68 CFLAGS += -fPIC
69 CPPFLAGS += -DCRYPTO
70
71 #
72 # Uncomment this if you want G.729A support (need to have the actual codec installed
73 #
74 # CPPFLAGS += -DAC_USE_G729A
75
76
77 ifeq ($(APP_CONFERENCE_DEBUG), 1)
78 CPPFLAGS += -DAPP_CONFERENCE_DEBUG
79 endif
80
81 #
82 # additional flag values for silence detection
83 #
84
85 ifeq ($(SILDET), 2)
86 OBJS += libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
87 CPPFLAGS += -Ilibspeex -DSILDET=2
88 endif
89
90 ifeq ($(SILDET), 1)
91 CPPFLAGS += -DSILDET=1
92 endif
93
94 OSARCH=$(shell uname -s)
95 ifeq (${OSARCH},Darwin)
96 SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
97 else
98 SOLINK=-shared -Xlinker -x
99 endif
100
101 DEPS += $(subst .o,.d,$(OBJS))
102
103 #
104 # targets
105 #
106
107 all: $(TARGET)
108
109 .PHONY: clean
110 clean:
111 $(RM) $(OBJS) $(DEPS)
112
113 .PHONY: distclean
114 distclean: clean
115 $(RM) $(TARGET)
116
117 $(TARGET): $(OBJS)
118 $(CC) -pg $(SOLINK) -o $@ $(OBJS)
119
120 vad_test: vad_test.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
121 $(CC) $(PROFILE) -o $@ $^ -lm
122
123 install:
124 $(INSTALL) -m 755 $(TARGET) $(INSTALL_MODULES_DIR)
125 mkdir -p $(INSTALL_SOUNDS)
126 $(INSTALL) -o root -g root -m 644 sounds/*.gsm $(INSTALL_SOUNDS)
127
128 # config: all
129 # cp conf.conf /etc/asterisk/
130
131 -include $(DEPS)
132