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 | |
Stephen Hines | 27ae7cb | 2014-04-25 19:13:02 -0700 | [diff] [blame] | 17 | # Don't build for unbundled branches |
| 18 | ifeq (,$(TARGET_BUILD_APPS)) |
| 19 | |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 20 | LOCAL_PATH := $(call my-dir) |
| 21 | |
| 22 | LIBCXX_SRC_FILES := \ |
| 23 | src/algorithm.cpp \ |
| 24 | src/bind.cpp \ |
| 25 | src/chrono.cpp \ |
| 26 | src/condition_variable.cpp \ |
| 27 | src/debug.cpp \ |
| 28 | src/exception.cpp \ |
| 29 | src/future.cpp \ |
| 30 | src/hash.cpp \ |
| 31 | src/ios.cpp \ |
| 32 | src/iostream.cpp \ |
| 33 | src/locale.cpp \ |
| 34 | src/memory.cpp \ |
| 35 | src/mutex.cpp \ |
| 36 | src/new.cpp \ |
| 37 | src/optional.cpp \ |
| 38 | src/random.cpp \ |
| 39 | src/regex.cpp \ |
| 40 | src/shared_mutex.cpp \ |
| 41 | src/stdexcept.cpp \ |
| 42 | src/string.cpp \ |
| 43 | src/strstream.cpp \ |
| 44 | src/system_error.cpp \ |
| 45 | src/thread.cpp \ |
| 46 | src/typeinfo.cpp \ |
| 47 | src/utility.cpp \ |
| 48 | src/valarray.cpp \ |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 49 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 50 | LIBCXX_C_INCLUDES := \ |
| 51 | $(LOCAL_PATH)/include/ \ |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 52 | external/libcxxabi/include \ |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 53 | |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 54 | LIBCXX_CPPFLAGS := \ |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 55 | -std=c++11 \ |
Dan Albert | 8a6f7b1 | 2014-05-01 17:49:58 -0700 | [diff] [blame] | 56 | -nostdinc++ \ |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 57 | -fexceptions \ |
| 58 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 59 | # target static lib |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 60 | include $(CLEAR_VARS) |
| 61 | LOCAL_MODULE := libc++ |
| 62 | LOCAL_CLANG := true |
| 63 | LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES) |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 64 | LOCAL_C_INCLUDES := $(LIBCXX_C_INCLUDES) |
| 65 | LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) |
Dan Albert | f155054 | 2014-05-06 14:16:05 -0700 | [diff] [blame] | 66 | LOCAL_RTTI_FLAG := -frtti |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 67 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++abi libcompiler_rt |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 68 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 69 | include $(BUILD_STATIC_LIBRARY) |
| 70 | |
| 71 | # target dynamic lib |
| 72 | include $(CLEAR_VARS) |
| 73 | LOCAL_MODULE := libc++ |
| 74 | LOCAL_CLANG := true |
| 75 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++ |
Dan Albert | 9569f04 | 2014-05-01 18:12:37 -0700 | [diff] [blame] | 76 | LOCAL_SHARED_LIBRARIES := libdl |
Dan Albert | 32ec1ea | 2014-05-23 18:44:06 -0700 | [diff] [blame] | 77 | LOCAL_SYSTEM_SHARED_LIBRARIES := libc libm |
Dan Albert | 226cd95 | 2014-04-16 10:58:40 -0700 | [diff] [blame] | 78 | |
Dan Albert | c10e719 | 2014-04-16 16:38:42 -0700 | [diff] [blame] | 79 | ifneq ($(TARGET_ARCH),arm) |
Dan Albert | 226cd95 | 2014-04-16 10:58:40 -0700 | [diff] [blame] | 80 | LOCAL_SHARED_LIBRARIES += libdl |
| 81 | endif |
| 82 | |
Brian Carlstrom | 12c2891 | 2014-05-09 20:47:13 -0700 | [diff] [blame] | 83 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 84 | include $(BUILD_SHARED_LIBRARY) |
| 85 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 86 | # host static lib |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 87 | include $(CLEAR_VARS) |
| 88 | LOCAL_MODULE := libc++ |
| 89 | LOCAL_CLANG := true |
| 90 | LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES) |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 91 | LOCAL_C_INCLUDES := $(LIBCXX_C_INCLUDES) |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 92 | LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) |
Dan Albert | f155054 | 2014-05-06 14:16:05 -0700 | [diff] [blame] | 93 | LOCAL_RTTI_FLAG := -frtti |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 94 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++abi |
Ian Rogers | ada2964 | 2014-06-05 11:09:44 -0700 | [diff] [blame] | 95 | LOCAL_MULTILIB := both |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 96 | |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 97 | ifneq ($(HOST_OS), darwin) |
| 98 | LOCAL_WHOLE_STATIC_LIBRARIES += libcompiler_rt |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 99 | endif |
Dan Albert | 3bfb944 | 2014-06-23 16:32:13 -0700 | [diff] [blame] | 100 | |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 101 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 102 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 103 | |
| 104 | # host dynamic lib |
| 105 | include $(CLEAR_VARS) |
| 106 | LOCAL_MODULE := libc++ |
| 107 | LOCAL_CLANG := true |
| 108 | LOCAL_LDFLAGS := -nodefaultlibs |
| 109 | LOCAL_LDLIBS := -lc |
| 110 | LOCAL_WHOLE_STATIC_LIBRARIES := libc++ |
Ian Rogers | ada2964 | 2014-06-05 11:09:44 -0700 | [diff] [blame] | 111 | LOCAL_MULTILIB := both |
Dan Albert | 6c2fdb8 | 2014-05-16 09:55:15 -0700 | [diff] [blame] | 112 | |
| 113 | ifeq ($(HOST_OS), darwin) |
Dan Albert | 8a6f7b1 | 2014-05-01 17:49:58 -0700 | [diff] [blame] | 114 | LOCAL_LDFLAGS += \ |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 115 | -Wl,-unexported_symbols_list,external/libcxx/lib/libc++unexp.exp \ |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 116 | -Wl,-force_symbols_not_weak_list,external/libcxx/lib/notweak.exp \ |
| 117 | -Wl,-force_symbols_weak_list,external/libcxx/lib/weak.exp |
| 118 | else |
Dan Albert | 7d57f1b | 2014-05-12 14:54:53 -0700 | [diff] [blame] | 119 | LOCAL_LDLIBS += -lrt -lpthread -ldl -lm |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 120 | endif |
| 121 | |
Brian Carlstrom | 12c2891 | 2014-05-09 20:47:13 -0700 | [diff] [blame] | 122 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 123 | include $(BUILD_HOST_SHARED_LIBRARY) |
Stephen Hines | 27ae7cb | 2014-04-25 19:13:02 -0700 | [diff] [blame] | 124 | |
Dan Albert | 0f81d76 | 2014-07-18 14:15:56 -0700 | [diff] [blame] | 125 | LIT := $(ANDROID_BUILD_TOP)/external/llvm/utils/lit/lit.py |
| 126 | test-libcxx-host: libc++ |
| 127 | LIT=$(LIT) LIT_MODE=host make -f $(ANDROID_BUILD_TOP)/external/libcxx/test.mk |
| 128 | test-libcxx-target: libc++ |
| 129 | LIT=$(LIT) LIT_MODE=device make -f $(ANDROID_BUILD_TOP)/external/libcxx/test.mk |
| 130 | |
| 131 | # Don't want to just make test-libcxx-(host|target) dependencies of this because |
| 132 | # the two families can't be run concurrently. |
| 133 | test-libcxx: libc++ |
| 134 | LIT=$(LIT) LIT_MODE=host make -f $(ANDROID_BUILD_TOP)/external/libcxx/test.mk |
| 135 | LIT=$(LIT) LIT_MODE=device make -f $(ANDROID_BUILD_TOP)/external/libcxx/test.mk |
| 136 | |
Stephen Hines | 27ae7cb | 2014-04-25 19:13:02 -0700 | [diff] [blame] | 137 | endif # TARGET_BUILD_APPS |