Samples.mak 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. include ../../build.mak
  2. include ../../version.mak
  3. include ../../build/common.mak
  4. RULES_MAK := $(PJDIR)/build/rules.mak
  5. ###############################################################################
  6. # Gather all flags.
  7. #
  8. export _CFLAGS := $(PJ_CFLAGS) $(CFLAGS) $(PJ_VIDEO_CFLAGS)
  9. export _CXXFLAGS:= $(PJ_CXXFLAGS) $(CFLAGS) $(PJ_VIDEO_CFLAGS)
  10. export _LDFLAGS := $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS)
  11. export _LDXXFLAGS := $(PJ_LDXXFLAGS) $(PJ_LDXXLIBS) $(LDFLAGS)
  12. SRCDIR := ../src/samples
  13. OBJDIR := ./output/samples-$(TARGET_NAME)
  14. BINDIR := ../bin/samples/$(TARGET_NAME)
  15. SAMPLES := auddemo \
  16. aviplay \
  17. aectest \
  18. clidemo \
  19. confsample \
  20. encdec \
  21. httpdemo \
  22. icedemo \
  23. jbsim \
  24. latency \
  25. level \
  26. mix \
  27. pjsip-perf \
  28. pcaputil \
  29. playfile \
  30. playsine \
  31. recfile \
  32. resampleplay \
  33. simpleua \
  34. simple_pjsua \
  35. sipecho \
  36. siprtp \
  37. sipstateless \
  38. stateful_proxy \
  39. stateless_proxy \
  40. stereotest \
  41. streamutil \
  42. strerror \
  43. tonegen \
  44. vid_codec_test \
  45. vid_streamutil
  46. PJSUA2_SAMPLES := pjsua2_demo \
  47. pjsua2_hello_reg
  48. ifeq ($(EXCLUDE_APP),0)
  49. EXES := $(foreach file, $(SAMPLES), $(file)$(HOST_EXE))
  50. PJSUA2_EXES := $(foreach file, $(PJSUA2_SAMPLES), $(file)$(HOST_EXE))
  51. endif
  52. ifeq ($(PJ_EXCLUDE_PJSUA2),1)
  53. PJSUA2_EXES :=
  54. endif
  55. .PHONY: $(EXES)
  56. .PHONY: $(PJSUA2_EXES)
  57. all: $(EXES) $(PJSUA2_EXES)
  58. $(EXES):
  59. $(MAKE) --no-print-directory -f $(RULES_MAK) SAMPLE_SRCDIR=$(SRCDIR) SAMPLE_OBJS=$@.o SAMPLE_CFLAGS="$(_CFLAGS)" SAMPLE_CXXFLAGS="$(_CXXFLAGS)" SAMPLE_LDFLAGS="$(_LDFLAGS)" SAMPLE_EXE=$@ APP=SAMPLE app=sample $(subst /,$(HOST_PSEP),$(BINDIR)/$@)
  60. $(PJSUA2_EXES):
  61. $(MAKE) --no-print-directory -f $(RULES_MAK) PJSUA2_SAMPLE_SRCDIR=$(SRCDIR) PJSUA2_SAMPLE_OBJS=$@.o PJSUA2_SAMPLE_CFLAGS="$(_CFLAGS)" PJSUA2_SAMPLE_CXXFLAGS="$(_CXXFLAGS)" PJSUA2_SAMPLE_LDFLAGS="$(_LDXXFLAGS)" PJSUA2_SAMPLE_EXE=$@ APP=PJSUA2_SAMPLE app=pjsua2_sample $(subst /,$(HOST_PSEP),$(BINDIR)/$@)
  62. depend:
  63. clean:
  64. $(MAKE) -f $(RULES_MAK) APP=SAMPLE app=sample $@
  65. $(MAKE) -f $(RULES_MAK) APP=PJSUA2_SAMPLE app=pjsua2_sample $@
  66. $(subst @@,$(EXES),$(HOST_RM))
  67. $(subst @@,$(BINDIR),$(HOST_RMDIR))
  68. distclean realclean: clean
  69. $(MAKE) -f $(RULES_MAK) APP=SAMPLE app=sample $@