Samples-vc.mak 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. LIBEXT = .lib
  2. !if "$(ARCH)" == "win64"
  3. TARGET = x86_64-x64-vc$(VC_VER)-$(BUILD_MODE)
  4. TARGET_FLAGS = /DPJ_WIN64=1 /DPJ_M_X86_64=1
  5. !elseif "$(ARCH)" == "win32"
  6. TARGET = i386-win32-vc$(VC_VER)-$(BUILD_MODE)
  7. TARGET_FLAGS = /DPJ_WIN32=1 /DPJ_M_I386=1
  8. !elseif "$(ARCH)" == "ARM64"
  9. TARGET = ARM64-ARM64-vc$(VC_VER)-$(BUILD_MODE)
  10. !endif
  11. !if "$(BUILD_MODE)" == "debug"
  12. BUILD_FLAGS = /MTd /Od /Zi /W4
  13. !elseif "$(BUILD_MODE)" == "debug-static"
  14. BUILD_FLAGS = /MTd /Od /Zi /W4
  15. !elseif "$(BUILD_MODE)" == "debug-dynamic"
  16. BUILD_FLAGS = /MDd /Od /Zi /W4
  17. !elseif "$(BUILD_MODE)" == "release-static"
  18. BUILD_FLAGS = /Ox /MT /DNDEBUG /W4
  19. !else
  20. BUILD_FLAGS = /Ox /MD /DNDEBUG /W4
  21. !endif
  22. PJLIB_LIB = ..\..\pjlib\lib\pjlib-$(TARGET)$(LIBEXT)
  23. PJLIB_UTIL_LIB = ..\..\pjlib-util\lib\pjlib-util-$(TARGET)$(LIBEXT)
  24. PJNATH_LIB = ..\..\pjnath\lib\pjnath-$(TARGET)$(LIBEXT)
  25. PJMEDIA_LIB = ..\..\pjmedia\lib\pjmedia-$(TARGET)$(LIBEXT)
  26. PJMEDIA_CODEC_LIB = ..\..\pjmedia\lib\pjmedia-codec-$(TARGET)$(LIBEXT)
  27. PJMEDIA_AUDIODEV_LIB = ..\..\pjmedia\lib\pjmedia-audiodev-$(TARGET)$(LIBEXT)
  28. PJMEDIA_VIDEODEV_LIB = ..\..\pjmedia\lib\pjmedia-videodev-$(TARGET)$(LIBEXT)
  29. PJSIP_LIB = ..\..\pjsip\lib\pjsip-core-$(TARGET)$(LIBEXT)
  30. PJSIP_UA_LIB = ..\..\pjsip\lib\pjsip-ua-$(TARGET)$(LIBEXT)
  31. PJSIP_SIMPLE_LIB = ..\..\pjsip\lib\pjsip-simple-$(TARGET)$(LIBEXT)
  32. PJSUA_LIB_LIB = ..\..\pjsip\lib\pjsua-lib-$(TARGET)$(LIBEXT)
  33. GSM_LIB = ..\..\third_party\lib\libgsmcodec-$(TARGET)$(LIBEXT)
  34. ILBC_LIB = ..\..\third_party\lib\libilbccodec-$(TARGET)$(LIBEXT)
  35. #PORTAUDIO_LIB = ..\..\third_party\lib\libportaudio-$(TARGET)$(LIBEXT)
  36. RESAMPLE_LIB = ..\..\third_party\lib\libresample-$(TARGET)$(LIBEXT)
  37. SPEEX_LIB = ..\..\third_party\lib\libspeex-$(TARGET)$(LIBEXT)
  38. SRTP_LIB = ..\..\third_party\lib\libsrtp-$(TARGET)$(LIBEXT)
  39. G7221_LIB = ..\..\third_party\lib\libg7221codec-$(TARGET)$(LIBEXT)
  40. BASECLASSES_LIB = ..\..\third_party\lib\libbaseclasses-$(TARGET)$(LIBEXT)
  41. YUV_LIB = ..\..\third_party\lib\libyuv-$(TARGET)$(LIBEXT)
  42. WEBRTC_LIB = ..\..\third_party\lib\libwebrtc-$(TARGET)$(LIBEXT)
  43. THIRD_PARTY_LIBS = $(GSM_LIB) $(ILBC_LIB) $(RESAMPLE_LIB) \
  44. $(SPEEX_LIB) $(SRTP_LIB) $(G7221_LIB) $(BASECLASSES_LIB) \
  45. $(YUV_LIB) $(WEBRTC_LIB)
  46. LIBS = $(PJSUA_LIB_LIB) $(PJSIP_UA_LIB) $(PJSIP_SIMPLE_LIB) \
  47. $(PJSIP_LIB) $(PJMEDIA_CODEC_LIB) $(PJMEDIA_AUDIODEV_LIB) \
  48. $(PJMEDIA_VIDEODEV_LIB) \
  49. $(PJMEDIA_LIB) $(PJNATH_LIB) $(PJLIB_UTIL_LIB) $(PJLIB_LIB) \
  50. $(THIRD_PARTY_LIBS)
  51. CFLAGS = $(TARGET_FLAGS) \
  52. $(BUILD_FLAGS) \
  53. -I..\..\pjsip\include \
  54. -I..\..\pjlib\include \
  55. -I..\..\pjlib-util\include \
  56. -I..\..\pjmedia\include \
  57. -I..\..\pjnath/include
  58. LDFLAGS = $(BUILD_FLAGS) $(LIBS) \
  59. Iphlpapi.lib ole32.lib user32.lib dsound.lib dxguid.lib netapi32.lib \
  60. mswsock.lib ws2_32.lib gdi32.lib advapi32.lib oleaut32.lib
  61. SRCDIR = ..\src\samples
  62. OBJDIR = .\output\samples-$(TARGET)
  63. BINDIR = ..\bin\samples\$(TARGET)
  64. SAMPLES = $(BINDIR)\auddemo.exe \
  65. $(BINDIR)\aectest.exe \
  66. $(BINDIR)\aviplay.exe \
  67. $(BINDIR)\clidemo.exe \
  68. $(BINDIR)\confsample.exe \
  69. $(BINDIR)\confbench.exe \
  70. $(BINDIR)\encdec.exe \
  71. $(BINDIR)\httpdemo.exe \
  72. $(BINDIR)\icedemo.exe \
  73. $(BINDIR)\jbsim.exe \
  74. $(BINDIR)\latency.exe \
  75. $(BINDIR)\level.exe \
  76. $(BINDIR)\mix.exe \
  77. $(BINDIR)\pcaputil.exe\
  78. $(BINDIR)\pjsip-perf.exe \
  79. $(BINDIR)\playfile.exe \
  80. $(BINDIR)\playsine.exe\
  81. $(BINDIR)\recfile.exe \
  82. $(BINDIR)\resampleplay.exe \
  83. $(BINDIR)\simpleua.exe \
  84. $(BINDIR)\simple_pjsua.exe \
  85. $(BINDIR)\sipecho.exe \
  86. $(BINDIR)\siprtp.exe \
  87. $(BINDIR)\sipstateless.exe \
  88. $(BINDIR)\stateful_proxy.exe \
  89. $(BINDIR)\stateless_proxy.exe \
  90. $(BINDIR)\stereotest.exe \
  91. $(BINDIR)\streamutil.exe \
  92. $(BINDIR)\strerror.exe \
  93. $(BINDIR)\tonegen.exe \
  94. $(BINDIR)\vid_streamutil.exe
  95. all: $(BINDIR) $(OBJDIR) $(SAMPLES)
  96. $(SAMPLES): $(SRCDIR)\$(@B).c $(LIBS) $(SRCDIR)\util.h Samples-vc.mak
  97. cl -nologo -c $(SRCDIR)\$(@B).c /Fo$(OBJDIR)\$(@B).obj $(CFLAGS)
  98. cl /nologo $(OBJDIR)\$(@B).obj /Fe$@ /Fm$(OBJDIR)\$(@B).map $(LDFLAGS)
  99. @rem the following two lines is just for cleaning up the 'bin' directory
  100. if exist $(BINDIR)\*.ilk del /Q $(BINDIR)\*.ilk
  101. if exist $(BINDIR)\*.pdb del /Q $(BINDIR)\*.pdb
  102. $(BINDIR):
  103. if not exist $(BINDIR) mkdir $(BINDIR)
  104. $(OBJDIR):
  105. if not exist $(OBJDIR) mkdir $(OBJDIR)
  106. clean:
  107. echo Cleaning up samples...
  108. if exist $(BINDIR) del /Q $(BINDIR)\*
  109. if exist $(BINDIR) rmdir $(BINDIR)
  110. if exist $(OBJDIR) del /Q $(OBJDIR)\*.*