droid-makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. APP := lib$(PROJECT)_$(MARCH).$(EXT)
  2. THIRDPARTIES_INC := ../../thirdparties/android/include
  3. THIRDPARTIES_INC_COMMON := ../../thirdparties/common/include
  4. THIRDPARTIES_LIB := ../../thirdparties/android/lib
  5. THIRDPARTIES_MARCH_LIB := ../../thirdparties/android/lib/$(MARCH)
  6. DOUBANGO_LIB := ../../android-projects/output
  7. WEBRTC_CFLAGS := -DHAVE_WEBRTC=1
  8. WEBRTC_LDFLAGS := -lwebrtc_spl_$(MARCH) -lwebrtc_audio_device_$(MARCH) -lwebrtc_system_wrappers_$(MARCH)
  9. ################################
  10. CFLAGS := $(CFLAGS_LIB) -I$(THIRDPARTIES_INC) -I$(THIRDPARTIES_INC_COMMON) \
  11. -I../../tinySAK/src -I../../tinyMEDIA/include -I../../tinySDP/include -I../../tinyRTP/include -I../../tinyDAV/include
  12. LDFLAGS := $(LDFLAGS_LIB) -L$(THIRDPARTIES_LIB) -L$(THIRDPARTIES_LIB)/android-9 -L$(THIRDPARTIES_MARCH_LIB) -L$(DOUBANGO_LIB) \
  13. -ltinySAK_$(MARCH) -ltinyMEDIA_$(MARCH) -ltinySDP_$(MARCH) $(WEBRTC_LDFLAGS) -lm -ldl -llog -lgcc -lstdc++ -lOpenSLES -lgnustl_static
  14. all: $(APP)
  15. OBJS = \
  16. audio_webrtc.o \
  17. audio_webrtc_consumer.o \
  18. audio_webrtc_producer.o \
  19. audio_webrtc_transport.o \
  20. ../../tinyDAV/src/audio/tdav_consumer_audio.o \
  21. ../../tinyDAV/src/audio/tdav_producer_audio.o \
  22. $(APP): $(OBJS)
  23. ifeq ($(EXT), a)
  24. $(AR) rcs $@ $^
  25. else
  26. $(CC) $(LDFLAGS) -o $@ $^
  27. endif
  28. %.o: %.c
  29. $(CC) -c $(INCLUDE) $(CFLAGS) $< -o $@
  30. %.o: %.cxx
  31. $(CPP) -c $(INCLUDE) $(CFLAGS) $< -o $@
  32. install: $(APP)
  33. $(ANDROID_SDK_ROOT)/tools/adb remount
  34. $(ANDROID_SDK_ROOT)/tools/adb push $(APP) $(LIB_DIR)/$(APP)
  35. $(ANDROID_SDK_ROOT)/tools/adb shell chmod 777 $(LIB_DIR)/$(APP)
  36. clean:
  37. @rm -f $(OBJS) $(APP)