Add depend support for H.323 (bug #2757)
[asterisk/asterisk.git] / channels / h323 / Makefile
1 # include the Makefile of OpenH323 
2
3 ifndef OPENH323DIR
4 OPENH323DIR=$(HOME)/openh323
5 endif
6
7 ifndef PWLIBDIR
8 PWLIBDIR=$(HOME)/pwlib
9 endif
10
11 ifndef ASTERISKDIR
12 ASTERISKDIR= /usr/lib/asterisk/modules
13 endif
14
15 ifndef ASTETCDIR
16 ASTETCDIR=/etc/asterisk
17 endif
18
19 #
20 # This needs to be updated to deal with more than just little endian machines
21 #
22 OSARCH=$(shell uname -s)
23 ifneq (${OSARCH},FreeBSD)
24 ifneq (${OSARCH},NetBSD)
25 CFLAGS += -march=$(shell uname -m)
26 endif
27 endif
28 CFLAGS += -DPBYTE_ORDER=PLITTLE_ENDIAN
29
30 ifeq (${OSARCH},Linux)
31 LDLIBS+=-ldl
32 endif
33
34 #############################################
35 #
36 # Only change below if you know WTF your doing
37 #
38 OSARCH=$(shell uname -s)
39 CFLAGS += -DNDEBUG -DDO_CRASH -DDEBUG_THREADS
40 CFLAGS += -pipe -Wall -fPIC -Wmissing-prototypes -Wmissing-declarations 
41 CFLAGS += -D_REENTRANT -D_GNU_SOURCE
42 CFLAGS += -I../../include
43 CFLAGS += -I$(PWLIBDIR)/include 
44 CFLAGS += -I$(OPENH323DIR)/include -Wno-missing-prototypes -Wno-missing-declarations
45
46 all:    depend libchanh323.a
47
48 samples: 
49         if [ -f $(ASTETCDIR)/h323.conf ]; then \
50                 mv -f $(ASTETCDIR)/h323.conf $(ASTETCDIR)/h323.conf.old ; \
51         fi ; 
52         install h323.conf.sample $(ASTETCDIR)/h323.conf
53  
54
55 libchanh323.a:  ast_h323.o
56         ar cr libchanh323.a ast_h323.o
57
58 ast_h323.o:     ast_h323.cpp
59         $(CXX) -g -c -o $@ $(CFLAGS) $<
60
61 ifneq ($(wildcard .depend),)
62 include .depend
63 endif
64
65 chan_h323.so:   
66         $(CXX)  -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib  -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib $(CHANH323LIB)
67
68 chan_h323_d.so: chan_h323.o ast_h323.o
69         $(CXX)     -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib  -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib $(CHANH323LIB)
70
71 chan_h323_s.so: chan_h323.o ast_h323.o
72         $(CXX)  -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib  -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib $(CHANH323LIB)
73 clean:
74         rm -f *.o *.so core.* libchanh323.a .depend
75
76 depend: .depend
77
78 .depend:
79         ../../mkdep $(CFLAGS) `ls *.cpp`
80
81