1 # USE_LLVM_EXECUTIONENGINE is not fully implemented. We use libbcc instead. 2 USE_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 7 DEBUG_BUILD := false 8 9 LOCAL_PATH := $(call my-dir) 10 LIBBCC_ROOT_PATH := frameworks/compile/libbcc 11 include $(LIBBCC_ROOT_PATH)/libbcc.mk 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; 15 libMesa_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 35 libMesa_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 118 libMesa_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 $(LIBBCC_ROOT_PATH)/include 126 127 # Static library for host 128 # ======================================================== 129 include $(CLEAR_VARS) 130 131 LOCAL_MODULE_TAGS := optional 132 133 ifeq ($(DEBUG_BUILD),true) 134 LOCAL_CFLAGS += -DDEBUG -UNDEBUG -O0 -g 135 else 136 LOCAL_CFLAGS += -O3 137 endif 138 139 LOCAL_MODULE := libMesa 140 LOCAL_MODULE_CLASS := STATIC_LIBRARIES 141 LOCAL_IS_HOST_MODULE := true 142 LOCAL_SRC_FILES := $(libMesa_SRC_FILES) 143 144 ifeq ($(USE_LLVM_EXECUTIONENGINE),true) 145 LOCAL_CFLAGS += -DUSE_LLVM_EXECUTIONENGINE=1 146 LOCAL_STATIC_LIBRARIES := libLLVMX86CodeGen libLLVMX86Info $(libMesa_STATIC_LIBS) 147 else 148 LOCAL_CFLAGS += -DUSE_LLVM_EXECUTIONENGINE=0 149 LOCAL_SHARED_LIBRARIES := libbcc libbcinfo 150 endif 151 152 LOCAL_C_INCLUDES := $(libMesa_C_INCLUDES) 153 154 include $(LIBBCC_GEN_CONFIG_MK) 155 include $(LLVM_HOST_BUILD_MK) 156 include $(BUILD_HOST_STATIC_LIBRARY) 157 158 159 # Static library for target 160 # ======================================================== 161 include $(CLEAR_VARS) 162 163 LOCAL_MODULE_TAGS := optional 164 165 ifeq ($(DEBUG_BUILD),true) 166 LOCAL_CFLAGS += -DDEBUG -UNDEBUG -O0 -g 167 else 168 LOCAL_CFLAGS += -O3 169 endif 170 171 LOCAL_MODULE := libMesa 172 LOCAL_MODULE_CLASS := STATIC_LIBRARIES 173 LOCAL_SRC_FILES := $(libMesa_SRC_FILES) 174 LOCAL_SHARED_LIBRARIES := libstlport libcutils libdl libutils 175 176 ifeq ($(USE_LLVM_EXECUTIONENGINE),true) 177 LOCAL_CFLAGS += -DUSE_LLVM_EXECUTIONENGINE=1 178 LOCAL_STATIC_LIBRARIES := libLLVMARMCodeGen libLLVMARMInfo libLLVMARMDisassembler \ 179 libLLVMARMAsmPrinter $(libMesa_STATIC_LIBS) 180 else 181 LOCAL_CFLAGS += -DUSE_LLVM_EXECUTIONENGINE=0 182 LOCAL_SHARED_LIBRARIES += libbcc libbcinfo 183 endif 184 185 LOCAL_C_INCLUDES := $(libMesa_C_INCLUDES) 186 187 include $(LIBBCC_GEN_CONFIG_MK) 188 include $(LLVM_DEVICE_BUILD_MK) 189 include $(BUILD_STATIC_LIBRARY) 190 191 # glsl_compiler for host 192 # ======================================================== 193 include $(CLEAR_VARS) 194 195 LOCAL_MODULE_TAGS := optional 196 197 ifeq ($(DEBUG_BUILD),true) 198 LOCAL_CFLAGS += -DDEBUG -UNDEBUG -O0 -g 199 endif 200 201 LOCAL_MODULE := glsl_compiler 202 LOCAL_MODULE_CLASS := EXECUTABLES 203 LOCAL_SRC_FILES := src/glsl/glsl_compiler.cpp 204 LOCAL_C_INCLUDES := $(libMesa_C_INCLUDES) 205 LOCAL_STATIC_LIBRARIES := libMesa 206 207 include $(BUILD_HOST_EXECUTABLE) 208 209 # Build children 210 # ======================================================== 211 include $(call all-makefiles-under,$(LOCAL_PATH)) 212