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 \
43 ir_hierarchical_visitor.cpp \
45 ir_import_prototypes.cpp \
46 ir_print_visitor.cpp \
48 ir_rvalue_visitor.cpp \
49 ir_set_program_inouts.cpp \
52 ir_variable_refcount.cpp \
59 lower_if_to_cond_assign.cpp \
60 lower_instructions.cpp \
62 lower_mat_op_to_vec.cpp \
64 lower_texture_projection.cpp \
65 lower_variable_index_to_cond_assign.cpp \
66 lower_vec_index_to_cond_assign.cpp \
67 lower_vec_index_to_swizzle.cpp \
70 opt_constant_folding.cpp \
71 opt_constant_propagation.cpp \
72 opt_constant_variable.cpp \
73 opt_copy_propagation.cpp \
74 opt_copy_propagation_elements.cpp \
76 opt_dead_code_local.cpp \
77 opt_dead_functions.cpp \
78 opt_discard_simplification.cpp \
79 opt_function_inlining.cpp \
80 opt_if_simplification.cpp \
81 opt_noop_swizzle.cpp \
82 opt_redundant_jumps.cpp \
83 opt_structure_splitting.cpp \
84 opt_swizzle_swizzle.cpp \
85 opt_tree_grafting.cpp \
89 $(TOP)/src/glsl/libglsl.a
91 APPS = glsl_compiler glcpp/glcpp
94 ../mesa/program/hash_table.c \
95 ../mesa/program/symbol_table.c
100 $(GLSL2_C_SOURCES:.c=.o) \
101 $(GLSL2_CXX_SOURCES:.cpp=.o)
103 ### Basic defines ###
110 $(GLCPP_SOURCES:.c=.o) \
111 ../mesa/program/hash_table.o
115 $(CXX_SOURCES:.cpp=.o)
117 DRICORE_OBJ_DIR = obj-visible
118 OBJECTS_DRICORE = $(addprefix $(DRICORE_OBJ_DIR)/,$(OBJECTS))
130 $(GLSL2_CXX_SOURCES) \
135 default: depend lib$(LIBNAME).a $(APPS) $(DRICORE_GLSL_LIBS)
137 $(TOP)/$(LIB_DIR)/libglsl.so: $(OBJECTS_DRICORE) builtin_function.o Makefile $(TOP)/src/glsl/Makefile.template
138 $(MKLIB) -o $@ -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
139 -cplusplus -noprefix \
140 -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/$@.dylib \
141 $(OBJECTS_DRICORE) builtin_function.o
143 lib$(LIBNAME).a: $(OBJECTS) builtin_function.o Makefile $(TOP)/src/glsl/Makefile.template
144 $(MKLIB) -cplusplus -o $(LIBNAME) -static $(OBJECTS) builtin_function.o
146 depend: $(ALL_SOURCES) Makefile
149 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(ALL_SOURCES) 2> /dev/null
151 # Remove .o and backup files
153 rm -f $(GLCPP_OBJECTS) $(GLSL2_OBJECTS) $(OBJECTS) lib$(LIBNAME).a depend depend.bak builtin_function.cpp builtin_function.o builtin_stubs.o builtin_compiler
157 -rm -f $(DRICORE_OBJ_DIR) $(TOP)/$(LIB_DIR)/libglsl.so libglsl.so
159 ifneq (,$(DRICORE_GLSL_LIBS))
160 DRICORE_INSTALL_TARGET = install-dricore
164 install: $(DRICORE_INSTALL_TARGET)
167 install-dricore: default
168 $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
169 $(INSTALL) -m 755 $(DRICORE_GLSL_LIBS) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
173 glsl_compiler: $(GLSL2_OBJECTS) libglsl.a builtin_stubs.o
174 $(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLSL2_OBJECTS) builtin_stubs.o $(LIBS) -o $@
177 glcpp/glcpp: $(GLCPP_OBJECTS)
178 $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLCPP_OBJECTS) -o $@
181 $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@
184 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
186 $(DRICORE_OBJ_DIR)/%.o : %.cpp
188 $(CXX) -c $(INCLUDES) $(DRI_CXXFLAGS) $(DEFINES) $< -o $@
190 $(DRICORE_OBJ_DIR)/%.o : %.c
192 $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DEFINES) $< -o $@
194 glsl_lexer.cpp: glsl_lexer.ll
195 flex --nounistd -o$@ $<
197 glsl_parser.cpp: glsl_parser.yy
198 bison -v -o "$@" -p "_mesa_glsl_" --defines=glsl_parser.h $<
200 glcpp/glcpp-lex.c: glcpp/glcpp-lex.l
201 flex --nounistd -o$@ $<
203 glcpp/glcpp-parse.c: glcpp/glcpp-parse.y
204 bison -v -o "$@" --defines=glcpp/glcpp-parse.h $<
206 builtin_compiler: $(GLSL2_OBJECTS) $(OBJECTS) builtin_stubs.o
207 $(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(OBJECTS) $(GLSL2_OBJECTS) builtin_stubs.o -o $@
209 builtin_function.cpp: builtins/profiles/* builtins/ir/* builtins/tools/generate_builtins.py builtins/tools/texture_builtins.py builtin_compiler
210 @echo Regenerating builtin_function.cpp...
211 $(PYTHON2) $(PYTHON_FLAGS) builtins/tools/generate_builtins.py ./builtin_compiler > builtin_function.cpp || rm -f builtin_function.cpp