doubango/tinyNET/droid-makefile
175b478c
 APP := lib$(PROJECT)_$(MARCH).$(EXT)
 
 THIRDPARTIES_INC := ../thirdparties/android/include
 THIRDPARTIES_LIB := ../thirdparties/android/lib
 
 # TLS (Default: enabled)
 ifeq ($(TLS), no)
 	TLS_CFLAGS := -DHAVE_OPENSSL=0
 	TLS_LDFLAGS :=
 else
 	TLS_CFLAGS := -DHAVE_OPENSSL=1
 	TLS_LDFLAGS := -lssl_$(MARCH) -lcrypto_$(MARCH)
 endif
 
 CFLAGS := $(CFLAGS_LIB) $(TLS_CFLAGS) -I$(THIRDPARTIES_INC) -I../tinySAK/src -I./src
 LDFLAGS := $(LDFLAGS_LIB) $(TLS_LDFLAGS) -L$(THIRDPARTIES_LIB) -ltinySAK_$(MARCH)
 
 all: $(APP)
 
 OBJS = \
 	src/tnet.o\
 	src/tnet_auth.o\
 	src/tnet_endianness.o\
 	src/tnet_nat.o\
 	src/tnet_poll.o\
 	src/tnet_socket.o\
 	src/tnet_transport.o\
 	src/tnet_transport_poll.o\
 	src/tnet_utils.o
 	###################
 	## DHCP
 	###################
 OBJS +=	src/dhcp/tnet_dhcp.o\
 	src/dhcp/tnet_dhcp_message.o\
 	src/dhcp/tnet_dhcp_option.o\
 	src/dhcp/tnet_dhcp_option_sip.o
 	###################
 	## DHCPv6
 	###################
 OBJS +=	src/dhcp6/tnet_dhcp6.o\
 	src/dhcp6/tnet_dhcp6_duid.o\
 	src/dhcp6/tnet_dhcp6_message.o\
 	src/dhcp6/tnet_dhcp6_option.o
 	###################
 	## DNS
 	###################
 OBJS +=	src/dns/tnet_dns.o\
 	src/dns/tnet_dns_a.o\
 	src/dns/tnet_dns_aaaa.o\
 	src/dns/tnet_dns_cname.o\
 	src/dns/tnet_dns_message.o\
 	src/dns/tnet_dns_mx.o\
 	src/dns/tnet_dns_naptr.o\
 	src/dns/tnet_dns_ns.o\
 	src/dns/tnet_dns_opt.o\
 	src/dns/tnet_dns_ptr.o\
 	src/dns/tnet_dns_regexp.o\
 	src/dns/tnet_dns_resolvconf.o\
 	src/dns/tnet_dns_rr.o\
 	src/dns/tnet_dns_soa.o\
 	src/dns/tnet_dns_srv.o\
 	src/dns/tnet_dns_txt.o
 	###################
 	## ICE
 	###################
 OBJS +=	src/ice/tnet_ice_candidate.o \
 	src/ice/tnet_ice_ctx.o \
 	src/ice/tnet_ice_event.o \
 	src/ice/tnet_ice_pair.o \
 	src/ice/tnet_ice_utils.o
 	###################
 	## STUN
 	###################
 OBJS +=	src/stun/tnet_stun.o\
 	src/stun/tnet_stun_attribute.o\
 	src/stun/tnet_stun_message.o
 	###################
 	## TLS / DTLS
 	###################
 OBJS +=	src/tls/tnet_tls.o\
 	src/tls/tnet_dtls.o
 	###################
 	## TURN
 	###################
 OBJS +=	src/turn/tnet_turn.o\
 	src/turn/tnet_turn_attribute.o\
 	src/turn/tnet_turn_message.o
 
 $(APP): $(OBJS)
 ifeq ($(EXT), a)
 	$(AR) rcs $@ $^
 else
 	$(CC) $(LDFLAGS) -o $@ $^
 endif
 
 %.o: %.c
 	$(CC) -c $(INCLUDE) $(CFLAGS) $< -o $@
 	
 install: $(APP)
 	$(ANDROID_SDK_ROOT)/tools/adb remount
 	$(ANDROID_SDK_ROOT)/tools/adb push $(APP) $(LIB_DIR)/$(APP)
 	$(ANDROID_SDK_ROOT)/tools/adb shell chmod 777 $(LIB_DIR)/$(APP)
 	
 clean:
 	@rm -f $(OBJS) $(APP)