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 := \ |
| 20 | src/algorithm.cpp \ |
| 21 | src/bind.cpp \ |
| 22 | src/chrono.cpp \ |
| 23 | src/condition_variable.cpp \ |
| 24 | src/debug.cpp \ |
| 25 | src/exception.cpp \ |
| 26 | src/future.cpp \ |
| 27 | src/hash.cpp \ |
| 28 | src/ios.cpp \ |
| 29 | src/iostream.cpp \ |
| 30 | src/locale.cpp \ |
| 31 | src/memory.cpp \ |
| 32 | src/mutex.cpp \ |
| 33 | src/new.cpp \ |
| 34 | src/optional.cpp \ |
| 35 | src/random.cpp \ |
| 36 | src/regex.cpp \ |
| 37 | src/shared_mutex.cpp \ |
| 38 | src/stdexcept.cpp \ |
| 39 | src/string.cpp \ |
| 40 | src/strstream.cpp \ |
| 41 | src/system_error.cpp \ |
| 42 | src/thread.cpp \ |
| 43 | src/typeinfo.cpp \ |
| 44 | src/utility.cpp \ |
| 45 | src/valarray.cpp \ |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 46 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 47 | LIBCXX_C_INCLUDES := \ |
| 48 | $(LOCAL_PATH)/include/ \ |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 49 | external/libcxxabi/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 | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 52 | -std=c++11 \ |
Dan Albert | 8a6f7b1 | 2014-05-01 17:49:58 -0700 | [diff] [blame] | 53 | -nostdinc++ \ |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 54 | -fexceptions \ |
| 55 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 56 | # target static lib |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 57 | include $(CLEAR_VARS) |
Dan Albert | b82dd13 | 2014-09-26 15:43:43 -0700 | [diff] [blame] | 58 | LOCAL_MODULE := libc++_static |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 59 | LOCAL_CLANG := true |
| 60 | LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES) |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 61 | LOCAL_C_INCLUDES := $(LIBCXX_C_INCLUDES) |
| 62 | LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) |
Dan Albert | f155054 | 2014-05-06 14:16:05 -0700 | [diff] [blame] | 63 | LOCAL_RTTI_FLAG := -frtti |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 64 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++abi libcompiler_rt |
Dan Albert | c4ecec1 | 2014-09-15 12:54:16 -0700 | [diff] [blame] | 65 | LOCAL_CXX_STL := none |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 66 | include $(BUILD_STATIC_LIBRARY) |
| 67 | |
| 68 | # target dynamic lib |
| 69 | include $(CLEAR_VARS) |
| 70 | LOCAL_MODULE := libc++ |
| 71 | LOCAL_CLANG := true |
Dan Albert | b82dd13 | 2014-09-26 15:43:43 -0700 | [diff] [blame] | 72 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++_static |
Dan Albert | 9569f04 | 2014-05-01 18:12:37 -0700 | [diff] [blame] | 73 | LOCAL_SHARED_LIBRARIES := libdl |
Dan Albert | c4ecec1 | 2014-09-15 12:54:16 -0700 | [diff] [blame] | 74 | LOCAL_CXX_STL := none |
Dan Albert | 1640950 | 2015-02-17 11:31:42 -0800 | [diff] [blame] | 75 | include $(BUILD_SHARED_LIBRARY) |
Dan Albert | 226cd95 | 2014-04-16 10:58:40 -0700 | [diff] [blame] | 76 | |
Dan Albert | 1640950 | 2015-02-17 11:31:42 -0800 | [diff] [blame] | 77 | # NDK static lib |
| 78 | include $(CLEAR_VARS) |
| 79 | LOCAL_MODULE := libc++_ndk |
| 80 | LOCAL_CLANG := true |
| 81 | LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES) |
| 82 | LOCAL_C_INCLUDES := $(LIBCXX_C_INCLUDES) |
| 83 | LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) |
| 84 | LOCAL_RTTI_FLAG := -frtti |
| 85 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++abi libcompiler_rt |
| 86 | LOCAL_CXX_STL := none |
| 87 | include $(BUILD_STATIC_LIBRARY) |
Dan Albert | 226cd95 | 2014-04-16 10:58:40 -0700 | [diff] [blame] | 88 | |
Dan Albert | 1640950 | 2015-02-17 11:31:42 -0800 | [diff] [blame] | 89 | # NDK dynamic lib |
| 90 | include $(CLEAR_VARS) |
| 91 | LOCAL_MODULE := libc++_ndk |
| 92 | LOCAL_CLANG := true |
| 93 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++_ndk |
| 94 | LOCAL_STATIC_LIBRARIES := libc_ndk |
| 95 | LOCAL_SHARED_LIBRARIES := libdl |
| 96 | LOCAL_SYSTEM_SHARED_LIBRARIES := libc |
| 97 | LOCAL_LDFLAGS := -Wl,--hash-style=sysv |
| 98 | LOCAL_CXX_STL := none |
| 99 | LOCAL_STRIP_MODULE := keep_symbols |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 100 | include $(BUILD_SHARED_LIBRARY) |
| 101 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 102 | # host static lib |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 103 | include $(CLEAR_VARS) |
Dan Albert | b82dd13 | 2014-09-26 15:43:43 -0700 | [diff] [blame] | 104 | LOCAL_MODULE := libc++_static |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 105 | LOCAL_CLANG := true |
| 106 | LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES) |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 107 | LOCAL_C_INCLUDES := $(LIBCXX_C_INCLUDES) |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 108 | LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) |
Dan Albert | f155054 | 2014-05-06 14:16:05 -0700 | [diff] [blame] | 109 | LOCAL_RTTI_FLAG := -frtti |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 110 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++abi |
Ian Rogers | ada2964 | 2014-06-05 11:09:44 -0700 | [diff] [blame] | 111 | LOCAL_MULTILIB := both |
Dan Albert | c4ecec1 | 2014-09-15 12:54:16 -0700 | [diff] [blame] | 112 | LOCAL_CXX_STL := none |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 113 | |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 114 | ifneq ($(HOST_OS), darwin) |
| 115 | LOCAL_WHOLE_STATIC_LIBRARIES += libcompiler_rt |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 116 | endif |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 117 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 118 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 119 | |
Ying Wang | b1300bd | 2014-08-01 14:17:08 -0700 | [diff] [blame] | 120 | # Don't build for unbundled branches |
| 121 | ifeq (,$(TARGET_BUILD_APPS)) |
| 122 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 123 | # host dynamic lib |
| 124 | include $(CLEAR_VARS) |
| 125 | LOCAL_MODULE := libc++ |
| 126 | LOCAL_CLANG := true |
| 127 | LOCAL_LDFLAGS := -nodefaultlibs |
| 128 | LOCAL_LDLIBS := -lc |
Dan Albert | b82dd13 | 2014-09-26 15:43:43 -0700 | [diff] [blame] | 129 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++_static |
Ian Rogers | ada2964 | 2014-06-05 11:09:44 -0700 | [diff] [blame] | 130 | LOCAL_MULTILIB := both |
Dan Albert | c4ecec1 | 2014-09-15 12:54:16 -0700 | [diff] [blame] | 131 | LOCAL_CXX_STL := none |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 132 | |
| 133 | ifeq ($(HOST_OS), darwin) |
Dan Albert | 8a6f7b1 | 2014-05-01 17:49:58 -0700 | [diff] [blame] | 134 | LOCAL_LDFLAGS += \ |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 135 | -Wl,-unexported_symbols_list,external/libcxx/lib/libc++unexp.exp \ |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 136 | -Wl,-force_symbols_not_weak_list,external/libcxx/lib/notweak.exp \ |
| 137 | -Wl,-force_symbols_weak_list,external/libcxx/lib/weak.exp |
| 138 | else |
Dan Albert | 7d57f1b | 2014-05-12 14:54:53 -0700 | [diff] [blame] | 139 | LOCAL_LDLIBS += -lrt -lpthread -ldl -lm |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 140 | endif |
| 141 | |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 142 | include $(BUILD_HOST_SHARED_LIBRARY) |
Stephen Hines | 27ae7cb | 2014-04-25 19:13:02 -0700 | [diff] [blame] | 143 | |
Dan Albert | 0f81d76 | 2014-07-18 14:15:56 -0700 | [diff] [blame] | 144 | LIT := $(ANDROID_BUILD_TOP)/external/llvm/utils/lit/lit.py |
Dan Albert | 78f8c19 | 2015-01-07 16:16:05 -0800 | [diff] [blame] | 145 | LIBCXX_CONFIGTESTS := $(ANDROID_BUILD_TOP)/external/libcxx/buildcmds/configtests.py |
| 146 | LIBCXX_TEST_MK := $(ANDROID_BUILD_TOP)/external/libcxx/test.mk |
| 147 | |
| 148 | test-libcxx-target: test-libcxx-target-clang |
| 149 | test-libcxx-host: test-libcxx-host-clang |
| 150 | |
| 151 | test-libcxx-target-clang: libc++ |
| 152 | python $(LIBCXX_CONFIGTESTS) --compiler=clang |
| 153 | LIT=$(LIT) LIT_MODE=device make -f $(LIBCXX_TEST_MK) |
| 154 | test-libcxx-target-gcc: libc++ |
| 155 | python $(LIBCXX_CONFIGTESTS) --compiler=gcc |
| 156 | LIT=$(LIT) LIT_MODE=device make -f $(LIBCXX_TEST_MK) |
| 157 | test-libcxx-target-clang-32: libc++ |
| 158 | python $(LIBCXX_CONFIGTESTS) --bitness=32 --compiler=clang |
| 159 | LIT=$(LIT) LIT_MODE=device make -f $(LIBCXX_TEST_MK) |
| 160 | test-libcxx-target-gcc-32: libc++ |
| 161 | python $(LIBCXX_CONFIGTESTS) --bitness=32 --compiler=gcc |
| 162 | LIT=$(LIT) LIT_MODE=device make -f $(LIBCXX_TEST_MK) |
| 163 | test-libcxx-target-clang-64: libc++ |
| 164 | python $(LIBCXX_CONFIGTESTS) --bitness=64 --compiler=clang |
| 165 | LIT=$(LIT) LIT_MODE=device make -f $(LIBCXX_TEST_MK) |
| 166 | test-libcxx-target-gcc-64: libc++ |
| 167 | python $(LIBCXX_CONFIGTESTS) --bitness=64 --compiler=gcc |
| 168 | LIT=$(LIT) LIT_MODE=device make -f $(LIBCXX_TEST_MK) |
| 169 | |
| 170 | test-libcxx-host-clang: libc++ |
| 171 | python $(LIBCXX_CONFIGTESTS) --compiler=clang --host |
| 172 | LIT=$(LIT) LIT_MODE=host make -f $(LIBCXX_TEST_MK) |
| 173 | test-libcxx-host-gcc: libc++ |
| 174 | python $(LIBCXX_CONFIGTESTS) --compiler=gcc --host |
| 175 | LIT=$(LIT) LIT_MODE=host make -f $(LIBCXX_TEST_MK) |
| 176 | test-libcxx-host-clang-32: libc++ |
| 177 | python $(LIBCXX_CONFIGTESTS) --bitness=32 --compiler=clang --host |
| 178 | LIT=$(LIT) LIT_MODE=host make -f $(LIBCXX_TEST_MK) |
| 179 | test-libcxx-host-gcc-32: libc++ |
| 180 | python $(LIBCXX_CONFIGTESTS) --bitness=32 --compiler=gcc --host |
| 181 | LIT=$(LIT) LIT_MODE=host make -f $(LIBCXX_TEST_MK) |
| 182 | test-libcxx-host-clang-64: libc++ |
| 183 | python $(LIBCXX_CONFIGTESTS) --bitness=64 --compiler=clang --host |
| 184 | LIT=$(LIT) LIT_MODE=host make -f $(LIBCXX_TEST_MK) |
| 185 | test-libcxx-host-gcc-64: libc++ |
| 186 | python $(LIBCXX_CONFIGTESTS) --bitness=64 --compiler=gcc --host |
| 187 | LIT=$(LIT) LIT_MODE=host make -f $(LIBCXX_TEST_MK) |
Dan Albert | 0f81d76 | 2014-07-18 14:15:56 -0700 | [diff] [blame] | 188 | |
| 189 | # Don't want to just make test-libcxx-(host|target) dependencies of this because |
| 190 | # the two families can't be run concurrently. |
| 191 | test-libcxx: libc++ |
Dan Albert | 78f8c19 | 2015-01-07 16:16:05 -0800 | [diff] [blame] | 192 | python buildcmds/configtests.py --host |
Dan Albert | 0f81d76 | 2014-07-18 14:15:56 -0700 | [diff] [blame] | 193 | LIT=$(LIT) LIT_MODE=host make -f $(ANDROID_BUILD_TOP)/external/libcxx/test.mk |
Dan Albert | 78f8c19 | 2015-01-07 16:16:05 -0800 | [diff] [blame] | 194 | python buildcmds/configtests.py |
Dan Albert | 0f81d76 | 2014-07-18 14:15:56 -0700 | [diff] [blame] | 195 | LIT=$(LIT) LIT_MODE=device make -f $(ANDROID_BUILD_TOP)/external/libcxx/test.mk |
| 196 | |
Stephen Hines | 27ae7cb | 2014-04-25 19:13:02 -0700 | [diff] [blame] | 197 | endif # TARGET_BUILD_APPS |