1#
2# Copyright (C) 2012 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
17LOCAL_PATH:= $(call my-dir)
18
19LLVM_ROOT_PATH := $(LOCAL_PATH)/../../../../../external/llvm
20include $(LLVM_ROOT_PATH)/llvm.mk
21
22llvm_wrap_SRC_FILES := \
23  bitcode_wrapperer.cpp \
24  file_wrapper_input.cpp \
25  file_wrapper_output.cpp \
26  in_memory_wrapper_input.cpp \
27  wrapper_output.cpp
28
29llvm_wrap_C_INCLUDES := $(LOCAL_PATH)/../../include
30
31# For the host
32# =====================================================
33include $(CLEAR_VARS)
34
35LOCAL_MODULE:= libLLVMWrap
36LOCAL_MODULE_TAGS := optional
37
38LOCAL_SRC_FILES := $(llvm_wrap_SRC_FILES)
39LOCAL_CFLAGS += -D__HOST__
40LOCAL_C_INCLUDES := $(llvm_wrap_C_INCLUDES)
41
42include $(LLVM_HOST_BUILD_MK)
43include $(LLVM_GEN_INTRINSICS_MK)
44include $(BUILD_HOST_STATIC_LIBRARY)
45
46# For the device
47# =====================================================
48ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
49include $(CLEAR_VARS)
50
51LOCAL_MODULE:= libLLVMWrap
52LOCAL_MODULE_TAGS := optional
53
54LOCAL_SRC_FILES := $(llvm_wrap_SRC_FILES)
55LOCAL_C_INCLUDES := $(llvm_wrap_C_INCLUDES)
56
57include $(LLVM_DEVICE_BUILD_MK)
58include $(LLVM_GEN_INTRINSICS_MK)
59include $(BUILD_STATIC_LIBRARY)
60endif