1 # 2 # Copyright (C) 2011 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 include $(CLEAR_VARS) 20 LOCAL_MODULE := libclcore.bc 21 LOCAL_MODULE_TAGS := optional 22 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 23 24 LOCAL_SRC_FILES := \ 25 rs_cl.c \ 26 rs_core.c 27 28 29 include $(BUILD_SYSTEM)/base_rules.mk 30 31 clcore_CLANG := $(HOST_OUT_EXECUTABLES)/clang$(HOST_EXECUTABLE_SUFFIX) 32 clcore_LLVM_LINK := $(HOST_OUT_EXECUTABLES)/llvm-link$(HOST_EXECUTABLE_SUFFIX) 33 34 clcore_bc_files := $(patsubst %.c,%.bc, \ 35 $(addprefix $(intermediates)/, $(LOCAL_SRC_FILES))) 36 37 $(clcore_bc_files): PRIVATE_INCLUDES := \ 38 frameworks/base/libs/rs/scriptc \ 39 external/clang/lib/Headers 40 41 $(clcore_bc_files): $(intermediates)/%.bc: $(LOCAL_PATH)/%.c $(clcore_CLANG) 42 @mkdir -p $(dir $@) 43 $(hide) $(clcore_CLANG) $(addprefix -I, $(PRIVATE_INCLUDES)) -MD -std=c99 -c -O3 -fno-builtin -emit-llvm -ccc-host-triple armv7-none-linux-gnueabi $< -o $@ 44 45 -include $(clcore_bc_files:%.bc=%.d) 46 47 $(LOCAL_BUILT_MODULE): PRIVATE_BC_FILES := $(clcore_bc_files) 48 $(LOCAL_BUILT_MODULE) : $(clcore_bc_files) $(clcore_LLVM_LINK) 49 @mkdir -p $(dir $@) 50 $(hide) $(clcore_LLVM_LINK) $(PRIVATE_BC_FILES) -o $@ 51