Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2014 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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
| 19 | LIBCXX_SRC_FILES := \ |
Dan Albert | 4b1aaf9 | 2015-08-12 13:21:00 -0700 | [diff] [blame] | 20 | src/algorithm.cpp \ |
| 21 | src/any.cpp \ |
| 22 | src/bind.cpp \ |
| 23 | src/chrono.cpp \ |
| 24 | src/condition_variable.cpp \ |
Dan Albert | 4b1aaf9 | 2015-08-12 13:21:00 -0700 | [diff] [blame] | 25 | src/debug.cpp \ |
| 26 | src/exception.cpp \ |
| 27 | src/future.cpp \ |
| 28 | src/hash.cpp \ |
| 29 | src/ios.cpp \ |
| 30 | src/iostream.cpp \ |
| 31 | src/locale.cpp \ |
| 32 | src/memory.cpp \ |
| 33 | src/mutex.cpp \ |
| 34 | src/new.cpp \ |
| 35 | src/optional.cpp \ |
| 36 | src/random.cpp \ |
| 37 | src/regex.cpp \ |
| 38 | src/shared_mutex.cpp \ |
| 39 | src/stdexcept.cpp \ |
| 40 | src/string.cpp \ |
| 41 | src/strstream.cpp \ |
Dan Albert | 4b1aaf9 | 2015-08-12 13:21:00 -0700 | [diff] [blame] | 42 | src/system_error.cpp \ |
| 43 | src/thread.cpp \ |
| 44 | src/typeinfo.cpp \ |
| 45 | src/utility.cpp \ |
| 46 | src/valarray.cpp \ |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 47 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 48 | LIBCXX_C_INCLUDES := \ |
Dan Albert | 4b1aaf9 | 2015-08-12 13:21:00 -0700 | [diff] [blame] | 49 | $(LOCAL_PATH)/include/ \ |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 50 | |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 51 | LIBCXX_CPPFLAGS := \ |
Dan Albert | 4b1aaf9 | 2015-08-12 13:21:00 -0700 | [diff] [blame] | 52 | -std=c++14 \ |
| 53 | -nostdinc++ \ |
| 54 | -fexceptions \ |
Dan Austin | 1418e41 | 2016-05-24 16:24:42 -0700 | [diff] [blame] | 55 | -DLIBCXX_BUILDING_LIBCXXABI \ |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 56 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 57 | # target static lib |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 58 | include $(CLEAR_VARS) |
Dan Albert | b82dd13 | 2014-09-26 15:43:43 -0700 | [diff] [blame] | 59 | LOCAL_MODULE := libc++_static |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 60 | LOCAL_CLANG := true |
| 61 | LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES) |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 62 | LOCAL_C_INCLUDES := $(LIBCXX_C_INCLUDES) |
Dan Albert | 0ad34df | 2015-09-24 16:29:07 -0700 | [diff] [blame] | 63 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include external/libcxxabi/include |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 64 | LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) |
Dan Albert | f155054 | 2014-05-06 14:16:05 -0700 | [diff] [blame] | 65 | LOCAL_RTTI_FLAG := -frtti |
Dan Albert | 8d0c51f | 2015-04-01 15:19:05 -0700 | [diff] [blame] | 66 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++abi |
Dan Albert | c4ecec1 | 2014-09-15 12:54:16 -0700 | [diff] [blame] | 67 | LOCAL_CXX_STL := none |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 68 | include $(BUILD_STATIC_LIBRARY) |
| 69 | |
| 70 | # target dynamic lib |
| 71 | include $(CLEAR_VARS) |
| 72 | LOCAL_MODULE := libc++ |
| 73 | LOCAL_CLANG := true |
Dan Albert | 6029517 | 2015-09-24 14:04:08 -0700 | [diff] [blame] | 74 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include external/libcxxabi/include |
Dan Albert | b82dd13 | 2014-09-26 15:43:43 -0700 | [diff] [blame] | 75 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++_static |
Dan Albert | 9569f04 | 2014-05-01 18:12:37 -0700 | [diff] [blame] | 76 | LOCAL_SHARED_LIBRARIES := libdl |
Dan Albert | c4ecec1 | 2014-09-15 12:54:16 -0700 | [diff] [blame] | 77 | LOCAL_CXX_STL := none |
Dan Albert | 2cfc479 | 2015-03-31 16:33:55 -0700 | [diff] [blame] | 78 | LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm |
Dan Albert | 2ea6337 | 2015-06-23 13:34:02 -0700 | [diff] [blame] | 79 | LOCAL_LDFLAGS_arm := -Wl,--exclude-libs,libunwind_llvm.a |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 80 | include $(BUILD_SHARED_LIBRARY) |
| 81 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 82 | # host static lib |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 83 | include $(CLEAR_VARS) |
Dan Albert | b82dd13 | 2014-09-26 15:43:43 -0700 | [diff] [blame] | 84 | LOCAL_MODULE := libc++_static |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 85 | LOCAL_CLANG := true |
| 86 | LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES) |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 87 | LOCAL_C_INCLUDES := $(LIBCXX_C_INCLUDES) |
Dan Albert | 0ad34df | 2015-09-24 16:29:07 -0700 | [diff] [blame] | 88 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include external/libcxxabi/include |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 89 | LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) |
Dan Albert | f155054 | 2014-05-06 14:16:05 -0700 | [diff] [blame] | 90 | LOCAL_RTTI_FLAG := -frtti |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 91 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++abi |
Ian Rogers | ada2964 | 2014-06-05 11:09:44 -0700 | [diff] [blame] | 92 | LOCAL_MULTILIB := both |
Dan Albert | c4ecec1 | 2014-09-15 12:54:16 -0700 | [diff] [blame] | 93 | LOCAL_CXX_STL := none |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 94 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 95 | |
| 96 | # host dynamic lib |
| 97 | include $(CLEAR_VARS) |
| 98 | LOCAL_MODULE := libc++ |
| 99 | LOCAL_CLANG := true |
Dan Albert | 6029517 | 2015-09-24 14:04:08 -0700 | [diff] [blame] | 100 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include external/libcxxabi/include |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 101 | LOCAL_LDFLAGS := -nodefaultlibs |
Dan Albert | b82dd13 | 2014-09-26 15:43:43 -0700 | [diff] [blame] | 102 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++_static |
Ian Rogers | ada2964 | 2014-06-05 11:09:44 -0700 | [diff] [blame] | 103 | LOCAL_MULTILIB := both |
Dan Albert | c4ecec1 | 2014-09-15 12:54:16 -0700 | [diff] [blame] | 104 | LOCAL_CXX_STL := none |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 105 | |
| 106 | ifeq ($(HOST_OS), darwin) |
Dan Albert | 8a6f7b1 | 2014-05-01 17:49:58 -0700 | [diff] [blame] | 107 | LOCAL_LDFLAGS += \ |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 108 | -Wl,-unexported_symbols_list,external/libcxx/lib/libc++unexp.exp \ |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 109 | -Wl,-force_symbols_not_weak_list,external/libcxx/lib/notweak.exp \ |
| 110 | -Wl,-force_symbols_weak_list,external/libcxx/lib/weak.exp |
| 111 | else |
Dan Albert | 94962fb | 2015-03-03 15:05:07 -0800 | [diff] [blame] | 112 | LOCAL_LDLIBS += -lrt -lpthread -ldl |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 113 | endif |
| 114 | |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 115 | include $(BUILD_HOST_SHARED_LIBRARY) |
Stephen Hines | 27ae7cb | 2014-04-25 19:13:02 -0700 | [diff] [blame] | 116 | |
Dan Albert | b434402 | 2015-10-14 14:41:54 -0700 | [diff] [blame] | 117 | ifdef LIBCXX_TESTING |
| 118 | include $(LOCAL_PATH)/buildcmds/Android.mk |
| 119 | endif |