Home | History | Annotate | Download | only in libbcc
      1 #
      2 # Copyright (C) 2010-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 
     17 LOCAL_PATH := $(call my-dir)
     18 LIBBCC_ROOT_PATH := $(LOCAL_PATH)
     19 
     20 FORCE_BUILD_LLVM_DISABLE_NDEBUG ?= false
     21 # Legality check: FORCE_BUILD_LLVM_DISABLE_NDEBUG should consist of one word -- either "true" or "false".
     22 ifneq "$(words $(FORCE_BUILD_LLVM_DISABLE_NDEBUG))$(words $(filter-out true false,$(FORCE_BUILD_LLVM_DISABLE_NDEBUG)))" "10"
     23   $(error FORCE_BUILD_LLVM_DISABLE_NDEBUG may only be true, false, or unset)
     24 endif
     25 
     26 FORCE_BUILD_LLVM_DEBUG ?= false
     27 # Legality check: FORCE_BUILD_LLVM_DEBUG should consist of one word -- either "true" or "false".
     28 ifneq "$(words $(FORCE_BUILD_LLVM_DEBUG))$(words $(filter-out true false,$(FORCE_BUILD_LLVM_DEBUG)))" "10"
     29   $(error FORCE_BUILD_LLVM_DEBUG may only be true, false, or unset)
     30 endif
     31 
     32 include $(LIBBCC_ROOT_PATH)/libbcc.mk
     33 
     34 include frameworks/compile/slang/rs_version.mk
     35 
     36 #=====================================================================
     37 # Whole Static Library to Be Linked In
     38 #=====================================================================
     39 
     40 libbcc_WHOLE_STATIC_LIBRARIES += \
     41   libbccRenderscript \
     42   libbccCore \
     43   libbccSupport
     44 
     45 #=====================================================================
     46 # Device Shared Library libbcc
     47 #=====================================================================
     48 ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
     49 
     50 include $(CLEAR_VARS)
     51 
     52 LOCAL_MODULE := libbcc
     53 LOCAL_MODULE_TAGS := optional
     54 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
     55 
     56 LOCAL_WHOLE_STATIC_LIBRARIES := $(libbcc_WHOLE_STATIC_LIBRARIES)
     57 
     58 LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM libdl libutils libcutils liblog libc++
     59 
     60 # Modules that need get installed if and only if the target libbcc.so is
     61 # installed.
     62 LOCAL_REQUIRED_MODULES := libclcore.bc libclcore_debug.bc libclcore_g.bc libcompiler_rt
     63 
     64 LOCAL_REQUIRED_MODULES_x86 += libclcore_x86.bc
     65 LOCAL_REQUIRED_MODULES_x86_64 += libclcore_x86.bc
     66 
     67 ifeq ($(ARCH_ARM_HAVE_NEON),true)
     68   LOCAL_REQUIRED_MODULES_arm += libclcore_neon.bc
     69 endif
     70 
     71 include $(LIBBCC_DEVICE_BUILD_MK)
     72 include $(LLVM_DEVICE_BUILD_MK)
     73 include $(BUILD_SHARED_LIBRARY)
     74 endif
     75 
     76 #=====================================================================
     77 # Host Shared Library libbcc
     78 #=====================================================================
     79 
     80 # Don't build for unbundled branches
     81 ifeq (,$(TARGET_BUILD_APPS))
     82 
     83 include $(CLEAR_VARS)
     84 
     85 LOCAL_MODULE := libbcc
     86 LOCAL_MODULE_HOST_OS := darwin linux windows
     87 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
     88 LOCAL_IS_HOST_MODULE := true
     89 
     90 LOCAL_WHOLE_STATIC_LIBRARIES += $(libbcc_WHOLE_STATIC_LIBRARIES)
     91 
     92 LOCAL_STATIC_LIBRARIES += \
     93   libutils \
     94   libcutils \
     95   liblog
     96 
     97 LOCAL_SHARED_LIBRARIES := libbcinfo
     98 
     99 LOCAL_LDLIBS_darwin := -ldl -lpthread
    100 LOCAL_LDLIBS_linux := -ldl -lpthread
    101 
    102 include $(LIBBCC_ROOT_PATH)/llvm-loadable-libbcc.mk
    103 
    104 ifeq ($(CAN_BUILD_HOST_LLVM_LOADABLE_MODULE),true)
    105 LOCAL_STATIC_LIBRARIES_linux += libLLVMLinker
    106 else
    107 LOCAL_SHARED_LIBRARIES_linux += libLLVM
    108 endif
    109 LOCAL_SHARED_LIBRARIES_darwin += libLLVM
    110 LOCAL_SHARED_LIBRARIES_windows += libLLVM
    111 
    112 include $(LIBBCC_HOST_BUILD_MK)
    113 include $(LLVM_HOST_BUILD_MK)
    114 include $(BUILD_HOST_SHARED_LIBRARY)
    115 
    116 endif # Don't build in unbundled branches
    117 
    118 #=====================================================================
    119 # Include Subdirectories
    120 #=====================================================================
    121 include $(call all-makefiles-under,$(LOCAL_PATH))
    122