droid-makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. APP := lib$(PROJECT)_$(MARCH).$(EXT)
  2. THIRDPARTIES_INC := ../thirdparties/android/include
  3. THIRDPARTIES_LIB := ../thirdparties/android/lib
  4. # TLS (Default: enabled)
  5. ifeq ($(TLS), no)
  6. TLS_CFLAGS := -DHAVE_OPENSSL=0
  7. TLS_LDFLAGS :=
  8. else
  9. TLS_CFLAGS := -DHAVE_OPENSSL=1
  10. TLS_LDFLAGS := -lssl_$(MARCH) -lcrypto_$(MARCH)
  11. endif
  12. CFLAGS := $(CFLAGS_LIB) $(TLS_CFLAGS) -I$(THIRDPARTIES_INC) -I../tinySAK/src -I./src
  13. LDFLAGS := $(LDFLAGS_LIB) $(TLS_LDFLAGS) -L$(THIRDPARTIES_LIB) -ltinySAK_$(MARCH)
  14. all: $(APP)
  15. OBJS = \
  16. src/tnet.o\
  17. src/tnet_auth.o\
  18. src/tnet_endianness.o\
  19. src/tnet_nat.o\
  20. src/tnet_poll.o\
  21. src/tnet_socket.o\
  22. src/tnet_transport.o\
  23. src/tnet_transport_poll.o\
  24. src/tnet_utils.o
  25. ###################
  26. ## DHCP
  27. ###################
  28. OBJS += src/dhcp/tnet_dhcp.o\
  29. src/dhcp/tnet_dhcp_message.o\
  30. src/dhcp/tnet_dhcp_option.o\
  31. src/dhcp/tnet_dhcp_option_sip.o
  32. ###################
  33. ## DHCPv6
  34. ###################
  35. OBJS += src/dhcp6/tnet_dhcp6.o\
  36. src/dhcp6/tnet_dhcp6_duid.o\
  37. src/dhcp6/tnet_dhcp6_message.o\
  38. src/dhcp6/tnet_dhcp6_option.o
  39. ###################
  40. ## DNS
  41. ###################
  42. OBJS += src/dns/tnet_dns.o\
  43. src/dns/tnet_dns_a.o\
  44. src/dns/tnet_dns_aaaa.o\
  45. src/dns/tnet_dns_cname.o\
  46. src/dns/tnet_dns_message.o\
  47. src/dns/tnet_dns_mx.o\
  48. src/dns/tnet_dns_naptr.o\
  49. src/dns/tnet_dns_ns.o\
  50. src/dns/tnet_dns_opt.o\
  51. src/dns/tnet_dns_ptr.o\
  52. src/dns/tnet_dns_regexp.o\
  53. src/dns/tnet_dns_resolvconf.o\
  54. src/dns/tnet_dns_rr.o\
  55. src/dns/tnet_dns_soa.o\
  56. src/dns/tnet_dns_srv.o\
  57. src/dns/tnet_dns_txt.o
  58. ###################
  59. ## ICE
  60. ###################
  61. OBJS += src/ice/tnet_ice_candidate.o \
  62. src/ice/tnet_ice_ctx.o \
  63. src/ice/tnet_ice_event.o \
  64. src/ice/tnet_ice_pair.o \
  65. src/ice/tnet_ice_utils.o
  66. ###################
  67. ## STUN
  68. ###################
  69. OBJS += src/stun/tnet_stun.o\
  70. src/stun/tnet_stun_attribute.o\
  71. src/stun/tnet_stun_message.o
  72. ###################
  73. ## TLS / DTLS
  74. ###################
  75. OBJS += src/tls/tnet_tls.o\
  76. src/tls/tnet_dtls.o
  77. ###################
  78. ## TURN
  79. ###################
  80. OBJS += src/turn/tnet_turn.o\
  81. src/turn/tnet_turn_attribute.o\
  82. src/turn/tnet_turn_message.o
  83. $(APP): $(OBJS)
  84. ifeq ($(EXT), a)
  85. $(AR) rcs $@ $^
  86. else
  87. $(CC) $(LDFLAGS) -o $@ $^
  88. endif
  89. %.o: %.c
  90. $(CC) -c $(INCLUDE) $(CFLAGS) $< -o $@
  91. install: $(APP)
  92. $(ANDROID_SDK_ROOT)/tools/adb remount
  93. $(ANDROID_SDK_ROOT)/tools/adb push $(APP) $(LIB_DIR)/$(APP)
  94. $(ANDROID_SDK_ROOT)/tools/adb shell chmod 777 $(LIB_DIR)/$(APP)
  95. clean:
  96. @rm -f $(OBJS) $(APP)