Android.mk 12 KB

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