Makefile 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. include build.mak
  2. include build/host-$(HOST_NAME).mak
  3. -include user.mak
  4. include version.mak
  5. LIB_DIRS = pjlib/build pjlib-util/build pjnath/build third_party/build pjmedia/build pjsip/build
  6. DIRS = $(LIB_DIRS) pjsip-apps/build $(EXTRA_DIRS)
  7. ifdef MINSIZE
  8. MAKE_FLAGS := MINSIZE=1
  9. endif
  10. all clean dep depend print:
  11. for dir in $(DIRS); do \
  12. if $(MAKE) $(MAKE_FLAGS) -C $$dir $@; then \
  13. true; \
  14. else \
  15. exit 1; \
  16. fi; \
  17. done
  18. distclean realclean:
  19. for dir in $(DIRS); do \
  20. if $(MAKE) $(MAKE_FLAGS) -C $$dir $@; then \
  21. true; \
  22. else \
  23. exit 1; \
  24. fi; \
  25. done
  26. $(HOST_RM) config.log
  27. $(HOST_RM) config.status
  28. lib:
  29. for dir in $(LIB_DIRS); do \
  30. if $(MAKE) $(MAKE_FLAGS) -C $$dir lib; then \
  31. true; \
  32. else \
  33. exit 1; \
  34. fi; \
  35. done; \
  36. .PHONY: lib doc clean-doc
  37. doc:
  38. @if test \( ! "$(WWWDIR)" == "" \) -a \( ! -d $(WWWDIR)/pjlib/docs/html \) ; then \
  39. echo 'Directory "$(WWWDIR)" does not look like a valid pjsip web directory'; \
  40. exit 1; \
  41. fi
  42. for dir in $(DIRS); do \
  43. if $(MAKE) $(MAKE_FLAGS) -C $$dir $@; then \
  44. true; \
  45. else \
  46. exit 1; \
  47. fi; \
  48. done
  49. clean-doc:
  50. for dir in pjlib pjlib-util pjnath pjmedia pjsip; do \
  51. rm -rf $${dir}/docs/$${PJ_VERSION}; \
  52. done
  53. LIBS = pjlib/lib/libpj-$(TARGET_NAME).a \
  54. pjlib-util/lib/libpjlib-util-$(TARGET_NAME).a \
  55. pjnath/lib/libpjnath-$(TARGET_NAME).a \
  56. pjmedia/lib/libpjmedia-$(TARGET_NAME).a \
  57. pjmedia/lib/libpjmedia-audiodev-$(TARGET_NAME).a \
  58. pjmedia/lib/libpjmedia-codec-$(TARGET_NAME).a \
  59. pjsip/lib/libpjsip-$(TARGET_NAME).a \
  60. pjsip/lib/libpjsip-ua-$(TARGET_NAME).a \
  61. pjsip/lib/libpjsip-simple-$(TARGET_NAME).a \
  62. pjsip/lib/libpjsua-$(TARGET_NAME).a
  63. BINS = pjsip-apps/bin/pjsua-$(TARGET_NAME)$(HOST_EXE)
  64. size:
  65. @echo -n 'Date: '
  66. @date
  67. @echo
  68. @for lib in $(LIBS); do \
  69. echo "$$lib:"; \
  70. size -t $$lib | awk '{print $$1 "\t" $$2 "\t" $$3 "\t" $$6}'; \
  71. echo; \
  72. done
  73. @echo
  74. @for bin in $(BINS); do \
  75. echo "size $$bin:"; \
  76. size $$bin; \
  77. done
  78. #dos2unix:
  79. # for f in `find . | egrep '(mak|h|c|S|s|Makefile)$$'`; do \
  80. # dos2unix "$$f" > dos2unix.tmp; \
  81. # cp dos2unix.tmp "$$f"; \
  82. # done
  83. # rm -f dos2unix.tmp
  84. xhdrid:
  85. for f in `find . | egrep '\.(h|c|S|s|cpp|hpp)$$'`; do \
  86. echo Processing $$f...; \
  87. cat $$f | sed 's/.*\$$Author\$$/ */' > /tmp/id; \
  88. cp /tmp/id $$f; \
  89. done
  90. selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test
  91. pjlib-test: pjlib/bin/pjlib-test-$(TARGET_NAME)
  92. cd pjlib/build && ../bin/pjlib-test-$(TARGET_NAME)
  93. pjlib-test-ci: pjlib/bin/pjlib-test-$(TARGET_NAME)
  94. cd pjlib/build && ../bin/pjlib-test-$(TARGET_NAME) --ci-mode
  95. pjlib-util-test: pjlib-util/bin/pjlib-util-test-$(TARGET_NAME)
  96. cd pjlib-util/build && ../bin/pjlib-util-test-$(TARGET_NAME)
  97. pjnath-test: pjnath/bin/pjnath-test-$(TARGET_NAME)
  98. cd pjnath/build && ../bin/pjnath-test-$(TARGET_NAME)
  99. pjmedia-test: pjmedia/bin/pjmedia-test-$(TARGET_NAME)
  100. cd pjmedia/build && ../bin/pjmedia-test-$(TARGET_NAME)
  101. pjsip-test: pjsip/bin/pjsip-test-$(TARGET_NAME)
  102. cd pjsip/build && ../bin/pjsip-test-$(TARGET_NAME)
  103. pjsua-test: cmp_wav
  104. cd tests/pjsua && python runall.py -t 2
  105. cmp_wav:
  106. $(MAKE) -C tests/pjsua/tools
  107. fuzz:
  108. $(MAKE) -C tests/fuzz
  109. install:
  110. mkdir -p $(DESTDIR)$(libdir)/
  111. if [ "$(PJ_EXCLUDE_PJSUA2)x" = "x" ] ; then \
  112. cp -af $(APP_LIBXX_FILES) $(DESTDIR)$(libdir)/; \
  113. else \
  114. cp -af $(APP_LIB_FILES) $(DESTDIR)$(libdir)/; \
  115. fi
  116. mkdir -p $(DESTDIR)$(includedir)/
  117. for d in pjlib pjlib-util pjnath pjmedia pjsip; do \
  118. cp -RLf $$d/include/* $(DESTDIR)$(includedir)/; \
  119. done
  120. mkdir -p $(DESTDIR)$(libdir)/pkgconfig
  121. sed -e "s!@PREFIX@!$(prefix)!" libpjproject.pc.in | \
  122. sed -e "s!@INCLUDEDIR@!$(includedir)!" | \
  123. sed -e "s!@LIBDIR@!$(libdir)!" | \
  124. sed -e "s/@PJ_VERSION@/$(PJ_VERSION)/" | \
  125. sed -e "s!@PJ_INSTALL_LDFLAGS@!$(PJ_INSTALL_LDFLAGS)!" | \
  126. sed -e "s!@PJ_INSTALL_LDFLAGS_PRIVATE@!$(PJ_INSTALL_LDFLAGS_PRIVATE)!" | \
  127. sed -e "s!@PJ_INSTALL_CFLAGS@!$(PJ_INSTALL_CFLAGS)!" > $(DESTDIR)$(libdir)/pkgconfig/libpjproject.pc
  128. uninstall:
  129. $(RM) $(DESTDIR)$(libdir)/pkgconfig/libpjproject.pc
  130. rmdir $(DESTDIR)$(libdir)/pkgconfig 2> /dev/null || true
  131. for d in pjlib pjlib-util pjnath pjmedia pjsip; do \
  132. for f in $$d/include/*; do \
  133. $(RM) -r "$(DESTDIR)$(includedir)/`basename $$f`"; \
  134. done; \
  135. done
  136. rmdir $(DESTDIR)$(includedir) 2> /dev/null || true
  137. $(RM) $(addprefix $(DESTDIR)$(libdir)/,$(notdir $(APP_LIBXX_FILES)))
  138. rmdir $(DESTDIR)$(libdir) 2> /dev/null || true