Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2013 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | LOCAL_PATH := $(call my-dir) |
Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 17 | |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 18 | libziparchive_source_files := \ |
| 19 | zip_archive.cc \ |
| 20 | zip_archive_stream_entry.cc \ |
| 21 | zip_writer.cc \ |
| 22 | |
| 23 | libziparchive_test_files := \ |
| 24 | entry_name_utils_test.cc \ |
| 25 | zip_archive_test.cc \ |
| 26 | zip_writer_test.cc \ |
Adam Lesinski | ad4ad8c | 2015-10-05 18:16:18 -0700 | [diff] [blame] | 27 | |
Adam Lesinski | 591fd39 | 2015-10-06 15:23:46 -0700 | [diff] [blame] | 28 | # ZLIB_CONST turns on const for input buffers, which is pretty standard. |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 29 | libziparchive_common_c_flags := \ |
| 30 | -DZLIB_CONST \ |
| 31 | -Werror \ |
| 32 | -Wall \ |
Adam Lesinski | 591fd39 | 2015-10-06 15:23:46 -0700 | [diff] [blame] | 33 | |
Adam Lesinski | ad4ad8c | 2015-10-05 18:16:18 -0700 | [diff] [blame] | 34 | # Incorrectly warns when C++11 empty brace {} initializer is used. |
| 35 | # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61489 |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 36 | libziparchive_common_cpp_flags := \ |
| 37 | -Wold-style-cast \ |
| 38 | -Wno-missing-field-initializers \ |
Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 39 | |
Dan Albert | 27d166c | 2014-10-16 20:47:51 -0700 | [diff] [blame] | 40 | include $(CLEAR_VARS) |
Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 41 | LOCAL_CPP_EXTENSION := .cc |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 42 | LOCAL_SRC_FILES := $(libziparchive_source_files) |
Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 43 | LOCAL_STATIC_LIBRARIES := libz |
Dan Albert | 1ae0764 | 2015-04-09 14:11:18 -0700 | [diff] [blame] | 44 | LOCAL_SHARED_LIBRARIES := libutils libbase |
Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 45 | LOCAL_MODULE:= libziparchive |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 46 | LOCAL_CFLAGS := $(libziparchive_common_c_flags) |
| 47 | LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) |
Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 48 | include $(BUILD_STATIC_LIBRARY) |
| 49 | |
| 50 | include $(CLEAR_VARS) |
Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 51 | LOCAL_CPP_EXTENSION := .cc |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 52 | LOCAL_SRC_FILES := $(libziparchive_source_files) |
Dan Albert | 1ae0764 | 2015-04-09 14:11:18 -0700 | [diff] [blame] | 53 | LOCAL_STATIC_LIBRARIES := libz libutils libbase |
Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 54 | LOCAL_MODULE:= libziparchive-host |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 55 | LOCAL_CFLAGS := $(libziparchive_common_c_flags) |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 56 | LOCAL_CFLAGS_windows := -mno-ms-bitfields |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 57 | LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) |
Adam Lesinski | ad4ad8c | 2015-10-05 18:16:18 -0700 | [diff] [blame] | 58 | |
Ian Rogers | 5af80aa | 2014-06-17 01:50:25 -0700 | [diff] [blame] | 59 | LOCAL_MULTILIB := both |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 60 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 61 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 62 | |
| 63 | include $(CLEAR_VARS) |
Ian Rogers | 40ac96c | 2014-10-30 09:53:38 -0700 | [diff] [blame] | 64 | LOCAL_CPP_EXTENSION := .cc |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 65 | LOCAL_SRC_FILES := $(libziparchive_source_files) |
Evgenii Stepanov | 953314f | 2015-06-29 16:27:44 -0700 | [diff] [blame] | 66 | LOCAL_STATIC_LIBRARIES := libutils |
| 67 | LOCAL_SHARED_LIBRARIES := libz-host liblog libbase |
Ian Rogers | 40ac96c | 2014-10-30 09:53:38 -0700 | [diff] [blame] | 68 | LOCAL_MODULE:= libziparchive-host |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 69 | LOCAL_CFLAGS := $(libziparchive_common_c_flags) |
| 70 | LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) |
Ian Rogers | 40ac96c | 2014-10-30 09:53:38 -0700 | [diff] [blame] | 71 | LOCAL_MULTILIB := both |
| 72 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 73 | |
Dan Albert | 27d166c | 2014-10-16 20:47:51 -0700 | [diff] [blame] | 74 | # Tests. |
Ian Rogers | 40ac96c | 2014-10-30 09:53:38 -0700 | [diff] [blame] | 75 | include $(CLEAR_VARS) |
Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 76 | LOCAL_MODULE := ziparchive-tests |
| 77 | LOCAL_CPP_EXTENSION := .cc |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 78 | LOCAL_CFLAGS := $(libziparchive_common_c_flags) |
| 79 | LOCAL_CPPFLAGS := $(libziparchive_common_cpp_flags) |
| 80 | LOCAL_SRC_FILES := $(libziparchive_test_files) |
| 81 | LOCAL_SHARED_LIBRARIES := \ |
| 82 | libbase \ |
| 83 | liblog \ |
| 84 | |
| 85 | LOCAL_STATIC_LIBRARIES := \ |
| 86 | libziparchive \ |
| 87 | libz \ |
| 88 | libutils \ |
| 89 | |
Narayan Kamath | 7462f02 | 2013-11-21 13:05:04 +0000 | [diff] [blame] | 90 | include $(BUILD_NATIVE_TEST) |
Narayan Kamath | 58aaf46 | 2013-12-10 16:47:14 +0000 | [diff] [blame] | 91 | |
| 92 | include $(CLEAR_VARS) |
| 93 | LOCAL_MODULE := ziparchive-tests-host |
| 94 | LOCAL_CPP_EXTENSION := .cc |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 95 | LOCAL_CFLAGS := $(libziparchive_common_c_flags) |
| 96 | LOCAL_CPPFLAGS := -Wno-unnamed-type-template-args $(libziparchive_common_cpp_flags) |
| 97 | LOCAL_SRC_FILES := $(libziparchive_test_files) |
Ian Rogers | 40ac96c | 2014-10-30 09:53:38 -0700 | [diff] [blame] | 98 | LOCAL_STATIC_LIBRARIES := \ |
Yabin Cui | b2a7700 | 2016-02-08 16:26:33 -0800 | [diff] [blame] | 99 | libziparchive-host \ |
Dan Albert | 27d166c | 2014-10-16 20:47:51 -0700 | [diff] [blame] | 100 | libz \ |
Yabin Cui | b2a7700 | 2016-02-08 16:26:33 -0800 | [diff] [blame] | 101 | libbase \ |
| 102 | libutils \ |
| 103 | liblog \ |
Christopher Ferris | e6884ce | 2015-11-10 14:55:12 -0800 | [diff] [blame] | 104 | |
Yabin Cui | b2a7700 | 2016-02-08 16:26:33 -0800 | [diff] [blame] | 105 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Narayan Kamath | 58aaf46 | 2013-12-10 16:47:14 +0000 | [diff] [blame] | 106 | include $(BUILD_HOST_NATIVE_TEST) |