1# USE_LLVM_EXECUTIONENGINE is not fully implemented. We use libbcc instead. 2USE_LLVM_EXECUTIONENGINE := false 3# If using libLLVMExecutionEngine, 4# need to add files to several Android.mk in external/llvm, and comment out some stuff in 5# llvm DynamicLibrary.cpp and Intercept.cpp 6 7ifeq (0, 1) 8DEBUG_BUILD := false 9 10LOCAL_PATH := $(call my-dir) 11LLVM_ROOT_PATH := external/llvm 12 13# These are for using llvm::ExecutionEngine, also remove libbcc 14# libLLVMX86CodeGen;libLLVMX86Info;libLLVMBitReader;libLLVMSelectionDAG;libLLVMAsmPrinter;libLLVMJIT;libLLVMCodeGen;libLLVMTarget;libLLVMMC;libLLVMScalarOpts;libLLVMipo;libLLVMTransformUtils;libLLVMCore;libLLVMSupport;libLLVMSystem;libLLVMAnalysis;libLLVMInstCombine;libLLVMipa;libLLVMMCParser;libLLVMExecutionEngine; 15libMesa_STATIC_LIBS := \ 16 libLLVMBitReader \ 17 libLLVMSelectionDAG \ 18 libLLVMAsmPrinter \ 19 libLLVMJIT \ 20 libLLVMCodeGen \ 21 libLLVMTarget \ 22 libLLVMMC \ 23 libLLVMScalarOpts \ 24 libLLVMipo \ 25 libLLVMTransformUtils \ 26 libLLVMCore \ 27 libLLVMSupport \ 28 libLLVMSystem \ 29 libLLVMAnalysis \ 30 libLLVMInstCombine \ 31 libLLVMipa \ 32 libLLVMMCParser \ 33 libLLVMExecutionEngine 34 35libMesa_SRC_FILES := \ 36 src/glsl/glcpp/pp.c \ 37 src/glsl/glcpp/glcpp-lex.c \ 38 src/glsl/glcpp/glcpp-parse.c \ 39 src/glsl/ast_expr.cpp \ 40 src/glsl/ast_function.cpp \ 41 src/glsl/ast_to_hir.cpp \ 42 src/glsl/ast_type.cpp \ 43 src/glsl/builtin_function.cpp \ 44 src/glsl/glsl_lexer.cpp \ 45 src/glsl/glsl_parser.cpp \ 46 src/glsl/glsl_parser_extras.cpp \ 47 src/glsl/glsl_symbol_table.cpp \ 48 src/glsl/glsl_types.cpp \ 49 src/glsl/hir_field_selection.cpp \ 50 src/glsl/ir.cpp \ 51 src/glsl/ir_basic_block.cpp \ 52 src/glsl/ir_clone.cpp \ 53 src/glsl/ir_constant_expression.cpp \ 54 src/glsl/ir_expression_flattening.cpp \ 55 src/glsl/ir_function.cpp \ 56 src/glsl/ir_function_can_inline.cpp \ 57 src/glsl/ir_hierarchical_visitor.cpp \ 58 src/glsl/ir_hv_accept.cpp \ 59 src/glsl/ir_import_prototypes.cpp \ 60 src/glsl/ir_print_visitor.cpp \ 61 src/glsl/ir_reader.cpp \ 62 src/glsl/ir_rvalue_visitor.cpp \ 63 src/glsl/ir_set_program_inouts.cpp \ 64 src/glsl/ir_validate.cpp \ 65 src/glsl/ir_variable.cpp \ 66 src/glsl/ir_variable_refcount.cpp \ 67 src/glsl/link_functions.cpp \ 68 src/glsl/linker.cpp \ 69 src/glsl/loop_analysis.cpp \ 70 src/glsl/loop_controls.cpp \ 71 src/glsl/loop_unroll.cpp \ 72 src/glsl/lower_discard.cpp \ 73 src/glsl/lower_if_to_cond_assign.cpp \ 74 src/glsl/lower_instructions.cpp \ 75 src/glsl/lower_jumps.cpp \ 76 src/glsl/lower_mat_op_to_vec.cpp \ 77 src/glsl/lower_noise.cpp \ 78 src/glsl/lower_texture_projection.cpp \ 79 src/glsl/lower_variable_index_to_cond_assign.cpp \ 80 src/glsl/lower_vec_index_to_cond_assign.cpp \ 81 src/glsl/lower_vec_index_to_swizzle.cpp \ 82 src/glsl/lower_vector.cpp \ 83 src/glsl/main.cpp \ 84 src/glsl/opt_algebraic.cpp \ 85 src/glsl/opt_constant_folding.cpp \ 86 src/glsl/opt_constant_propagation.cpp \ 87 src/glsl/opt_constant_variable.cpp \ 88 src/glsl/opt_copy_propagation.cpp \ 89 src/glsl/opt_dead_code.cpp \ 90 src/glsl/opt_dead_code_local.cpp \ 91 src/glsl/opt_dead_functions.cpp \ 92 src/glsl/opt_discard_simplification.cpp \ 93 src/glsl/opt_function_inlining.cpp \ 94 src/glsl/opt_if_simplification.cpp \ 95 src/glsl/opt_noop_swizzle.cpp \ 96 src/glsl/opt_redundant_jumps.cpp \ 97 src/glsl/opt_structure_splitting.cpp \ 98 src/glsl/opt_swizzle_swizzle.cpp \ 99 src/glsl/opt_tree_grafting.cpp \ 100 src/glsl/s_expression.cpp \ 101 src/glsl/strtod.c \ 102 src/glsl/ir_to_llvm.cpp \ 103 src/mesa/main/shaderobj.c \ 104 src/mesa/program/hash_table.c \ 105 src/mesa/program/prog_parameter.cpp \ 106 src/mesa/program/symbol_table.c \ 107 src/pixelflinger2/buffer.cpp \ 108 src/pixelflinger2/format.cpp \ 109 src/pixelflinger2/llvm_scanline.cpp \ 110 src/pixelflinger2/llvm_texture.cpp \ 111 src/pixelflinger2/pixelflinger2.cpp \ 112 src/pixelflinger2/raster.cpp \ 113 src/pixelflinger2/scanline.cpp \ 114 src/pixelflinger2/shader.cpp \ 115 src/pixelflinger2/texture.cpp \ 116 src/talloc/hieralloc.c 117 118libMesa_C_INCLUDES := \ 119 $(LOCAL_PATH) \ 120 $(LOCAL_PATH)/src/glsl \ 121 $(LOCAL_PATH)/src/mesa \ 122 $(LOCAL_PATH)/src/talloc \ 123 $(LOCAL_PATH)/src/mapi \ 124 $(LOCAL_PATH)/include \ 125 frameworks/compile/libbcc/include 126 127# Static library for host 128# ======================================================== 129include $(CLEAR_VARS) 130 131LOCAL_MODULE_TAGS := optional 132 133ifeq ($(DEBUG_BUILD),true) 134LOCAL_CFLAGS += -DDEBUG -UNDEBUG -O0 -g 135else 136LOCAL_CFLAGS += -O3 137endif 138 139LOCAL_MODULE := libMesa 140LOCAL_SRC_FILES := $(libMesa_SRC_FILES) 141 142ifeq ($(USE_LLVM_EXECUTIONENGINE),true) 143LOCAL_CFLAGS += -DUSE_LLVM_EXECUTIONENGINE=1 144LOCAL_STATIC_LIBRARIES := libLLVMX86CodeGen libLLVMX86Info $(libMesa_STATIC_LIBS) 145else 146LOCAL_CFLAGS += -DUSE_LLVM_EXECUTIONENGINE=0 147LOCAL_SHARED_LIBRARIES := libbcc 148endif 149 150LOCAL_C_INCLUDES := $(libMesa_C_INCLUDES) 151 152include $(LLVM_ROOT_PATH)/llvm-host-build.mk 153include $(BUILD_HOST_STATIC_LIBRARY) 154 155 156# Static library for target 157# ======================================================== 158include $(CLEAR_VARS) 159 160LOCAL_MODULE_TAGS := optional 161 162ifeq ($(DEBUG_BUILD),true) 163LOCAL_CFLAGS += -DDEBUG -UNDEBUG -O0 -g 164else 165LOCAL_CFLAGS += -O3 166endif 167 168LOCAL_MODULE := libMesa 169LOCAL_SRC_FILES := $(libMesa_SRC_FILES) 170LOCAL_SHARED_LIBRARIES := libstlport libcutils libdl libutils 171 172ifeq ($(USE_LLVM_EXECUTIONENGINE),true) 173LOCAL_CFLAGS += -DUSE_LLVM_EXECUTIONENGINE=1 174LOCAL_STATIC_LIBRARIES := libLLVMARMCodeGen libLLVMARMInfo libLLVMARMDisassembler \ 175 libLLVMARMAsmPrinter $(libMesa_STATIC_LIBS) 176else 177LOCAL_CFLAGS += -DUSE_LLVM_EXECUTIONENGINE=0 178LOCAL_SHARED_LIBRARIES += libbcc 179endif 180 181LOCAL_C_INCLUDES := $(libMesa_C_INCLUDES) 182 183include $(LLVM_ROOT_PATH)/llvm-device-build.mk 184include $(BUILD_STATIC_LIBRARY) 185 186# glsl_compiler for host 187# ======================================================== 188include $(CLEAR_VARS) 189 190LOCAL_MODULE_TAGS := optional 191 192ifeq ($(DEBUG_BUILD),true) 193LOCAL_CFLAGS += -DDEBUG -UNDEBUG -O0 -g 194endif 195 196LOCAL_MODULE := glsl_compiler 197LOCAL_SRC_FILES := src/glsl/glsl_compiler.cpp 198LOCAL_C_INCLUDES := $(libMesa_C_INCLUDES) 199LOCAL_STATIC_LIBRARIES := libMesa 200 201include $(BUILD_HOST_EXECUTABLE) 202 203# Build children 204# ======================================================== 205include $(call all-makefiles-under,$(LOCAL_PATH)) 206endif 207