droid-makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. APP := lib$(PROJECT)_$(MARCH).$(EXT)
  2. CFLAGS := $(CFLAGS_LIB) -fno-rtti -fno-exceptions -I../../_common -I../../. -I../../../tinySAK/src -I../../../tinyNET/src -I../../../tinyHTTP/include -I../../../tinyXCAP/include \
  3. -I../../../tinySMS/include -I../../../tinySDP/include -I../../../tinyMEDIA/include -I../../../tinyMSRP/include -I../../../tinyDAV/include -I../../../tinySIP/include
  4. # Because of the static build, we need all librarires
  5. THIRDPARTIES_LIB := ../../../thirdparties/android/lib
  6. THIRDPARTIES_MARCH_LIB := ../../../thirdparties/android/lib/$(MARCH)
  7. ##########
  8. # Before starting to set parmeters we will override those provided by the user
  9. #
  10. ifeq ($(LICENSE),lgpl)
  11. H264 := no
  12. endif
  13. ##########
  14. # Set LD and CFLAGS according to the user parameters
  15. #
  16. ifneq ($(FFMPEG), no)
  17. FFMPEG_LDFLAGS := -lavutil-$(LICENSE) -lswscale-$(LICENSE) -lavcore-$(LICENSE) -lavcodec-$(LICENSE)
  18. ifneq ($(H264),no)
  19. FFMPEG_LDFLAGS := $(FFMPEG_LDFLAGS) -lx264
  20. endif
  21. ifneq ($(THEORA),no)
  22. FFMPEG_LDFLAGS := $(FFMPEG_LDFLAGS) -ltheora -logg
  23. endif
  24. endif
  25. ifneq ($(LIBYUV),no)
  26. LIBYUV_LDLAGS := -lyuv_$(MARCH)
  27. endif
  28. ifeq ($(VPX),yes)
  29. VPX_LDLAGS := -lvpx_$(MARCH)
  30. endif
  31. ifneq ($(OPUS), no)
  32. OPUS_LDFLAGS := -lopus
  33. endif
  34. ifneq ($(OPENCORE_AMR), no)
  35. OPENCORE_ARM_LDFLAGS := -lopencore-amrnb
  36. endif
  37. ifeq ($(SPEEX_DSP), yes)
  38. SPEEX_DSP_LDFLAGS := -lspeexdsp
  39. endif
  40. ifeq ($(SPEEX), yes)
  41. SPEEX_LDFLAGS := -lspeex
  42. endif
  43. ifeq ($(WEBRTC), yes)
  44. WEBRTC_LDFLAGS := -lwebrtc_aec_$(MARCH) -lwebrtc_spl_$(MARCH) -lwebrtc_apm_utility_$(MARCH) -lwebrtc_nsx_$(MARCH) -lwebrtc_system_wrappers_$(MARCH)
  45. endif
  46. ifeq ($(ILBC), yes)
  47. ILBC_LDFLAGS := -liLBC
  48. endif
  49. ifneq ($(LIBGSM),no)
  50. LIBGSM_LDFLAGS := -lgsm
  51. endif
  52. #BV16_LDFLAGS := -lbv16
  53. ifeq ($(G729), yes)
  54. G729_LDFLAGS := -lg729b_$(MARCH)
  55. # Reset all other ITU CODECS
  56. OPENCORE_ARM_LDFLAGS :=
  57. BV16_LDFLAGS :=
  58. else
  59. G729_LDFLAGS :=
  60. endif
  61. ifneq ($(SRTP),no)
  62. LIBSRTP_LDFLAGS := -lsrtp
  63. endif
  64. ifneq ($(TLS), no)
  65. TLS_LDFLAGS := -lssl_$(MARCH) -lcrypto_$(MARCH)
  66. endif
  67. ifeq ($(LT),shared)
  68. _LT=Bdynamic
  69. else
  70. _LT=Bstatic
  71. endif
  72. LDFLAGS := $(LDFLAGS_LIB) -L$(THIRDPARTIES_LIB) -L$(THIRDPARTIES_MARCH_LIB) $(FFMPEG_LDFLAGS) $(LIBYUV_LDLAGS) $(VPX_LDLAGS) $(WEBRTC_LDFLAGS) $(SPEEX_DSP_LDFLAGS) $(SPEEX_LDFLAGS) $(OPUS_LDFLAGS) $(OPENCORE_ARM_LDFLAGS) $(BV16_LDFLAGS) $(ILBC_LDFLAGS) $(LIBGSM_LDFLAGS) $(G729_LDFLAGS) \
  73. $(LIBSRTP_LDFLAGS) $(TLS_LDFLAGS) \
  74. -Wl,-Bdynamic -lm -lstdc++ -lgnustl_static -lgcc -llog -ldl \
  75. -Wl,-$(_LT) -ltinySAK_$(MARCH) -ltinyHTTP_$(MARCH) -ltinyXCAP_$(MARCH) -ltinyIPSec_$(MARCH) -ltinySIGCOMP_$(MARCH) -ltinySMS_$(MARCH) -ltinyNET_$(MARCH) -ltinySDP_$(MARCH) -ltinyRTP_$(MARCH) -ltinyMEDIA_$(MARCH) -ltinyMSRP_$(MARCH) -ltinyDAV_$(MARCH) -ltinySIP_$(MARCH)
  76. all: $(APP)
  77. OBJS = tinyWRAP_wrap.o\
  78. ../../_common/ActionConfig.o \
  79. ../../_common/AudioResampler.o \
  80. ../../_common/DDebug.o \
  81. ../../_common/MediaContent.o \
  82. ../../_common/MediaSessionMgr.o \
  83. ../../_common/Msrp.o \
  84. ../../_common/ProxyConsumer.o \
  85. ../../_common/ProxyPluginMgr.o \
  86. ../../_common/ProxyProducer.o \
  87. ../../_common/SafeObject.o \
  88. ../../_common/SipCallback.o \
  89. ../../_common/SipEvent.o \
  90. ../../_common/SipMessage.o \
  91. ../../_common/SipSession.o \
  92. ../../_common/SipStack.o \
  93. ../../_common/SipUri.o \
  94. ../../_common/SMSEncoder.o \
  95. ../../_common/Xcap.o
  96. $(APP): $(OBJS)
  97. ifeq ($(EXT), a)
  98. $(AR) rcs $@ $^
  99. else
  100. $(CC) $(LDFLAGS) -o $@ $^
  101. endif
  102. %.o: %.cxx
  103. $(CPP) -c $(INCLUDE) $(CFLAGS) $< -o $@
  104. install: $(APP)
  105. $(ANDROID_SDK_ROOT)/tools/adb remount
  106. $(ANDROID_SDK_ROOT)/tools/adb push $(APP) $(LIB_DIR)/$(APP)
  107. $(ANDROID_SDK_ROOT)/tools/adb shell chmod 777 $(LIB_DIR)/$(APP)
  108. shell:
  109. $(ANDROID_SDK_ROOT)/tools/adb shell
  110. run:
  111. $(ANDROID_SDK_ROOT)/tools/adb shell $(LIB_DIR)/$(APP)
  112. clean:
  113. @rm -f $(OBJS) $(APP)