56cd61974fcf16378eaab65b4a3505ab5efbded5
[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 CFLAGS += -march=$(shell uname -m) -DPBYTE_ORDER=PLITTLE_ENDIAN
23
24
25 #############################################
26 #
27 # Only change below if you know WTF your doing
28 #
29 #
30 # Janus release directives, comment below if your brave enough for Janus
31 #OSARCH=$(shell uname -s)
32 #CFLAGS += -DNDEBUG -DDO_CRASH -DDEBUG_THREADS
33 #CFLAGS += -pipe -Wall -fPIC -Wmissing-prototypes -Wmissing-declarations 
34 #CFLAGS += -D_REENTRANT -D_GNU_SOURCE
35 #CFLAGS += -I../../include
36 #CFLAGS += -I$(PWLIBDIR)/include 
37 #CFLAGS += -I$(OPENH323DIR)/include -Wno-missing-prototypes -Wno-missing-declarations
38
39 # Pre Janus release directives
40 CFLAGS += -DNDEBUG -DDO_CRASH -DDEBUG_THREADS
41 CFLAGS += -pipe -Wall -fPIC -Wmissing-prototypes -Wmissing-declarations
42 ifeq (${OSARCH},Linux)
43 CFLAGS += -DP_LINUX
44 endif
45 CFLAGS += -D_REENTRANT -D_GNU_SOURCE
46 CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
47 CFLAGS += -DPHAS_TEMPLATES -DPTRACING -DP_USE_PRAGMA
48 CFLAGS += -I../../include
49 CFLAGS += -I$(PWLIBDIR)/include/ptlib/unix -I$(PWLIBDIR)/include
50 CFLAGS += -I$(OPENH323DIR)/include -Wno-missing-prototypes -Wno-missing-declarations
51
52 all:    libchanh323.a
53
54 samples: 
55         if [ -f $(ASTETCDIR)/h323.conf ]; then \
56                 mv -f $(ASTETCDIR)/h323.conf $(ASTETCDIR)/h323.conf.old ; \
57         fi ; 
58         install h323.conf.sample $(ASTETCDIR)/h323.conf
59  
60
61 ast_h323.o:     ast_h323.cpp
62         g++ -g -c -fno-rtti -o $@ $(CFLAGS) $<
63
64 libchanh323.a:  ast_h323.o
65         ar cr libchanh323.a ast_h323.o
66
67 chan_h323.so:   
68         g++  -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 -lpthread -ldl -lcrypto -lssl -lexpat
69
70 chan_h323_d.so: chan_h323.o ast_h323.o
71         g++  -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 -lpthread -ldl -lcrypto -lssl -lexpat
72
73 chan_h323_s.so: chan_h323.o ast_h323.o
74         g++  -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 -lpthread -ldl -lcrypto -lssl -lexpat
75 clean:
76         rm -f *.o *.so core.* libchanh323.a
77
78