6 include $(TOP)/configs/current
32 glsl_parser_extras.cpp \
34 glsl_symbol_table.cpp \
35 hir_field_selection.cpp \
38 ir_constant_expression.cpp \
40 ir_expression_flattening.cpp \
41 ir_function_can_inline.cpp \
42 ir_function_detect_recursion.cpp \
44 ir_hierarchical_visitor.cpp \
46 ir_import_prototypes.cpp \
47 ir_print_visitor.cpp \
49 ir_rvalue_visitor.cpp \
50 ir_set_program_inouts.cpp \
53 ir_variable_refcount.cpp \
60 lower_clip_distance.cpp \
62 lower_if_to_cond_assign.cpp \
63 lower_instructions.cpp \
65 lower_mat_op_to_vec.cpp \
67 lower_texture_projection.cpp \
68 lower_variable_index_to_cond_assign.cpp \
69 lower_vec_index_to_cond_assign.cpp \
70 lower_vec_index_to_swizzle.cpp \
73 opt_constant_folding.cpp \
74 opt_constant_propagation.cpp \
75 opt_constant_variable.cpp \
76 opt_copy_propagation.cpp \
77 opt_copy_propagation_elements.cpp \
79 opt_dead_code_local.cpp \
80 opt_dead_functions.cpp \
81 opt_discard_simplification.cpp \
82 opt_function_inlining.cpp \
83 opt_if_simplification.cpp \
84 opt_noop_swizzle.cpp \
85 opt_redundant_jumps.cpp \
86 opt_structure_splitting.cpp \
87 opt_swizzle_swizzle.cpp \
88 opt_tree_grafting.cpp \
92 $(TOP)/src/glsl/libglsl.a
94 APPS = glsl_compiler glsl_test glcpp/glcpp
97 ../mesa/program/hash_table.c \
98 ../mesa/program/symbol_table.c
101 standalone_scaffolding.cpp
104 $(GLSL2_C_SOURCES:.c=.o) \
105 $(GLSL2_CXX_SOURCES:.cpp=.o)
108 ../mesa/program/hash_table.c \
109 ../mesa/program/symbol_table.c
112 standalone_scaffolding.cpp \
117 $(TEST_C_SOURCES:.c=.o) \
118 $(TEST_CXX_SOURCES:.cpp=.o)
120 ### Basic defines ###
127 $(GLCPP_SOURCES:.c=.o) \
128 ../mesa/program/hash_table.o
132 $(CXX_SOURCES:.cpp=.o)
134 DRICORE_OBJ_DIR = obj-visible
135 OBJECTS_DRICORE = $(addprefix $(DRICORE_OBJ_DIR)/,$(OBJECTS))
147 $(GLSL2_CXX_SOURCES) \
149 $(TEST_CXX_SOURCES) \
154 default: depend lib$(LIBNAME).a $(APPS) $(DRICORE_GLSL_LIBS)
156 $(TOP)/$(LIB_DIR)/libglsl.so: $(OBJECTS_DRICORE) builtin_function.o Makefile $(TOP)/src/glsl/Makefile.template
157 $(MKLIB) -o $@ -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
158 -cplusplus -noprefix \
159 -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/$@.dylib \
160 $(OBJECTS_DRICORE) builtin_function.o
162 lib$(LIBNAME).a: $(OBJECTS) builtin_function.o Makefile $(TOP)/src/glsl/Makefile.template
163 $(MKLIB) -cplusplus -o $(LIBNAME) -static $(OBJECTS) builtin_function.o
165 depend: $(ALL_SOURCES) Makefile
168 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(ALL_SOURCES) 2> /dev/null
169 $(MKDEP) $(MKDEP_OPTIONS) -a -p $(DRICORE_OBJ_DIR)/ $(INCLUDES) $(ALL_SOURCES) 2> /dev/null
171 # Remove .o and backup files
173 rm -f $(GLCPP_OBJECTS) $(GLSL2_OBJECTS) $(TEST_OBJECTS) $(OBJECTS) lib$(LIBNAME).a depend depend.bak builtin_function.cpp builtin_function.o builtin_stubs.o builtin_compiler
177 -rm -f $(OBJECTS_DRICORE) $(TOP)/$(LIB_DIR)/libglsl.so libglsl.so
179 ifneq (,$(DRICORE_GLSL_LIBS))
180 DRICORE_INSTALL_TARGET = install-dricore
184 install: $(DRICORE_INSTALL_TARGET)
187 install-dricore: default
188 $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
189 $(INSTALL) -m 755 $(DRICORE_GLSL_LIBS) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
193 glsl_compiler: $(GLSL2_OBJECTS) libglsl.a
194 $(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLSL2_OBJECTS) $(LIBS) -o $@
196 glsl_test: $(TEST_OBJECTS) libglsl.a
197 $(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(TEST_OBJECTS) $(LIBS) -o $@
200 glcpp/glcpp: $(GLCPP_OBJECTS)
201 $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLCPP_OBJECTS) -o $@
204 $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@
207 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
209 $(DRICORE_OBJ_DIR)/%.o : %.cpp
211 $(CXX) -c $(INCLUDES) $(DRI_CXXFLAGS) $(DEFINES) $< -o $@
213 $(DRICORE_OBJ_DIR)/%.o : %.c
215 $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DEFINES) $< -o $@
217 glsl_lexer.cpp: glsl_lexer.ll
218 $(FLEX) --nounistd -o$@ $<
220 glsl_parser.cpp: glsl_parser.yy
221 $(BISON) -v -o "$@" -p "_mesa_glsl_" --defines=glsl_parser.h $<
223 glcpp/glcpp-lex.c: glcpp/glcpp-lex.l
224 $(FLEX) --nounistd -o$@ $<
226 glcpp/glcpp-parse.c: glcpp/glcpp-parse.y
227 $(BISON) -v -o "$@" --defines=glcpp/glcpp-parse.h $<
229 builtin_compiler: $(GLSL2_OBJECTS) $(OBJECTS) builtin_stubs.o
230 $(APP_CXX) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(GLSL2_OBJECTS) builtin_stubs.o -o $@
232 builtin_function.cpp: builtins/profiles/* builtins/ir/* builtins/tools/generate_builtins.py builtins/tools/texture_builtins.py builtin_compiler
233 @echo Regenerating builtin_function.cpp...
234 $(PYTHON2) $(PYTHON_FLAGS) builtins/tools/generate_builtins.py ./builtin_compiler > builtin_function.cpp || rm -f builtin_function.cpp