nettoyage du repertoire debian/
[asterisk-app-conference.git] / Makefile
CommitLineData
c575c500
TN
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
20INSTALL_PREFIX := $(DESTDIR)
21INSTALL_MODULES_DIR := $(INSTALL_PREFIX)/usr/lib/asterisk/modules
22INSTALL_SOUNDS := $(INSTALL_PREFIX)/usr/share/asterisk/sounds
23
24ASTERISK_INCLUDE_DIR ?= ../asterisk/include
25
26REVISION = $(shell svnversion -n .)
27
28# turn app_conference debugging on or off ( 0 == OFF, 1 == ON )
29APP_CONFERENCE_DEBUG ?= 0
30
31# 0 = OFF 1 = astdsp 2 = speex
32SILDET := 2
33
34#
35# app_conference objects to build
36#
37
38OBJS = app_conference.o conference.o member.o frame.o cli.o
39TARGET = app_conference.so
40
41
42#
43# standard compile settings
44#
45
46PROC = $(shell uname -m)
47INSTALL = install
48
49INCLUDE = -I$(ASTERISK_INCLUDE_DIR)
50DEBUG := -g
51
52CC = gcc
53
54CFLAGS = -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -MD -MP $(DEBUG)
55CPPFLAGS = $(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)
67CFLAGS += $(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
68CFLAGS += -fPIC
69CPPFLAGS += -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
77ifeq ($(APP_CONFERENCE_DEBUG), 1)
78CPPFLAGS += -DAPP_CONFERENCE_DEBUG
79endif
80
81#
82# additional flag values for silence detection
83#
84
85ifeq ($(SILDET), 2)
86OBJS += libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
87CPPFLAGS += -Ilibspeex -DSILDET=2
88endif
89
90ifeq ($(SILDET), 1)
91CPPFLAGS += -DSILDET=1
92endif
93
94OSARCH=$(shell uname -s)
95ifeq (${OSARCH},Darwin)
96SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
97else
98SOLINK=-shared -Xlinker -x
99endif
100
101DEPS += $(subst .o,.d,$(OBJS))
102
103#
104# targets
105#
106
107all: $(TARGET)
108
109.PHONY: clean
110clean:
111 $(RM) $(OBJS) $(DEPS)
112
113.PHONY: distclean
114distclean: clean
115 $(RM) $(TARGET)
116
117$(TARGET): $(OBJS)
118 $(CC) -pg $(SOLINK) -o $@ $(OBJS)
119
120vad_test: vad_test.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
121 $(CC) $(PROFILE) -o $@ $^ -lm
122
123install:
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