blob: 8a4921fc57eb1ea60b68721119359d008f05b661 [file] [log] [blame]
Narayan Kamath7462f022013-11-21 13:05:04 +00001#
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
16LOCAL_PATH := $(call my-dir)
Narayan Kamath7462f022013-11-21 13:05:04 +000017
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070018source_files := zip_archive.cc zip_writer.cc
19test_files := zip_archive_test.cc zip_writer_test.cc entry_name_utils_test.cc
20
Adam Lesinski591fd392015-10-06 15:23:46 -070021# ZLIB_CONST turns on const for input buffers, which is pretty standard.
22common_c_flags := -Werror -Wall -DZLIB_CONST
23
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070024# Incorrectly warns when C++11 empty brace {} initializer is used.
25# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61489
Adam Lesinski591fd392015-10-06 15:23:46 -070026common_cpp_flags := -Wold-style-cast -Wno-missing-field-initializers
Narayan Kamath7462f022013-11-21 13:05:04 +000027
Dan Albert27d166c2014-10-16 20:47:51 -070028include $(CLEAR_VARS)
Narayan Kamath7462f022013-11-21 13:05:04 +000029LOCAL_CPP_EXTENSION := .cc
30LOCAL_SRC_FILES := ${source_files}
Narayan Kamath7462f022013-11-21 13:05:04 +000031LOCAL_STATIC_LIBRARIES := libz
Dan Albert1ae07642015-04-09 14:11:18 -070032LOCAL_SHARED_LIBRARIES := libutils libbase
Narayan Kamath7462f022013-11-21 13:05:04 +000033LOCAL_MODULE:= libziparchive
Adam Lesinski591fd392015-10-06 15:23:46 -070034LOCAL_CFLAGS := $(common_c_flags)
35LOCAL_CPPFLAGS := $(common_cpp_flags)
Narayan Kamath7462f022013-11-21 13:05:04 +000036include $(BUILD_STATIC_LIBRARY)
37
38include $(CLEAR_VARS)
Narayan Kamath7462f022013-11-21 13:05:04 +000039LOCAL_CPP_EXTENSION := .cc
40LOCAL_SRC_FILES := ${source_files}
Dan Albert1ae07642015-04-09 14:11:18 -070041LOCAL_STATIC_LIBRARIES := libz libutils libbase
Narayan Kamath7462f022013-11-21 13:05:04 +000042LOCAL_MODULE:= libziparchive-host
Adam Lesinski591fd392015-10-06 15:23:46 -070043LOCAL_CFLAGS := $(common_c_flags)
Dan Willemsen87a419c2015-08-13 14:43:34 -070044LOCAL_CFLAGS_windows := -mno-ms-bitfields
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070045LOCAL_CPPFLAGS := $(common_cpp_flags)
46
Ian Rogers5af80aa2014-06-17 01:50:25 -070047LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070048LOCAL_MODULE_HOST_OS := darwin linux windows
Narayan Kamath7462f022013-11-21 13:05:04 +000049include $(BUILD_HOST_STATIC_LIBRARY)
50
51include $(CLEAR_VARS)
Ian Rogers40ac96c2014-10-30 09:53:38 -070052LOCAL_CPP_EXTENSION := .cc
53LOCAL_SRC_FILES := ${source_files}
Evgenii Stepanov953314f2015-06-29 16:27:44 -070054LOCAL_STATIC_LIBRARIES := libutils
55LOCAL_SHARED_LIBRARIES := libz-host liblog libbase
Ian Rogers40ac96c2014-10-30 09:53:38 -070056LOCAL_MODULE:= libziparchive-host
Adam Lesinski591fd392015-10-06 15:23:46 -070057LOCAL_CFLAGS := $(common_c_flags)
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070058LOCAL_CPPFLAGS := $(common_cpp_flags)
Ian Rogers40ac96c2014-10-30 09:53:38 -070059LOCAL_MULTILIB := both
60include $(BUILD_HOST_SHARED_LIBRARY)
61
Dan Albert27d166c2014-10-16 20:47:51 -070062# Tests.
Ian Rogers40ac96c2014-10-30 09:53:38 -070063include $(CLEAR_VARS)
Narayan Kamath7462f022013-11-21 13:05:04 +000064LOCAL_MODULE := ziparchive-tests
65LOCAL_CPP_EXTENSION := .cc
Adam Lesinski591fd392015-10-06 15:23:46 -070066LOCAL_CFLAGS := $(common_c_flags)
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070067LOCAL_CPPFLAGS := $(common_cpp_flags)
68LOCAL_SRC_FILES := $(test_files)
Dan Albert1ae07642015-04-09 14:11:18 -070069LOCAL_SHARED_LIBRARIES := liblog libbase
Dan Albert27d166c2014-10-16 20:47:51 -070070LOCAL_STATIC_LIBRARIES := libziparchive libz libutils
Narayan Kamath7462f022013-11-21 13:05:04 +000071include $(BUILD_NATIVE_TEST)
Narayan Kamath58aaf462013-12-10 16:47:14 +000072
73include $(CLEAR_VARS)
74LOCAL_MODULE := ziparchive-tests-host
75LOCAL_CPP_EXTENSION := .cc
Adam Lesinski591fd392015-10-06 15:23:46 -070076LOCAL_CFLAGS := $(common_c_flags)
Adam Lesinskiad4ad8c2015-10-05 18:16:18 -070077LOCAL_CPPFLAGS := -Wno-unnamed-type-template-args $(common_cpp_flags)
78LOCAL_SRC_FILES := $(test_files)
Dan Albert1ae07642015-04-09 14:11:18 -070079LOCAL_SHARED_LIBRARIES := libziparchive-host liblog libbase
Ian Rogers40ac96c2014-10-30 09:53:38 -070080LOCAL_STATIC_LIBRARIES := \
Dan Albert27d166c2014-10-16 20:47:51 -070081 libz \
82 libutils
Narayan Kamath58aaf462013-12-10 16:47:14 +000083include $(BUILD_HOST_NATIVE_TEST)