-
Notifications
You must be signed in to change notification settings - Fork 3
/
atom.mk
324 lines (247 loc) · 9.78 KB
/
atom.mk
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
LOCAL_PATH := $(call my-dir)
###############################################################################
###############################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := libarsdk
LOCAL_EXPORT_C_INCLUDES := \
$(LOCAL_PATH)/libarsdk/include
# Public API headers - top level headers first
# This header list is currently used to generate a python binding
LIBARSDK_HEADERS := $\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk_desc.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk_cmd_itf.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk_mngr.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk_backend.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk_backend_net.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk_backend_mux.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk_publisher_avahi.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk_publisher_net.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk_publisher_mux.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk_peer.h
LOCAL_EXPORT_CUSTOM_VARIABLES := LIBARSDK_HEADERS=$(LIBARSDK_HEADERS);
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/libarsdk/src
LOCAL_CFLAGS := -DARSDK_API_EXPORTS -fvisibility=hidden
LOCAL_SRC_FILES := \
libarsdk/src/arsdk_backend.c \
libarsdk/src/cmd_itf/arsdk_cmd_itf.c \
libarsdk/src/cmd_itf/arsdk_cmd_itf1.c \
libarsdk/src/cmd_itf/arsdk_cmd_itf2.c \
libarsdk/src/cmd_itf/arsdk_cmd_itf3.c \
libarsdk/src/arsdk_decoder.c \
libarsdk/src/arsdk_mngr.c \
libarsdk/src/arsdk_encoder.c \
libarsdk/src/arsdk_log.c \
libarsdk/src/arsdk_peer.c \
libarsdk/src/arsdk_transport.c
LOCAL_SRC_FILES += \
libarsdk/src/net/arsdk_backend_net.c \
libarsdk/src/net/arsdk_publisher_avahi.c \
libarsdk/src/net/arsdk_publisher_net.c \
libarsdk/src/net/arsdk_transport_net.c
LOCAL_SRC_FILES += \
libarsdk/src/mux/arsdk_backend_mux.c \
libarsdk/src/mux/arsdk_publisher_mux.c \
libarsdk/src/mux/arsdk_transport_mux.c
LOCAL_LIBRARIES += libpomp \
json \
libfutils
LOCAL_WHOLE_STATIC_LIBRARIES += libarsdkgen
LOCAL_CONDITIONAL_LIBRARIES += \
OPTIONAL:libulog \
OPTIONAL:libmux
ifeq ("$(TARGET_OS)","windows")
LOCAL_LDLIBS += -lws2_32
endif
include $(BUILD_LIBRARY)
###############################################################################
###############################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := libarsdkgen
LOCAL_EXPORT_C_INCLUDES := \
$(call local-get-build-dir)/gen
LOCAL_DEPENDS_HEADERS := libarsdk
LOCAL_LIBRARIES := libpomp
LOCAL_CFLAGS := -DARSDK_API_EXPORTS -fvisibility=hidden
LOCAL_GENERATED_SRC_FILES := \
gen/arsdk_cmd_desc.c \
gen/arsdk_cmd_dec.c \
gen/arsdk_cmd_enc.c
LOCAL_CUSTOM_MACROS := \
arsdkgen-macro:$(LOCAL_PATH)/tools/libarsdkgen.py,$(call local-get-build-dir)/gen
include $(BUILD_LIBRARY)
###############################################################################
###############################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := libarsdkctrl
LOCAL_EXPORT_C_INCLUDES := \
$(LOCAL_PATH)/libarsdkctrl/include
# Public API headers - top level headers first
# This header list is currently used to generate a python binding
LIBARSDKCTRL_HEADERS := $\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdkctrl.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_ctrl.h:$\
$(LOCAL_PATH)/libarsdk/include/arsdk/arsdk_backend.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdkctrl_backend.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdkctrl_backend_net.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdkctrl_backend_mux.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_discovery_avahi.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_discovery_net.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_discovery_mux.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_ftp_itf.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_media_itf.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_updater_itf.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_blackbox_itf.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_crashml_itf.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_pud_itf.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_ephemeris_itf.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/arsdk_device.h:$\
$(LOCAL_PATH)/libarsdkctrl/include/arsdkctrl/internal/arsdk_discovery_internal.h
LOCAL_EXPORT_CUSTOM_VARIABLES := LIBARSDKCTRL_HEADERS=$(LIBARSDKCTRL_HEADERS);
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/libarsdk/include \
$(LOCAL_PATH)/libarsdk/src \
$(LOCAL_PATH)/libarsdkctrl/src
LOCAL_CFLAGS := -DARSDK_API_EXPORTS -fvisibility=hidden
LOCAL_SRC_FILES := \
libarsdkctrl/src/arsdkctrl_log.c \
libarsdkctrl/src/arsdk_discovery.c \
libarsdkctrl/src/arsdk_ctrl.c \
libarsdkctrl/src/arsdk_device.c \
libarsdkctrl/src/arsdkctrl_backend.c \
libarsdkctrl/src/arsdk_ftp_itf.c \
libarsdkctrl/src/arsdk_media_itf.c \
libarsdkctrl/src/arsdk_updater_itf.c \
libarsdkctrl/src/arsdk_blackbox_itf.c \
libarsdkctrl/src/arsdk_crashml_itf.c \
libarsdkctrl/src/arsdk_flight_log_itf.c \
libarsdkctrl/src/arsdk_pud_itf.c \
libarsdkctrl/src/arsdk_ephemeris_itf.c \
libarsdkctrl/src/arsdk_md5.c \
libarsdkctrl/src/updater/arsdk_updater_transport.c \
libarsdkctrl/src/updater/arsdk_updater_transport_ftp.c \
libarsdkctrl/src/updater/arsdk_updater_transport_mux.c
LOCAL_SRC_FILES += \
libarsdkctrl/src/net/arsdkctrl_backend_net.c \
libarsdkctrl/src/net/arsdk_avahi_loop.c \
libarsdkctrl/src/net/arsdk_discovery_avahi.c \
libarsdkctrl/src/net/arsdk_discovery_net.c
LOCAL_SRC_FILES += \
libarsdkctrl/src/mux/arsdkctrl_backend_mux.c \
libarsdkctrl/src/mux/arsdk_discovery_mux.c
LOCAL_SRC_FILES += \
libarsdkctrl/src/ftp/arsdk_ftp.c \
libarsdkctrl/src/ftp/arsdk_ftp_conn.c \
libarsdkctrl/src/ftp/arsdk_ftp_seq.c \
libarsdkctrl/src/ftp/arsdk_ftp_cmd.c
LOCAL_LIBRARIES += libarsdk \
libulog \
libpomp \
json \
libfutils \
libmux
LOCAL_CONDITIONAL_LIBRARIES += \
OPTIONAL:avahi-client \
OPTIONAL:libpuf
ifeq ("$(TARGET_OS)","windows")
LOCAL_LDLIBS += -lws2_32
endif
include $(BUILD_LIBRARY)
###############################################################################
###############################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := libarsdklog
LOCAL_EXPORT_C_INCLUDES := \
$(LOCAL_PATH)/libarsdklog/include
# Public API headers - top level headers first
# This header list is currently used to generate a python binding
LIBARSDKLOG_HEADERS := $\
$(LOCAL_PATH)/libarsdklog/include/arsdklog/arsdklog.h
LOCAL_EXPORT_CUSTOM_VARIABLES := LIBARSDKLOG_HEADERS=$(LIBARSDKLOG_HEADERS);
LOCAL_CFLAGS := -DARSDKLOG_API_EXPORTS -fvisibility=hidden
LOCAL_SRC_FILES := \
libarsdklog/src/arsdklog.c \
LOCAL_LIBRARIES += libarsdk \
libarsdk-pbc \
libpomp \
libulog
LOCAL_CONDITIONAL_LIBRARIES := \
OPTIONAL:libmsghub
include $(BUILD_LIBRARY)
###############################################################################
###############################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := arsdk-ng-controller
LOCAL_SRC_FILES := examples/controller.c
LOCAL_LIBRARIES := libpomp libulog libmux libarsdk libarsdkctrl
LOCAL_CONDITIONAL_LIBRARIES := \
OPTIONAL:libpuf
include $(BUILD_EXECUTABLE)
###############################################################################
###############################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := arsdk-ng-device
LOCAL_SRC_FILES := examples/device.c
LOCAL_LIBRARIES := libpomp libulog libmux libarsdk
include $(BUILD_EXECUTABLE)
###############################################################################
# Python bindings
###############################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := libarsdk-py
LOCAL_LIBRARIES := libarsdk
LOCAL_CATEGORY_PATH := libs
LOCAL_EXPAND_CUSTOM_VARIABLES := 1
LOCAL_CUSTOM_MACROS := \
pybinding-macro:libarsdk,libarsdk,$(LIBARSDK_HEADERS),$(TARGET_OUT_STAGING)/usr/lib/libarsdk.so
include $(BUILD_CUSTOM)
include $(CLEAR_VARS)
LOCAL_MODULE := libarsdkctrl-py
LOCAL_LIBRARIES := libarsdkctrl libarsdk-py
LOCAL_CATEGORY_PATH := libs
LOCAL_EXPAND_CUSTOM_VARIABLES := 1
LOCAL_CUSTOM_MACROS := \
pybinding-macro:libarsdkctrl_bindings,libarsdkctrl,$(LIBARSDKCTRL_HEADERS),$(TARGET_OUT_STAGING)/usr/lib/libarsdkctrl.so
$(foreach __f,$(call all-files-under,libarsdkctrl/python,.py), \
$(eval LOCAL_COPY_FILES += $(__f):usr/lib/python/site-packages/libarsdkctrl/$(patsubst libarsdkctrl/python/%,%,$(__f))) \
)
include $(BUILD_CUSTOM)
###############################################################################
###############################################################################
ifdef TARGET_TEST
include $(CLEAR_VARS)
LOCAL_MODULE := tst-arsdk
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/src \
$(LOCAL_PATH)/tests
LIBARSDKCTRL_GEN_DIR := $(call local-get-build-dir)/gen
LOCAL_EXPORT_C_INCLUDES := \
$(call local-get-build-dir)/gen
LOCAL_GENERATED_SRC_FILES := gen/arsdk_test_protoc_gen.c
LOCAL_SRC_FILES := \
tests/arsdk_test.c \
tests/env/arsdk_test_env.c \
tests/env/arsdk_test_env_dev.c \
tests/env/arsdk_test_env_mux_tip.c \
tests/env/arsdk_test_env_ctrl.c \
tests/arsdk_test_cmd_itf.c \
tests/arsdk_test_enc_dec.c \
tests/arsdk_test_protoc.c \
tests/arsdk_test_protoc_ctrl.c \
tests/arsdk_test_protoc_dev.c
LOCAL_LIBRARIES := libarsdk \
libarsdkctrl \
libpomp \
avahi-client \
libmux \
libcunit
LOCAL_CUSTOM_MACROS := \
arsdkgen-macro:$(LOCAL_PATH)/tools/arsdktestgen.py,$(call local-get-build-dir)/gen
LOCAL_CONDITIONAL_LIBRARIES := OPTIONAL:libulog
ifeq ("$(TARGET_OS)","windows")
LOCAL_LDLIBS += -lws2_32
endif
include $(BUILD_EXECUTABLE)
endif