Fix some symbol and Makefile issues
[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 CFLAGS += -DNDEBUG -DDO_CRASH -DDEBUG_THREADS
20 CFLAGS  = -pipe -Wall -fPIC -Wmissing-prototypes -Wmissing-declarations 
21 CFLAGS += -DP_LINUX  -D_REENTRANT -D_GNU_SOURCE
22 # This needs to be updated to deal with more than just little endian machines
23 CFLAGS += -march=$(shell uname -m) -DPBYTE_ORDER=PLITTLE_ENDIAN
24 CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
25 CFLAGS += -DPHAS_TEMPLATES -DPTRACING -DP_USE_PRAGMA 
26 CFLAGS += -I$(PWLIBDIR)/include/ptlib/unix -I$(PWLIBDIR)/include 
27 CFLAGS += -I$(OPENH323DIR)/include -Wno-missing-prototypes -Wno-missing-declarations
28
29
30 all: chan_h323.so
31
32 noshared: chan_h323_s.so
33 optnoshared: chan_h323_s.so
34 debug:  chan_h323_d.so
35
36
37 install: all
38         install -m 755 chan_h323.so $(ASTERISKDIR)
39         @echo " +----- chan_h323 Installation Complete ----- +"
40         @echo " +                                            +"
41         @echo " + chan_h323 has successfully been installed. +"
42         @echo " + If you would like to install the sample    +"
43         @echo " + configuration file (overwriting existing   +"
44         @echo " + config file), run:                         +"
45         @echo " +                                            +"
46         @echo " +               $(MAKE) samples                 +"
47         @echo " +                                            +"
48         @echo " +                                            +"
49  
50
51 samples: 
52         if [ -f $(ASTETCDIR)/h323.conf ]; then \
53                 mv -f $(ASTETCDIR)/h323.conf $(ASTETCDIR)/h323.conf.old ; \
54         fi ; 
55         install h323.conf.sample $(ASTETCDIR)/h323.conf
56  
57
58 chan_h323.o:    chan_h323.c
59         $(CC) -g -c -o $@ $(CFLAGS) $<
60 ast_h323.o:     ast_h323.cpp
61         g++ -g -c -o $@ $(CFLAGS) $<
62
63 chan_h323.so:   chan_h323.o ast_h323.o
64         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
65
66 chan_h323_d.so: chan_h323.o ast_h323.o
67         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
68
69 chan_h323_s.so: chan_h323.o ast_h323.o
70         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
71 clean:
72         rm -f *.o *.so core.*
73
74