ef52b4d8f9f777e6870057875e64a3421785f5bc
[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 #
39 # Janus release directives, comment below if your brave enough for Janus
40 OSARCH=$(shell uname -s)
41 CFLAGS += -DNDEBUG -DDO_CRASH -DDEBUG_THREADS
42 CFLAGS += -pipe -Wall -fPIC -Wmissing-prototypes -Wmissing-declarations 
43 CFLAGS += -D_REENTRANT -D_GNU_SOURCE
44 CFLAGS += -I../../include
45 CFLAGS += -I$(PWLIBDIR)/include 
46 CFLAGS += -I$(OPENH323DIR)/include -Wno-missing-prototypes -Wno-missing-declarations
47
48 # Pre Janus release directives
49 #CFLAGS += -DNDEBUG -DDO_CRASH -DDEBUG_THREADS
50 #CFLAGS += -pipe -Wall -fPIC
51 #ifeq (${OSARCH},Linux)
52 #CFLAGS += -DP_LINUX
53 #LIBS+=-lpthread
54 #endif
55 #ifeq ($(findstring BSD,${OSARCH}),BSD)
56 #CFLAGS += -pthread
57 #endif
58 #CFLAGS += -D_REENTRANT -D_GNU_SOURCE
59 #CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
60 #CFLAGS += -DPHAS_TEMPLATES -DPTRACING -DP_USE_PRAGMA
61 #CFLAGS += -I../../include
62 #CFLAGS += -I$(PWLIBDIR)/include/ptlib/unix -I$(PWLIBDIR)/include
63 #CFLAGS += -I$(OPENH323DIR)/include
64 #CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations
65 #LIBS+= -lcrypto -lssl -lexpat
66
67 all:    libchanh323.a
68
69 samples: 
70         if [ -f $(ASTETCDIR)/h323.conf ]; then \
71                 mv -f $(ASTETCDIR)/h323.conf $(ASTETCDIR)/h323.conf.old ; \
72         fi ; 
73         install h323.conf.sample $(ASTETCDIR)/h323.conf
74  
75
76 ast_h323.o:     ast_h323.cpp
77         $(CXX) -g -c -o $@ $(CFLAGS) $<
78
79 #ast_h323.o:    ast_h323.cpp
80 #       $(CXX) -g -c -fno-rtti -o $@ $(CFLAGS) $<
81
82
83 libchanh323.a:  ast_h323.o
84         ar cr libchanh323.a ast_h323.o
85
86 chan_h323.so:   
87         $(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)
88
89 chan_h323_d.so: chan_h323.o ast_h323.o
90         $(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)
91
92 chan_h323_s.so: chan_h323.o ast_h323.o
93         $(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)
94 clean:
95         rm -f *.o *.so core.* libchanh323.a
96
97