Android.mk 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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_field.cc \
  108. src/google/protobuf/compiler/javanano/javanano_file.cc \
  109. src/google/protobuf/compiler/javanano/javanano_generator.cc \
  110. src/google/protobuf/compiler/javanano/javanano_helpers.cc \
  111. src/google/protobuf/compiler/javanano/javanano_message.cc \
  112. src/google/protobuf/compiler/javanano/javanano_message_field.cc \
  113. src/google/protobuf/compiler/javanano/javanano_primitive_field.cc \
  114. src/google/protobuf/compiler/python/python_generator.cc \
  115. src/google/protobuf/io/coded_stream.cc \
  116. src/google/protobuf/io/gzip_stream.cc \
  117. src/google/protobuf/io/printer.cc \
  118. src/google/protobuf/io/tokenizer.cc \
  119. src/google/protobuf/io/zero_copy_stream.cc \
  120. src/google/protobuf/io/zero_copy_stream_impl.cc \
  121. src/google/protobuf/io/zero_copy_stream_impl_lite.cc \
  122. src/google/protobuf/stubs/common.cc \
  123. src/google/protobuf/stubs/hash.cc \
  124. src/google/protobuf/stubs/once.cc \
  125. src/google/protobuf/stubs/structurally_valid.cc \
  126. src/google/protobuf/stubs/strutil.cc \
  127. src/google/protobuf/stubs/substitute.cc
  128. # Java nano library (for device-side users)
  129. # =======================================================
  130. include $(CLEAR_VARS)
  131. LOCAL_MODULE := libprotobuf-java-2.3.0-nano
  132. LOCAL_MODULE_TAGS := optional
  133. LOCAL_SDK_VERSION := 8
  134. LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/nano)
  135. include $(BUILD_STATIC_JAVA_LIBRARY)
  136. # Java nano library (for host-side users)
  137. # =======================================================
  138. include $(CLEAR_VARS)
  139. LOCAL_MODULE := host-libprotobuf-java-2.3.0-nano
  140. LOCAL_MODULE_TAGS := optional
  141. LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/nano)
  142. include $(BUILD_HOST_JAVA_LIBRARY)
  143. # Java micro library (for device-side users)
  144. # =======================================================
  145. include $(CLEAR_VARS)
  146. LOCAL_MODULE := libprotobuf-java-2.3.0-micro
  147. LOCAL_MODULE_TAGS := optional
  148. LOCAL_SDK_VERSION := 8
  149. LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/micro)
  150. include $(BUILD_STATIC_JAVA_LIBRARY)
  151. # Java micro library (for host-side users)
  152. # =======================================================
  153. include $(CLEAR_VARS)
  154. LOCAL_MODULE := host-libprotobuf-java-2.3.0-micro
  155. LOCAL_MODULE_TAGS := optional
  156. LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/micro)
  157. include $(BUILD_HOST_JAVA_LIBRARY)
  158. # Java lite library (for device-side users)
  159. # =======================================================
  160. include $(CLEAR_VARS)
  161. LOCAL_MODULE := libprotobuf-java-2.3.0-lite
  162. LOCAL_MODULE_TAGS := optional
  163. LOCAL_SDK_VERSION := 8
  164. LOCAL_SRC_FILES := $(JAVA_LITE_SRC_FILES)
  165. include $(BUILD_STATIC_JAVA_LIBRARY)
  166. # Java lite library (for host-side users)
  167. # =======================================================
  168. include $(CLEAR_VARS)
  169. LOCAL_MODULE := host-libprotobuf-java-2.3.0-lite
  170. LOCAL_MODULE_TAGS := optional
  171. LOCAL_SRC_FILES := $(JAVA_LITE_SRC_FILES)
  172. include $(BUILD_HOST_JAVA_LIBRARY)
  173. # C++ lite library
  174. # =======================================================
  175. include $(CLEAR_VARS)
  176. LOCAL_MODULE := libprotobuf-cpp-2.3.0-lite
  177. LOCAL_MODULE_TAGS := optional
  178. LOCAL_CPP_EXTENSION := .cc
  179. LOCAL_SRC_FILES := $(CC_LITE_SRC_FILES)
  180. LOCAL_C_INCLUDES := \
  181. $(LOCAL_PATH)/android \
  182. $(LOCAL_PATH)/src
  183. # Define the header files to be copied
  184. #LOCAL_COPY_HEADERS := \
  185. # src/google/protobuf/stubs/once.h \
  186. # src/google/protobuf/stubs/common.h \
  187. # src/google/protobuf/io/coded_stream.h \
  188. # src/google/protobuf/generated_message_util.h \
  189. # src/google/protobuf/repeated_field.h \
  190. # src/google/protobuf/extension_set.h \
  191. # src/google/protobuf/wire_format_lite_inl.h
  192. #
  193. #LOCAL_COPY_HEADERS_TO := $(LOCAL_MODULE)
  194. LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI
  195. # These are the minimum versions and don't need to be update.
  196. ifeq ($(TARGET_ARCH),arm)
  197. LOCAL_SDK_VERSION := 8
  198. else
  199. # x86/mips support only available from API 9.
  200. LOCAL_SDK_VERSION := 9
  201. endif
  202. LOCAL_NDK_STL_VARIANT := stlport_static
  203. include $(BUILD_STATIC_LIBRARY)
  204. # C++ full library
  205. # =======================================================
  206. protobuf_cc_full_src_files := \
  207. $(CC_LITE_SRC_FILES) \
  208. src/google/protobuf/stubs/strutil.cc \
  209. src/google/protobuf/stubs/strutil.h \
  210. src/google/protobuf/stubs/substitute.cc \
  211. src/google/protobuf/stubs/substitute.h \
  212. src/google/protobuf/stubs/structurally_valid.cc \
  213. src/google/protobuf/descriptor.cc \
  214. src/google/protobuf/descriptor.pb.cc \
  215. src/google/protobuf/descriptor_database.cc \
  216. src/google/protobuf/dynamic_message.cc \
  217. src/google/protobuf/extension_set_heavy.cc \
  218. src/google/protobuf/generated_message_reflection.cc \
  219. src/google/protobuf/message.cc \
  220. src/google/protobuf/reflection_ops.cc \
  221. src/google/protobuf/service.cc \
  222. src/google/protobuf/text_format.cc \
  223. src/google/protobuf/unknown_field_set.cc \
  224. src/google/protobuf/wire_format.cc \
  225. src/google/protobuf/io/gzip_stream.cc \
  226. src/google/protobuf/io/printer.cc \
  227. src/google/protobuf/io/tokenizer.cc \
  228. src/google/protobuf/io/zero_copy_stream_impl.cc \
  229. src/google/protobuf/compiler/importer.cc \
  230. src/google/protobuf/compiler/parser.cc
  231. # C++ full library - stlport version
  232. # =======================================================
  233. include $(CLEAR_VARS)
  234. LOCAL_MODULE := libprotobuf-cpp-2.3.0-full
  235. LOCAL_MODULE_TAGS := optional
  236. LOCAL_CPP_EXTENSION := .cc
  237. LOCAL_SRC_FILES := $(protobuf_cc_full_src_files)
  238. LOCAL_C_INCLUDES := \
  239. $(LOCAL_PATH)/android \
  240. external/zlib \
  241. $(LOCAL_PATH)/src
  242. # Define the header files to be copied
  243. #LOCAL_COPY_HEADERS := \
  244. # src/google/protobuf/stubs/once.h \
  245. # src/google/protobuf/stubs/common.h \
  246. # src/google/protobuf/io/coded_stream.h \
  247. # src/google/protobuf/generated_message_util.h \
  248. # src/google/protobuf/repeated_field.h \
  249. # src/google/protobuf/extension_set.h \
  250. # src/google/protobuf/wire_format_lite_inl.h
  251. #
  252. #LOCAL_COPY_HEADERS_TO := $(LOCAL_MODULE)
  253. LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI
  254. # These are the minimum versions and don't need to be update.
  255. ifeq ($(TARGET_ARCH),arm)
  256. LOCAL_SDK_VERSION := 8
  257. else
  258. # x86/mips support only available from API 9.
  259. LOCAL_SDK_VERSION := 9
  260. endif
  261. LOCAL_NDK_STL_VARIANT := stlport_static
  262. include $(BUILD_STATIC_LIBRARY)
  263. # C++ full library - Gnustl+rtti version
  264. # =======================================================
  265. include $(CLEAR_VARS)
  266. LOCAL_MODULE := libprotobuf-cpp-2.3.0-full-gnustl-rtti
  267. LOCAL_MODULE_TAGS := optional
  268. LOCAL_CPP_EXTENSION := .cc
  269. LOCAL_SRC_FILES := $(protobuf_cc_full_src_files)
  270. LOCAL_C_INCLUDES := \
  271. $(LOCAL_PATH)/android \
  272. external/zlib \
  273. $(LOCAL_PATH)/src
  274. LOCAL_CFLAGS := -frtti
  275. LOCAL_SDK_VERSION := 14
  276. LOCAL_NDK_STL_VARIANT := gnustl_static
  277. include $(BUILD_STATIC_LIBRARY)
  278. # Clean temp vars
  279. protobuf_cc_full_src_files :=
  280. # Android Protocol buffer compiler, aprotoc (host executable)
  281. # used by the build systems as $(PROTOC) defined in
  282. # build/core/config.mk
  283. # =======================================================
  284. include $(CLEAR_VARS)
  285. LOCAL_MODULE := aprotoc
  286. LOCAL_MODULE_CLASS := EXECUTABLES
  287. LOCAL_MODULE_TAGS := optional
  288. LOCAL_CPP_EXTENSION := .cc
  289. LOCAL_SRC_FILES := $(COMPILER_SRC_FILES)
  290. LOCAL_C_INCLUDES := \
  291. $(LOCAL_PATH)/android \
  292. $(LOCAL_PATH)/src
  293. LOCAL_STATIC_LIBRARIES += libz
  294. LOCAL_LDLIBS := -lpthread
  295. include $(BUILD_HOST_EXECUTABLE)