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