summaryrefslogtreecommitdiffstats
path: root/tinyNET/droid-makefile
blob: a21924a9301c88da18807e3be716ec1a64f5366a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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)
OpenPOWER on IntegriCloud