Android.mk 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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. LOCAL_PATH := $(call my-dir)
  17. CC_LITE_SRC_FILES := \
  18. src/google/protobuf/stubs/common.cc \
  19. src/google/protobuf/stubs/once.cc \
  20. src/google/protobuf/stubs/hash.cc \
  21. src/google/protobuf/stubs/hash.h \
  22. src/google/protobuf/stubs/map-util.h \
  23. src/google/protobuf/stubs/stl_util-inl.h \
  24. src/google/protobuf/extension_set.cc \
  25. src/google/protobuf/generated_message_util.cc \
  26. src/google/protobuf/message_lite.cc \
  27. src/google/protobuf/repeated_field.cc \
  28. src/google/protobuf/wire_format_lite.cc \
  29. src/google/protobuf/io/coded_stream.cc \
  30. src/google/protobuf/io/coded_stream_inl.h \
  31. src/google/protobuf/io/zero_copy_stream.cc \
  32. src/google/protobuf/io/zero_copy_stream_impl_lite.cc
  33. JAVA_LITE_SRC_FILES := \
  34. java/src/main/java/com/google/protobuf/UninitializedMessageException.java \
  35. java/src/main/java/com/google/protobuf/MessageLite.java \
  36. java/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java \
  37. java/src/main/java/com/google/protobuf/CodedOutputStream.java \
  38. java/src/main/java/com/google/protobuf/ByteString.java \
  39. java/src/main/java/com/google/protobuf/CodedInputStream.java \
  40. java/src/main/java/com/google/protobuf/ExtensionRegistryLite.java \
  41. java/src/main/java/com/google/protobuf/AbstractMessageLite.java \
  42. java/src/main/java/com/google/protobuf/FieldSet.java \
  43. java/src/main/java/com/google/protobuf/Internal.java \
  44. java/src/main/java/com/google/protobuf/WireFormat.java \
  45. java/src/main/java/com/google/protobuf/GeneratedMessageLite.java
  46. COMPILER_SRC_FILES := \
  47. src/google/protobuf/descriptor.cc \
  48. src/google/protobuf/descriptor.pb.cc \
  49. src/google/protobuf/descriptor_database.cc \
  50. src/google/protobuf/dynamic_message.cc \
  51. src/google/protobuf/extension_set.cc \
  52. src/google/protobuf/extension_set_heavy.cc \
  53. src/google/protobuf/generated_message_reflection.cc \
  54. src/google/protobuf/generated_message_util.cc \
  55. src/google/protobuf/message.cc \
  56. src/google/protobuf/message_lite.cc \
  57. src/google/protobuf/reflection_ops.cc \
  58. src/google/protobuf/repeated_field.cc \
  59. src/google/protobuf/service.cc \
  60. src/google/protobuf/text_format.cc \
  61. src/google/protobuf/unknown_field_set.cc \
  62. src/google/protobuf/wire_format.cc \
  63. src/google/protobuf/wire_format_lite.cc \
  64. src/google/protobuf/compiler/code_generator.cc \
  65. src/google/protobuf/compiler/command_line_interface.cc \
  66. src/google/protobuf/compiler/importer.cc \
  67. src/google/protobuf/compiler/main.cc \
  68. src/google/protobuf/compiler/parser.cc \
  69. src/google/protobuf/compiler/plugin.cc \
  70. src/google/protobuf/compiler/plugin.pb.cc \
  71. src/google/protobuf/compiler/subprocess.cc \
  72. src/google/protobuf/compiler/zip_writer.cc \
  73. src/google/protobuf/compiler/cpp/cpp_enum.cc \
  74. src/google/protobuf/compiler/cpp/cpp_enum_field.cc \
  75. src/google/protobuf/compiler/cpp/cpp_extension.cc \
  76. src/google/protobuf/compiler/cpp/cpp_field.cc \
  77. src/google/protobuf/compiler/cpp/cpp_file.cc \
  78. src/google/protobuf/compiler/cpp/cpp_generator.cc \
  79. src/google/protobuf/compiler/cpp/cpp_helpers.cc \
  80. src/google/protobuf/compiler/cpp/cpp_message.cc \
  81. src/google/protobuf/compiler/cpp/cpp_message_field.cc \
  82. src/google/protobuf/compiler/cpp/cpp_primitive_field.cc \
  83. src/google/protobuf/compiler/cpp/cpp_service.cc \
  84. src/google/protobuf/compiler/cpp/cpp_string_field.cc \
  85. src/google/protobuf/compiler/java/java_enum.cc \
  86. src/google/protobuf/compiler/java/java_enum_field.cc \
  87. src/google/protobuf/compiler/java/java_extension.cc \
  88. src/google/protobuf/compiler/java/java_field.cc \
  89. src/google/protobuf/compiler/java/java_file.cc \
  90. src/google/protobuf/compiler/java/java_generator.cc \
  91. src/google/protobuf/compiler/java/java_helpers.cc \
  92. src/google/protobuf/compiler/java/java_message.cc \
  93. src/google/protobuf/compiler/java/java_message_field.cc \
  94. src/google/protobuf/compiler/java/java_primitive_field.cc \
  95. src/google/protobuf/compiler/java/java_service.cc \
  96. src/google/protobuf/compiler/javamicro/javamicro_enum.cc \
  97. src/google/protobuf/compiler/javamicro/javamicro_enum_field.cc \
  98. src/google/protobuf/compiler/javamicro/javamicro_field.cc \
  99. src/google/protobuf/compiler/javamicro/javamicro_file.cc \
  100. src/google/protobuf/compiler/javamicro/javamicro_generator.cc \
  101. src/google/protobuf/compiler/javamicro/javamicro_helpers.cc \
  102. src/google/protobuf/compiler/javamicro/javamicro_message.cc \
  103. src/google/protobuf/compiler/javamicro/javamicro_message_field.cc \
  104. src/google/protobuf/compiler/javamicro/javamicro_primitive_field.cc \
  105. src/google/protobuf/compiler/javanano/javanano_enum.cc \
  106. src/google/protobuf/compiler/javanano/javanano_enum_field.cc \
  107. src/google/protobuf/compiler/javanano/javanano_extension.cc \
  108. src/google/protobuf/compiler/javanano/javanano_field.cc \
  109. src/google/protobuf/compiler/javanano/javanano_file.cc \
  110. src/google/protobuf/compiler/javanano/javanano_generator.cc \
  111. src/google/protobuf/compiler/javanano/javanano_helpers.cc \
  112. src/google/protobuf/compiler/javanano/javanano_message.cc \
  113. src/google/protobuf/compiler/javanano/javanano_message_field.cc \
  114. src/google/protobuf/compiler/javanano/javanano_primitive_field.cc \
  115. src/google/protobuf/compiler/python/python_generator.cc \
  116. src/google/protobuf/io/coded_stream.cc \
  117. src/google/protobuf/io/gzip_stream.cc \
  118. src/google/protobuf/io/printer.cc \
  119. src/google/protobuf/io/tokenizer.cc \
  120. src/google/protobuf/io/zero_copy_stream.cc \
  121. src/google/protobuf/io/zero_copy_stream_impl.cc \
  122. src/google/protobuf/io/zero_copy_stream_impl_lite.cc \
  123. src/google/protobuf/stubs/common.cc \
  124. src/google/protobuf/stubs/hash.cc \
  125. src/google/protobuf/stubs/once.cc \
  126. src/google/protobuf/stubs/structurally_valid.cc \
  127. src/google/protobuf/stubs/strutil.cc \
  128. src/google/protobuf/stubs/substitute.cc
  129. # Java nano library (for device-side users)
  130. # =======================================================
  131. include $(CLEAR_VARS)
  132. LOCAL_MODULE := libprotobuf-java-2.3.0-nano
  133. LOCAL_MODULE_TAGS := optional
  134. LOCAL_SDK_VERSION := 8
  135. LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/nano)
  136. include $(BUILD_STATIC_JAVA_LIBRARY)
  137. # Java nano library (for host-side users)
  138. # =======================================================
  139. include $(CLEAR_VARS)
  140. LOCAL_MODULE := host-libprotobuf-java-2.3.0-nano
  141. LOCAL_MODULE_TAGS := optional
  142. LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/nano)
  143. include $(BUILD_HOST_JAVA_LIBRARY)
  144. # Java micro library (for device-side users)
  145. # =======================================================
  146. include $(CLEAR_VARS)
  147. LOCAL_MODULE := libprotobuf-java-2.3.0-micro
  148. LOCAL_MODULE_TAGS := optional
  149. LOCAL_SDK_VERSION := 8
  150. LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/micro)
  151. include $(BUILD_STATIC_JAVA_LIBRARY)
  152. # Java micro library (for host-side users)
  153. # =======================================================
  154. include $(CLEAR_VARS)
  155. LOCAL_MODULE := host-libprotobuf-java-2.3.0-micro
  156. LOCAL_MODULE_TAGS := optional
  157. LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/micro)
  158. include $(BUILD_HOST_JAVA_LIBRARY)
  159. # Java lite library (for device-side users)
  160. # =======================================================
  161. include $(CLEAR_VARS)
  162. LOCAL_MODULE := libprotobuf-java-2.3.0-lite
  163. LOCAL_MODULE_TAGS := optional
  164. LOCAL_SDK_VERSION := 8
  165. LOCAL_SRC_FILES := $(JAVA_LITE_SRC_FILES)
  166. include $(BUILD_STATIC_JAVA_LIBRARY)
  167. # Java lite library (for host-side users)
  168. # =======================================================
  169. include $(CLEAR_VARS)
  170. LOCAL_MODULE := host-libprotobuf-java-2.3.0-lite
  171. LOCAL_MODULE_TAGS := optional
  172. LOCAL_SRC_FILES := $(JAVA_LITE_SRC_FILES)
  173. include $(BUILD_HOST_JAVA_LIBRARY)
  174. # C++ lite library
  175. # =======================================================
  176. include $(CLEAR_VARS)
  177. LOCAL_MODULE := libprotobuf-cpp-2.3.0-lite
  178. LOCAL_MODULE_TAGS := optional
  179. LOCAL_CPP_EXTENSION := .cc
  180. LOCAL_SRC_FILES := $(CC_LITE_SRC_FILES)
  181. LOCAL_C_INCLUDES := \
  182. $(LOCAL_PATH)/android \
  183. $(LOCAL_PATH)/src
  184. # Define the header files to be copied
  185. #LOCAL_COPY_HEADERS := \
  186. # src/google/protobuf/stubs/once.h \
  187. # src/google/protobuf/stubs/common.h \
  188. # src/google/protobuf/io/coded_stream.h \
  189. # src/google/protobuf/generated_message_util.h \
  190. # src/google/protobuf/repeated_field.h \
  191. # src/google/protobuf/extension_set.h \
  192. # src/google/protobuf/wire_format_lite_inl.h
  193. #
  194. #LOCAL_COPY_HEADERS_TO := $(LOCAL_MODULE)
  195. LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI
  196. # These are the minimum versions and don't need to be update.
  197. ifeq ($(TARGET_ARCH),arm)
  198. LOCAL_SDK_VERSION := 8
  199. else
  200. # x86/mips support only available from API 9.
  201. LOCAL_SDK_VERSION := 9
  202. endif
  203. LOCAL_NDK_STL_VARIANT := stlport_static
  204. include $(BUILD_STATIC_LIBRARY)
  205. # C++ full library
  206. # =======================================================
  207. protobuf_cc_full_src_files := \
  208. $(CC_LITE_SRC_FILES) \
  209. src/google/protobuf/stubs/strutil.cc \
  210. src/google/protobuf/stubs/strutil.h \
  211. src/google/protobuf/stubs/substitute.cc \
  212. src/google/protobuf/stubs/substitute.h \
  213. src/google/protobuf/stubs/structurally_valid.cc \
  214. src/google/protobuf/descriptor.cc \
  215. src/google/protobuf/descriptor.pb.cc \
  216. src/google/protobuf/descriptor_database.cc \
  217. src/google/protobuf/dynamic_message.cc \
  218. src/google/protobuf/extension_set_heavy.cc \
  219. src/google/protobuf/generated_message_reflection.cc \
  220. src/google/protobuf/message.cc \
  221. src/google/protobuf/reflection_ops.cc \
  222. src/google/protobuf/service.cc \
  223. src/google/protobuf/text_format.cc \
  224. src/google/protobuf/unknown_field_set.cc \
  225. src/google/protobuf/wire_format.cc \
  226. src/google/protobuf/io/gzip_stream.cc \
  227. src/google/protobuf/io/printer.cc \
  228. src/google/protobuf/io/tokenizer.cc \
  229. src/google/protobuf/io/zero_copy_stream_impl.cc \
  230. src/google/protobuf/compiler/importer.cc \
  231. src/google/protobuf/compiler/parser.cc
  232. # C++ full library - stlport version
  233. # =======================================================
  234. include $(CLEAR_VARS)
  235. LOCAL_MODULE := libprotobuf-cpp-2.3.0-full
  236. LOCAL_MODULE_TAGS := optional
  237. LOCAL_CPP_EXTENSION := .cc
  238. LOCAL_SRC_FILES := $(protobuf_cc_full_src_files)
  239. LOCAL_C_INCLUDES := \
  240. $(LOCAL_PATH)/android \
  241. external/zlib \
  242. $(LOCAL_PATH)/src
  243. # Define the header files to be copied
  244. #LOCAL_COPY_HEADERS := \
  245. # src/google/protobuf/stubs/once.h \
  246. # src/google/protobuf/stubs/common.h \
  247. # src/google/protobuf/io/coded_stream.h \
  248. # src/google/protobuf/generated_message_util.h \
  249. # src/google/protobuf/repeated_field.h \
  250. # src/google/protobuf/extension_set.h \
  251. # src/google/protobuf/wire_format_lite_inl.h
  252. #
  253. #LOCAL_COPY_HEADERS_TO := $(LOCAL_MODULE)
  254. LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI
  255. # These are the minimum versions and don't need to be update.
  256. ifeq ($(TARGET_ARCH),arm)
  257. LOCAL_SDK_VERSION := 8
  258. else
  259. # x86/mips support only available from API 9.
  260. LOCAL_SDK_VERSION := 9
  261. endif
  262. LOCAL_NDK_STL_VARIANT := stlport_static
  263. include $(BUILD_STATIC_LIBRARY)
  264. # C++ full library - Gnustl+rtti version
  265. # =======================================================
  266. include $(CLEAR_VARS)
  267. LOCAL_MODULE := libprotobuf-cpp-2.3.0-full-gnustl-rtti
  268. LOCAL_MODULE_TAGS := optional
  269. LOCAL_CPP_EXTENSION := .cc
  270. LOCAL_SRC_FILES := $(protobuf_cc_full_src_files)
  271. LOCAL_C_INCLUDES := \
  272. $(LOCAL_PATH)/android \
  273. external/zlib \
  274. $(LOCAL_PATH)/src
  275. LOCAL_CFLAGS := -frtti
  276. LOCAL_SDK_VERSION := 14
  277. LOCAL_NDK_STL_VARIANT := gnustl_static
  278. include $(BUILD_STATIC_LIBRARY)
  279. # Clean temp vars
  280. protobuf_cc_full_src_files :=
  281. # Android Protocol buffer compiler, aprotoc (host executable)
  282. # used by the build systems as $(PROTOC) defined in
  283. # build/core/config.mk
  284. # =======================================================
  285. include $(CLEAR_VARS)
  286. LOCAL_MODULE := aprotoc
  287. LOCAL_MODULE_CLASS := EXECUTABLES
  288. LOCAL_MODULE_TAGS := optional
  289. LOCAL_CPP_EXTENSION := .cc
  290. LOCAL_SRC_FILES := $(COMPILER_SRC_FILES)
  291. LOCAL_C_INCLUDES := \
  292. $(LOCAL_PATH)/android \
  293. $(LOCAL_PATH)/src
  294. LOCAL_STATIC_LIBRARIES += libz
  295. LOCAL_LDLIBS := -lpthread
  296. include $(BUILD_HOST_EXECUTABLE)
  297. # To test java proto params build rules.
  298. # =======================================================
  299. include $(CLEAR_VARS)
  300. LOCAL_MODULE := aprotoc-test-nano-params
  301. LOCAL_MODULE_TAGS := tests
  302. LOCAL_SDK_VERSION := current
  303. LOCAL_PROTOC_OPTIMIZE_TYPE := nano
  304. LOCAL_SRC_FILES := \
  305. src/google/protobuf/unittest_import_nano.proto \
  306. src/google/protobuf/unittest_simple_nano.proto \
  307. src/google/protobuf/unittest_stringutf8_nano.proto \
  308. src/google/protobuf/unittest_recursive_nano.proto
  309. LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/src
  310. LOCAL_PROTO_JAVA_OUTPUT_PARAMS := java_package=$(LOCAL_PATH)/src/google/protobuf/unittest_import_nano.proto|com.google.protobuf.nano,java_outer_classname=$(LOCAL_PATH)/src/google/protobuf/unittest_import_nano.proto|UnittestImportNano
  311. include $(BUILD_STATIC_JAVA_LIBRARY)