1# Copyright (C) 2009 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15#
16
17LOCAL_PATH := $(call my-dir)
18
19IGNORED_WARNINGS := -Wno-sign-compare -Wno-unused-parameter -Wno-sign-promo -Wno-error=return-type
20
21CC_LITE_SRC_FILES := \
22    src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc         \
23    src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc        \
24    src/google/protobuf/stubs/common.cc                              \
25    src/google/protobuf/stubs/once.cc                                \
26    src/google/protobuf/stubs/stringprintf.cc                        \
27    src/google/protobuf/extension_set.cc                             \
28    src/google/protobuf/generated_message_util.cc                    \
29    src/google/protobuf/message_lite.cc                              \
30    src/google/protobuf/repeated_field.cc                            \
31    src/google/protobuf/wire_format_lite.cc                          \
32    src/google/protobuf/io/coded_stream.cc                           \
33    src/google/protobuf/io/zero_copy_stream.cc                       \
34    src/google/protobuf/io/zero_copy_stream_impl_lite.cc
35
36JAVA_LITE_SRC_FILES := \
37    java/src/main/java/com/google/protobuf/UninitializedMessageException.java \
38    java/src/main/java/com/google/protobuf/MessageLite.java \
39    java/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java \
40    java/src/main/java/com/google/protobuf/CodedOutputStream.java \
41    java/src/main/java/com/google/protobuf/ByteString.java \
42    java/src/main/java/com/google/protobuf/CodedInputStream.java \
43    java/src/main/java/com/google/protobuf/ExtensionRegistryLite.java \
44    java/src/main/java/com/google/protobuf/AbstractMessageLite.java \
45    java/src/main/java/com/google/protobuf/AbstractParser.java \
46    java/src/main/java/com/google/protobuf/FieldSet.java \
47    java/src/main/java/com/google/protobuf/Internal.java \
48    java/src/main/java/com/google/protobuf/WireFormat.java \
49    java/src/main/java/com/google/protobuf/GeneratedMessageLite.java \
50    java/src/main/java/com/google/protobuf/BoundedByteString.java \
51    java/src/main/java/com/google/protobuf/LazyField.java \
52    java/src/main/java/com/google/protobuf/LazyFieldLite.java \
53    java/src/main/java/com/google/protobuf/LazyStringList.java \
54    java/src/main/java/com/google/protobuf/LazyStringArrayList.java \
55    java/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java \
56    java/src/main/java/com/google/protobuf/LiteralByteString.java \
57    java/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java \
58    java/src/main/java/com/google/protobuf/Parser.java \
59    java/src/main/java/com/google/protobuf/ProtocolStringList.java \
60    java/src/main/java/com/google/protobuf/RopeByteString.java \
61    java/src/main/java/com/google/protobuf/SmallSortedMap.java \
62    java/src/main/java/com/google/protobuf/Utf8.java
63
64# This contains more source files than needed for the full version, but the
65# additional files should not create any conflict.
66JAVA_FULL_SRC_FILES := \
67    $(call all-java-files-under, java/src/main/java) \
68    src/google/protobuf/descriptor.proto
69
70COMPILER_SRC_FILES :=  \
71    src/google/protobuf/descriptor.cc \
72    src/google/protobuf/descriptor.pb.cc \
73    src/google/protobuf/descriptor_database.cc \
74    src/google/protobuf/dynamic_message.cc \
75    src/google/protobuf/extension_set.cc \
76    src/google/protobuf/extension_set_heavy.cc \
77    src/google/protobuf/generated_message_reflection.cc \
78    src/google/protobuf/generated_message_util.cc \
79    src/google/protobuf/message.cc \
80    src/google/protobuf/message_lite.cc \
81    src/google/protobuf/reflection_ops.cc \
82    src/google/protobuf/repeated_field.cc \
83    src/google/protobuf/service.cc \
84    src/google/protobuf/text_format.cc \
85    src/google/protobuf/unknown_field_set.cc \
86    src/google/protobuf/wire_format.cc \
87    src/google/protobuf/wire_format_lite.cc \
88    src/google/protobuf/compiler/code_generator.cc \
89    src/google/protobuf/compiler/command_line_interface.cc \
90    src/google/protobuf/compiler/importer.cc \
91    src/google/protobuf/compiler/main.cc \
92    src/google/protobuf/compiler/parser.cc \
93    src/google/protobuf/compiler/plugin.cc \
94    src/google/protobuf/compiler/plugin.pb.cc \
95    src/google/protobuf/compiler/subprocess.cc \
96    src/google/protobuf/compiler/zip_writer.cc \
97    src/google/protobuf/compiler/cpp/cpp_enum.cc \
98    src/google/protobuf/compiler/cpp/cpp_enum_field.cc \
99    src/google/protobuf/compiler/cpp/cpp_extension.cc \
100    src/google/protobuf/compiler/cpp/cpp_field.cc \
101    src/google/protobuf/compiler/cpp/cpp_file.cc \
102    src/google/protobuf/compiler/cpp/cpp_generator.cc \
103    src/google/protobuf/compiler/cpp/cpp_helpers.cc \
104    src/google/protobuf/compiler/cpp/cpp_message.cc \
105    src/google/protobuf/compiler/cpp/cpp_message_field.cc \
106    src/google/protobuf/compiler/cpp/cpp_primitive_field.cc \
107    src/google/protobuf/compiler/cpp/cpp_service.cc \
108    src/google/protobuf/compiler/cpp/cpp_string_field.cc \
109    src/google/protobuf/compiler/java/java_context.cc \
110    src/google/protobuf/compiler/java/java_enum.cc \
111    src/google/protobuf/compiler/java/java_enum_field.cc \
112    src/google/protobuf/compiler/java/java_extension.cc \
113    src/google/protobuf/compiler/java/java_field.cc \
114    src/google/protobuf/compiler/java/java_file.cc \
115    src/google/protobuf/compiler/java/java_generator.cc \
116    src/google/protobuf/compiler/java/java_generator_factory.cc \
117    src/google/protobuf/compiler/java/java_helpers.cc \
118    src/google/protobuf/compiler/java/java_lazy_message_field.cc \
119    src/google/protobuf/compiler/java/java_message.cc \
120    src/google/protobuf/compiler/java/java_message_field.cc \
121    src/google/protobuf/compiler/java/java_name_resolver.cc \
122    src/google/protobuf/compiler/java/java_primitive_field.cc \
123    src/google/protobuf/compiler/java/java_shared_code_generator.cc \
124    src/google/protobuf/compiler/java/java_service.cc \
125    src/google/protobuf/compiler/java/java_string_field.cc \
126    src/google/protobuf/compiler/java/java_doc_comment.cc \
127    src/google/protobuf/compiler/javamicro/javamicro_enum.cc \
128    src/google/protobuf/compiler/javamicro/javamicro_enum_field.cc \
129    src/google/protobuf/compiler/javamicro/javamicro_field.cc \
130    src/google/protobuf/compiler/javamicro/javamicro_file.cc \
131    src/google/protobuf/compiler/javamicro/javamicro_generator.cc \
132    src/google/protobuf/compiler/javamicro/javamicro_helpers.cc \
133    src/google/protobuf/compiler/javamicro/javamicro_message.cc \
134    src/google/protobuf/compiler/javamicro/javamicro_message_field.cc \
135    src/google/protobuf/compiler/javamicro/javamicro_primitive_field.cc \
136    src/google/protobuf/compiler/javanano/javanano_enum.cc \
137    src/google/protobuf/compiler/javanano/javanano_enum_field.cc \
138    src/google/protobuf/compiler/javanano/javanano_extension.cc \
139    src/google/protobuf/compiler/javanano/javanano_field.cc \
140    src/google/protobuf/compiler/javanano/javanano_file.cc \
141    src/google/protobuf/compiler/javanano/javanano_generator.cc \
142    src/google/protobuf/compiler/javanano/javanano_helpers.cc \
143    src/google/protobuf/compiler/javanano/javanano_message.cc \
144    src/google/protobuf/compiler/javanano/javanano_message_field.cc \
145    src/google/protobuf/compiler/javanano/javanano_primitive_field.cc \
146    src/google/protobuf/compiler/python/python_generator.cc \
147    src/google/protobuf/io/coded_stream.cc \
148    src/google/protobuf/io/gzip_stream.cc \
149    src/google/protobuf/io/printer.cc \
150    src/google/protobuf/io/strtod.cc \
151    src/google/protobuf/io/tokenizer.cc \
152    src/google/protobuf/io/zero_copy_stream.cc \
153    src/google/protobuf/io/zero_copy_stream_impl.cc \
154    src/google/protobuf/io/zero_copy_stream_impl_lite.cc \
155    src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc \
156    src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc \
157    src/google/protobuf/stubs/common.cc \
158    src/google/protobuf/stubs/once.cc \
159    src/google/protobuf/stubs/structurally_valid.cc \
160    src/google/protobuf/stubs/strutil.cc \
161    src/google/protobuf/stubs/substitute.cc \
162    src/google/protobuf/stubs/stringprintf.cc
163
164# Java nano library (for device-side users)
165# =======================================================
166include $(CLEAR_VARS)
167
168LOCAL_MODULE := libprotobuf-java-nano
169LOCAL_MODULE_TAGS := optional
170LOCAL_SDK_VERSION := 8
171
172LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/nano)
173LOCAL_SRC_FILES += $(call all-java-files-under, java/src/device/main/java/com/google/protobuf/nano)
174
175LOCAL_JAVA_LANGUAGE_VERSION := 1.7
176include $(BUILD_STATIC_JAVA_LIBRARY)
177
178# Java nano library (for host-side users)
179# =======================================================
180include $(CLEAR_VARS)
181
182LOCAL_MODULE := host-libprotobuf-java-nano
183LOCAL_MODULE_TAGS := optional
184
185LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/nano)
186
187LOCAL_JAVA_LANGUAGE_VERSION := 1.7
188include $(BUILD_HOST_JAVA_LIBRARY)
189
190# Java micro library (for device-side users)
191# =======================================================
192include $(CLEAR_VARS)
193
194LOCAL_MODULE := libprotobuf-java-micro
195LOCAL_MODULE_TAGS := optional
196LOCAL_SDK_VERSION := 8
197
198LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/micro)
199
200LOCAL_JAVA_LANGUAGE_VERSION := 1.7
201include $(BUILD_STATIC_JAVA_LIBRARY)
202
203# Java micro library (for host-side users)
204# =======================================================
205include $(CLEAR_VARS)
206
207LOCAL_MODULE := host-libprotobuf-java-micro
208LOCAL_MODULE_TAGS := optional
209
210LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/micro)
211
212LOCAL_JAVA_LANGUAGE_VERSION := 1.7
213include $(BUILD_HOST_JAVA_LIBRARY)
214
215# Java lite library (for device-side users)
216# =======================================================
217include $(CLEAR_VARS)
218
219LOCAL_MODULE := libprotobuf-java-lite
220LOCAL_MODULE_TAGS := optional
221LOCAL_SDK_VERSION := 9
222
223LOCAL_SRC_FILES := $(JAVA_LITE_SRC_FILES)
224
225LOCAL_JAVA_LANGUAGE_VERSION := 1.7
226include $(BUILD_STATIC_JAVA_LIBRARY)
227
228# Java lite library (for host-side users)
229# =======================================================
230include $(CLEAR_VARS)
231
232LOCAL_MODULE := host-libprotobuf-java-lite
233LOCAL_MODULE_TAGS := optional
234
235LOCAL_SRC_FILES := $(JAVA_LITE_SRC_FILES)
236
237LOCAL_JAVA_LANGUAGE_VERSION := 1.7
238include $(BUILD_HOST_JAVA_LIBRARY)
239
240# Java full library (for host-side users)
241# =======================================================
242include $(CLEAR_VARS)
243
244LOCAL_MODULE := host-libprotobuf-java-full
245LOCAL_MODULE_TAGS := optional
246
247LOCAL_SRC_FILES := $(JAVA_FULL_SRC_FILES)
248
249LOCAL_JAVA_LANGUAGE_VERSION := 1.7
250include $(BUILD_HOST_JAVA_LIBRARY)
251
252# C++ lite library for the NDK.
253# =======================================================
254include $(CLEAR_VARS)
255
256LOCAL_MODULE := libprotobuf-cpp-lite-ndk
257
258LOCAL_CPP_EXTENSION := .cc
259
260LOCAL_SRC_FILES := $(CC_LITE_SRC_FILES)
261
262LOCAL_C_INCLUDES := \
263    $(LOCAL_PATH)/android \
264    $(LOCAL_PATH)/src
265
266LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI $(IGNORED_WARNINGS)
267
268# These are the minimum versions and don't need to be updated.
269ifeq ($(TARGET_ARCH),arm)
270LOCAL_SDK_VERSION := 8
271else
272# x86/mips support only available from API 9.
273LOCAL_SDK_VERSION := 9
274endif
275LOCAL_NDK_STL_VARIANT := stlport_static
276
277LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
278
279include $(BUILD_STATIC_LIBRARY)
280
281# C++ lite library for the platform.
282# =======================================================
283include $(CLEAR_VARS)
284
285LOCAL_MODULE := libprotobuf-cpp-lite
286
287LOCAL_CPP_EXTENSION := .cc
288
289LOCAL_SRC_FILES := $(CC_LITE_SRC_FILES)
290
291LOCAL_C_INCLUDES := \
292    $(LOCAL_PATH)/android \
293    $(LOCAL_PATH)/src
294
295LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI $(IGNORED_WARNINGS)
296
297LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
298
299include $(BUILD_SHARED_LIBRARY)
300
301# C++ lite static library for host tools.
302# =======================================================
303include $(CLEAR_VARS)
304
305LOCAL_MODULE := libprotobuf-cpp-lite_static
306
307LOCAL_MODULE_HOST_OS := darwin linux windows
308
309LOCAL_CPP_EXTENSION := .cc
310
311LOCAL_SRC_FILES := $(CC_LITE_SRC_FILES)
312
313LOCAL_C_INCLUDES := \
314    $(LOCAL_PATH)/android \
315    $(LOCAL_PATH)/src
316
317LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI $(IGNORED_WARNINGS)
318
319LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
320
321include $(BUILD_HOST_STATIC_LIBRARY)
322
323# C++ lite library for the host.
324# =======================================================
325include $(CLEAR_VARS)
326
327LOCAL_MODULE := libprotobuf-cpp-lite
328
329LOCAL_MODULE_HOST_OS := darwin linux windows
330
331LOCAL_WHOLE_STATIC_LIBRARIES := libprotobuf-cpp-lite_static
332
333LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
334
335include $(BUILD_HOST_SHARED_LIBRARY)
336
337# C++ lite library + rtti (libc++ flavored for the platform)
338# =======================================================
339include $(CLEAR_VARS)
340
341LOCAL_MODULE := libprotobuf-cpp-lite-rtti
342LOCAL_MODULE_TAGS := optional
343
344LOCAL_CPP_EXTENSION := .cc
345
346LOCAL_SRC_FILES := $(CC_LITE_SRC_FILES)
347
348LOCAL_C_INCLUDES := \
349    $(LOCAL_PATH)/android \
350    $(LOCAL_PATH)/src
351
352LOCAL_RTTI_FLAG := -frtti
353LOCAL_CFLAGS := $(IGNORED_WARNINGS)
354
355LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
356
357include $(BUILD_SHARED_LIBRARY)
358
359# C++ lite library + rtti (libc++ flavored for the host)
360# =======================================================
361include $(CLEAR_VARS)
362
363LOCAL_MODULE := libprotobuf-cpp-lite-rtti
364LOCAL_MODULE_TAGS := optional
365
366LOCAL_CPP_EXTENSION := .cc
367
368LOCAL_SRC_FILES := $(CC_LITE_SRC_FILES)
369
370LOCAL_C_INCLUDES := \
371    $(LOCAL_PATH)/android \
372    $(LOCAL_PATH)/src
373
374LOCAL_RTTI_FLAG := -frtti
375LOCAL_CFLAGS := $(IGNORED_WARNINGS)
376
377LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
378
379include $(BUILD_HOST_SHARED_LIBRARY)
380
381# C++ full library
382# =======================================================
383protobuf_cc_full_src_files := \
384    $(CC_LITE_SRC_FILES)                                             \
385    src/google/protobuf/stubs/strutil.cc                             \
386    src/google/protobuf/stubs/substitute.cc                          \
387    src/google/protobuf/stubs/structurally_valid.cc                  \
388    src/google/protobuf/descriptor.cc                                \
389    src/google/protobuf/descriptor.pb.cc                             \
390    src/google/protobuf/descriptor_database.cc                       \
391    src/google/protobuf/dynamic_message.cc                           \
392    src/google/protobuf/extension_set_heavy.cc                       \
393    src/google/protobuf/generated_message_reflection.cc              \
394    src/google/protobuf/message.cc                                   \
395    src/google/protobuf/reflection_ops.cc                            \
396    src/google/protobuf/service.cc                                   \
397    src/google/protobuf/text_format.cc                               \
398    src/google/protobuf/unknown_field_set.cc                         \
399    src/google/protobuf/wire_format.cc                               \
400    src/google/protobuf/io/gzip_stream.cc                            \
401    src/google/protobuf/io/printer.cc                                \
402    src/google/protobuf/io/strtod.cc                                 \
403    src/google/protobuf/io/tokenizer.cc                              \
404    src/google/protobuf/io/zero_copy_stream_impl.cc                  \
405    src/google/protobuf/compiler/importer.cc                         \
406    src/google/protobuf/compiler/parser.cc
407
408# C++ full library for the NDK.
409# =======================================================
410include $(CLEAR_VARS)
411
412LOCAL_MODULE := libprotobuf-cpp-full-ndk
413LOCAL_CPP_EXTENSION := .cc
414LOCAL_SRC_FILES := $(protobuf_cc_full_src_files)
415LOCAL_C_INCLUDES := \
416    $(LOCAL_PATH)/android \
417    external/zlib \
418    $(LOCAL_PATH)/src
419
420LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI $(IGNORED_WARNINGS)
421
422# These are the minimum versions and don't need to be updated.
423ifeq ($(TARGET_ARCH),arm)
424LOCAL_SDK_VERSION := 8
425else
426# x86/mips support only available from API 9.
427LOCAL_SDK_VERSION := 9
428endif
429LOCAL_NDK_STL_VARIANT := stlport_static
430
431LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
432
433include $(BUILD_STATIC_LIBRARY)
434
435# C++ full library for the NDK, Gnustl+rtti version.
436# =======================================================
437include $(CLEAR_VARS)
438
439LOCAL_MODULE := libprotobuf-cpp-full-ndk-gnustl-rtti
440LOCAL_MODULE_TAGS := optional
441LOCAL_CPP_EXTENSION := .cc
442LOCAL_SRC_FILES := $(protobuf_cc_full_src_files)
443LOCAL_C_INCLUDES := \
444    $(LOCAL_PATH)/android \
445    external/zlib \
446    $(LOCAL_PATH)/src
447
448LOCAL_CFLAGS := -frtti $(IGNORED_WARNINGS)
449LOCAL_SDK_VERSION := 14
450LOCAL_NDK_STL_VARIANT := gnustl_static
451
452LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
453
454include $(BUILD_STATIC_LIBRARY)
455
456# C++ full library for the platform.
457# =======================================================
458include $(CLEAR_VARS)
459
460LOCAL_MODULE := libprotobuf-cpp-full
461LOCAL_MODULE_TAGS := optional
462LOCAL_CPP_EXTENSION := .cc
463LOCAL_SRC_FILES := $(protobuf_cc_full_src_files)
464LOCAL_C_INCLUDES := \
465    $(LOCAL_PATH)/android \
466    external/zlib \
467    $(LOCAL_PATH)/src
468
469LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI $(IGNORED_WARNINGS)
470LOCAL_SHARED_LIBRARIES := libz
471
472LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
473
474include $(BUILD_SHARED_LIBRARY)
475
476# C++ full library for the host
477# =======================================================
478include $(CLEAR_VARS)
479
480LOCAL_MODULE := libprotobuf-cpp-full
481LOCAL_MODULE_TAGS := optional
482LOCAL_CPP_EXTENSION := .cc
483LOCAL_SRC_FILES := $(protobuf_cc_full_src_files)
484LOCAL_C_INCLUDES := \
485    $(LOCAL_PATH)/android \
486    external/zlib \
487    $(LOCAL_PATH)/src
488
489LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI $(IGNORED_WARNINGS)
490LOCAL_SHARED_LIBRARIES := libz-host
491
492LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
493
494include $(BUILD_HOST_SHARED_LIBRARY)
495
496# C++ full library + rtti for the platform.
497# =======================================================
498include $(CLEAR_VARS)
499
500LOCAL_MODULE := libprotobuf-cpp-full-rtti
501LOCAL_MODULE_TAGS := optional
502LOCAL_CPP_EXTENSION := .cc
503LOCAL_SRC_FILES := $(protobuf_cc_full_src_files)
504LOCAL_C_INCLUDES := \
505    $(LOCAL_PATH)/android \
506    external/zlib \
507    $(LOCAL_PATH)/src
508
509LOCAL_RTTI_FLAG := -frtti
510LOCAL_CFLAGS := $(IGNORED_WARNINGS)
511LOCAL_SHARED_LIBRARIES := libz
512
513LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
514
515include $(BUILD_SHARED_LIBRARY)
516
517# C++ full library + rtti for the host.
518# =======================================================
519include $(CLEAR_VARS)
520
521LOCAL_MODULE := libprotobuf-cpp-full-rtti
522LOCAL_MODULE_TAGS := optional
523LOCAL_CPP_EXTENSION := .cc
524LOCAL_SRC_FILES := $(protobuf_cc_full_src_files)
525LOCAL_C_INCLUDES := \
526    $(LOCAL_PATH)/android \
527    external/zlib \
528    $(LOCAL_PATH)/src
529
530LOCAL_RTTI_FLAG := -frtti
531LOCAL_CFLAGS := $(IGNORED_WARNINGS)
532LOCAL_SHARED_LIBRARIES := libz-host
533
534LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src
535
536include $(BUILD_HOST_SHARED_LIBRARY)
537
538# Clean temp vars
539protobuf_cc_full_src_files :=
540
541
542# Android Protocol buffer compiler, aprotoc (host executable)
543# used by the build systems as $(PROTOC) defined in
544# build/core/config.mk
545# =======================================================
546include $(CLEAR_VARS)
547
548LOCAL_MODULE := aprotoc
549LOCAL_MODULE_HOST_OS := darwin linux windows
550
551# Statically link libc++ because we copy aprotoc to unbundled projects where
552# libc++.so may not be available.
553LOCAL_CXX_STL := libc++_static
554
555LOCAL_CPP_EXTENSION := .cc
556LOCAL_SRC_FILES := $(COMPILER_SRC_FILES)
557
558LOCAL_C_INCLUDES := \
559    $(LOCAL_PATH)/android \
560    $(LOCAL_PATH)/src
561
562LOCAL_STATIC_LIBRARIES += libz
563
564LOCAL_LDLIBS_darwin := -lpthread
565LOCAL_LDLIBS_linux := -lpthread
566
567LOCAL_CFLAGS := $(IGNORED_WARNINGS)
568
569include $(BUILD_HOST_EXECUTABLE)
570
571# To test java proto params build rules.
572# =======================================================
573include $(CLEAR_VARS)
574
575LOCAL_MODULE := aprotoc-test-nano-params
576LOCAL_MODULE_TAGS := tests
577LOCAL_SDK_VERSION := current
578
579LOCAL_PROTOC_OPTIMIZE_TYPE := nano
580
581LOCAL_SRC_FILES := \
582        src/google/protobuf/unittest_import_nano.proto \
583        src/google/protobuf/unittest_simple_nano.proto \
584        src/google/protobuf/unittest_stringutf8_nano.proto \
585        src/google/protobuf/unittest_recursive_nano.proto
586
587
588LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/src
589
590LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \
591        java_package = $(LOCAL_PATH)/src/google/protobuf/unittest_import_nano.proto|com.google.protobuf.nano, \
592        java_outer_classname = $(LOCAL_PATH)/src/google/protobuf/unittest_import_nano.proto|UnittestImportNano
593
594LOCAL_JAVA_LANGUAGE_VERSION := 1.7
595include $(BUILD_STATIC_JAVA_LIBRARY)
596
597# To test Android-specific nanoproto features.
598# =======================================================
599include $(CLEAR_VARS)
600
601# Parcelable messages
602LOCAL_MODULE := android-nano-test-parcelable
603LOCAL_MODULE_TAGS := tests
604LOCAL_SDK_VERSION := current
605# Only needed at compile-time.
606LOCAL_JAVA_LIBRARIES := android-support-annotations
607
608LOCAL_PROTOC_OPTIMIZE_TYPE := nano
609
610LOCAL_SRC_FILES := src/google/protobuf/unittest_simple_nano.proto
611
612LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/src
613
614LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \
615        parcelable_messages = true, \
616        generate_intdefs = true
617
618include $(BUILD_STATIC_JAVA_LIBRARY)
619
620include $(CLEAR_VARS)
621
622# Parcelable and extendable messages
623LOCAL_MODULE := android-nano-test-parcelable-extendable
624LOCAL_MODULE_TAGS := tests
625LOCAL_SDK_VERSION := current
626# Only needed at compile-time.
627LOCAL_JAVA_LIBRARIES := android-support-annotations
628
629LOCAL_PROTOC_OPTIMIZE_TYPE := nano
630
631LOCAL_SRC_FILES := src/google/protobuf/unittest_extension_nano.proto
632
633LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/src
634
635LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \
636        parcelable_messages = true, \
637        generate_intdefs = true, \
638        store_unknown_fields = true
639
640LOCAL_JAVA_LANGUAGE_VERSION := 1.7
641include $(BUILD_STATIC_JAVA_LIBRARY)
642
643include $(CLEAR_VARS)
644
645# Test APK
646LOCAL_PACKAGE_NAME := NanoAndroidTest
647
648LOCAL_SDK_VERSION := 8
649
650LOCAL_MODULE_TAGS := tests
651
652LOCAL_SRC_FILES := $(call all-java-files-under, java/src/device/test/java/com/google/protobuf/nano)
653
654LOCAL_MANIFEST_FILE := java/src/device/test/AndroidManifest.xml
655
656LOCAL_STATIC_JAVA_LIBRARIES := libprotobuf-java-nano \
657        android-nano-test-parcelable \
658        android-nano-test-parcelable-extendable
659
660LOCAL_DEX_PREOPT := false
661
662include $(BUILD_PACKAGE)
663