Tim Murray | 9e8bf2c | 2013-03-06 10:12:22 -0800 | [diff] [blame] | 1 | # Don't build the library in unbundled branches. |
| 2 | ifeq (,$(TARGET_BUILD_APPS)) |
| 3 | |
Stephen Hines | f71d14a | 2013-02-27 13:34:21 -0800 | [diff] [blame] | 4 | LOCAL_PATH:= $(call my-dir) |
| 5 | |
Tong Shen | e559960 | 2014-09-19 12:02:00 -0700 | [diff] [blame] | 6 | clang_whole_static_libraries := \ |
Stephen Hines | f71d14a | 2013-02-27 13:34:21 -0800 | [diff] [blame] | 7 | libclangAnalysis \ |
Stephen Hines | f71d14a | 2013-02-27 13:34:21 -0800 | [diff] [blame] | 8 | libclangAST \ |
Tao Bao | db719ce | 2015-02-19 14:45:44 -0800 | [diff] [blame] | 9 | libclangASTMatchers \ |
Stephen Hines | f71d14a | 2013-02-27 13:34:21 -0800 | [diff] [blame] | 10 | libclangBasic \ |
Tao Bao | db719ce | 2015-02-19 14:45:44 -0800 | [diff] [blame] | 11 | libclangCodeGen \ |
| 12 | libclangDriver \ |
| 13 | libclangEdit \ |
| 14 | libclangFormat \ |
| 15 | libclangFrontend \ |
| 16 | libclangIndex \ |
| 17 | libclangLex \ |
| 18 | libclangLibclang \ |
| 19 | libclangParse \ |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 20 | libclangRewrite \ |
Todd Fiala | 3313f88 | 2013-10-22 16:11:47 -0700 | [diff] [blame] | 21 | libclangRewriteFrontend \ |
Tao Bao | db719ce | 2015-02-19 14:45:44 -0800 | [diff] [blame] | 22 | libclangSema \ |
| 23 | libclangSerialization \ |
| 24 | libclangTooling |
Stephen Hines | f71d14a | 2013-02-27 13:34:21 -0800 | [diff] [blame] | 25 | |
Tong Shen | e559960 | 2014-09-19 12:02:00 -0700 | [diff] [blame] | 26 | # host |
| 27 | include $(CLEAR_VARS) |
| 28 | |
| 29 | LOCAL_IS_HOST_MODULE := true |
| 30 | LOCAL_MODULE:= libclang |
| 31 | LOCAL_MODULE_TAGS := optional |
| 32 | LOCAL_WHOLE_STATIC_LIBRARIES := $(clang_whole_static_libraries) |
Josh Gao | 4e42e0f | 2016-04-13 17:03:52 -0700 | [diff] [blame] | 33 | LOCAL_EXPORT_C_INCLUDE_DIRS += \ |
| 34 | $(LOCAL_PATH)/include \ |
| 35 | external/llvm/include \ |
| 36 | external/llvm/device/include |
Stephen Hines | f71d14a | 2013-02-27 13:34:21 -0800 | [diff] [blame] | 37 | |
Dan Willemsen | 2d2dc9f | 2015-08-18 17:06:48 -0700 | [diff] [blame] | 38 | LOCAL_SHARED_LIBRARIES := libLLVM |
| 39 | |
| 40 | LOCAL_LDLIBS_windows := -limagehlp -lpsapi |
| 41 | |
| 42 | LOCAL_SHARED_LIBRARIES_darwin := libc++ |
| 43 | LOCAL_SHARED_LIBRARIES_linux := libc++ |
| 44 | LOCAL_LDLIBS_darwin := -ldl -lpthread |
| 45 | LOCAL_LDLIBS_linux := -ldl -lpthread |
Stephen Hines | f71d14a | 2013-02-27 13:34:21 -0800 | [diff] [blame] | 46 | |
| 47 | include $(CLANG_HOST_BUILD_MK) |
Tim Murray | 9e8bf2c | 2013-03-06 10:12:22 -0800 | [diff] [blame] | 48 | |
Dan Willemsen | 2d2dc9f | 2015-08-18 17:06:48 -0700 | [diff] [blame] | 49 | # Don't build the library unless forced to. We don't |
| 50 | # have prebuilts for windows. |
| 51 | ifneq (true,$(FORCE_BUILD_LLVM_COMPONENTS)) |
| 52 | LOCAL_MODULE_HOST_OS := windows |
Dan Willemsen | 2d2dc9f | 2015-08-18 17:06:48 -0700 | [diff] [blame] | 53 | else |
| 54 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Willemsen | 2d2dc9f | 2015-08-18 17:06:48 -0700 | [diff] [blame] | 55 | endif |
| 56 | |
Dan Willemsen | f1f1bc3 | 2015-09-02 13:30:48 -0700 | [diff] [blame] | 57 | include $(BUILD_HOST_SHARED_LIBRARY) |
Dan Willemsen | 2d2dc9f | 2015-08-18 17:06:48 -0700 | [diff] [blame] | 58 | |
| 59 | # Don't build the library unless forced to. |
| 60 | ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS)) |
Tong Shen | e559960 | 2014-09-19 12:02:00 -0700 | [diff] [blame] | 61 | # device |
| 62 | include $(CLEAR_VARS) |
| 63 | |
| 64 | LOCAL_MODULE:= libclang |
| 65 | LOCAL_MODULE_TAGS := optional |
| 66 | LOCAL_WHOLE_STATIC_LIBRARIES := $(clang_whole_static_libraries) |
| 67 | |
| 68 | LOCAL_SHARED_LIBRARIES := libLLVM libc++ |
| 69 | LOCAL_LDLIBS := -ldl |
| 70 | |
| 71 | include $(CLANG_DEVICE_BUILD_MK) |
| 72 | include $(BUILD_SHARED_LIBRARY) |
Dan Willemsen | 2d2dc9f | 2015-08-18 17:06:48 -0700 | [diff] [blame] | 73 | endif # don't build unless forced to |
Tong Shen | e559960 | 2014-09-19 12:02:00 -0700 | [diff] [blame] | 74 | |
Stephen Hines | ce5d5dc | 2013-09-06 16:53:40 -0700 | [diff] [blame] | 75 | endif # don't build in unbundled branches |