Makefile 2.7 KB

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