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