2010-06-21 11:29:15 -07:00
|
|
|
#src/glsl/pp/Makefile
|
2009-12-10 01:03:15 +01:00
|
|
|
|
|
|
|
|
TOP = ../..
|
|
|
|
|
|
|
|
|
|
include $(TOP)/configs/current
|
|
|
|
|
|
2010-06-21 11:29:15 -07:00
|
|
|
LIBNAME = glsl
|
2009-12-10 01:03:15 +01:00
|
|
|
|
2010-07-14 14:48:15 -07:00
|
|
|
LIBGLCPP_SOURCES = \
|
2010-06-21 11:29:15 -07:00
|
|
|
glcpp/glcpp-lex.c \
|
|
|
|
|
glcpp/glcpp-parse.c \
|
2010-08-03 20:21:52 -07:00
|
|
|
glcpp/pp.c
|
2009-12-10 01:03:15 +01:00
|
|
|
|
2010-07-14 14:48:15 -07:00
|
|
|
GLCPP_SOURCES = \
|
|
|
|
|
$(LIBGLCPP_SOURCES) \
|
|
|
|
|
glcpp/glcpp.c
|
|
|
|
|
|
|
|
|
|
C_SOURCES = \
|
|
|
|
|
$(LIBGLCPP_SOURCES)
|
|
|
|
|
|
2010-06-21 11:29:15 -07:00
|
|
|
CXX_SOURCES = \
|
|
|
|
|
ast_expr.cpp \
|
|
|
|
|
ast_function.cpp \
|
|
|
|
|
ast_to_hir.cpp \
|
|
|
|
|
ast_type.cpp \
|
|
|
|
|
builtin_function.cpp \
|
|
|
|
|
glsl_lexer.cpp \
|
|
|
|
|
glsl_parser.cpp \
|
|
|
|
|
glsl_parser_extras.cpp \
|
|
|
|
|
glsl_types.cpp \
|
glsl: Use a single shared namespace in the symbol table.
As of 1.20, variable names, function names, and structure type names all
share a single namespace, and should conflict with one another in the
same scope, or hide each other in nested scopes.
However, in 1.10, variables and functions can share the same name in the
same scope. Structure types, however, conflict with/hide both.
Fixes piglit tests redeclaration-06.vert, redeclaration-11.vert,
redeclaration-19.vert, and struct-05.vert.
2010-08-21 20:23:18 -07:00
|
|
|
glsl_symbol_table.cpp \
|
2010-06-21 11:29:15 -07:00
|
|
|
hir_field_selection.cpp \
|
|
|
|
|
ir_basic_block.cpp \
|
|
|
|
|
ir_clone.cpp \
|
|
|
|
|
ir_constant_expression.cpp \
|
|
|
|
|
ir.cpp \
|
|
|
|
|
ir_expression_flattening.cpp \
|
|
|
|
|
ir_function_can_inline.cpp \
|
|
|
|
|
ir_function.cpp \
|
|
|
|
|
ir_hierarchical_visitor.cpp \
|
|
|
|
|
ir_hv_accept.cpp \
|
2010-07-20 11:28:31 -07:00
|
|
|
ir_import_prototypes.cpp \
|
2010-06-21 11:29:15 -07:00
|
|
|
ir_print_visitor.cpp \
|
|
|
|
|
ir_reader.cpp \
|
2010-08-13 20:39:24 -07:00
|
|
|
ir_rvalue_visitor.cpp \
|
2010-08-06 13:07:25 -07:00
|
|
|
ir_set_program_inouts.cpp \
|
2010-06-21 11:29:15 -07:00
|
|
|
ir_validate.cpp \
|
|
|
|
|
ir_variable.cpp \
|
2010-07-30 16:05:27 -07:00
|
|
|
ir_variable_refcount.cpp \
|
2010-06-21 11:29:15 -07:00
|
|
|
linker.cpp \
|
2010-07-13 17:36:13 -07:00
|
|
|
link_functions.cpp \
|
2010-08-26 15:58:33 -07:00
|
|
|
loop_analysis.cpp \
|
2010-08-26 16:43:57 -07:00
|
|
|
loop_controls.cpp \
|
2010-08-27 13:59:49 -07:00
|
|
|
loop_unroll.cpp \
|
2010-11-25 01:09:26 -08:00
|
|
|
lower_discard.cpp \
|
2010-11-15 14:35:46 -08:00
|
|
|
lower_if_to_cond_assign.cpp \
|
2010-11-18 17:54:07 -08:00
|
|
|
lower_instructions.cpp \
|
2010-11-15 14:35:46 -08:00
|
|
|
lower_jumps.cpp \
|
|
|
|
|
lower_mat_op_to_vec.cpp \
|
2010-09-09 15:20:09 -07:00
|
|
|
lower_noise.cpp \
|
2010-09-30 20:07:27 -07:00
|
|
|
lower_texture_projection.cpp \
|
2010-09-08 01:35:44 +02:00
|
|
|
lower_variable_index_to_cond_assign.cpp \
|
2010-11-15 14:35:46 -08:00
|
|
|
lower_vec_index_to_cond_assign.cpp \
|
|
|
|
|
lower_vec_index_to_swizzle.cpp \
|
2010-11-16 12:01:42 -08:00
|
|
|
lower_vector.cpp \
|
2010-11-15 14:35:46 -08:00
|
|
|
opt_algebraic.cpp \
|
|
|
|
|
opt_constant_folding.cpp \
|
|
|
|
|
opt_constant_propagation.cpp \
|
|
|
|
|
opt_constant_variable.cpp \
|
|
|
|
|
opt_copy_propagation.cpp \
|
|
|
|
|
opt_dead_code.cpp \
|
|
|
|
|
opt_dead_code_local.cpp \
|
|
|
|
|
opt_dead_functions.cpp \
|
2010-11-24 22:02:26 -08:00
|
|
|
opt_discard_simplification.cpp \
|
2010-11-15 14:35:46 -08:00
|
|
|
opt_function_inlining.cpp \
|
|
|
|
|
opt_if_simplification.cpp \
|
|
|
|
|
opt_noop_swizzle.cpp \
|
2010-09-13 14:25:26 -07:00
|
|
|
opt_redundant_jumps.cpp \
|
2010-11-15 14:35:46 -08:00
|
|
|
opt_structure_splitting.cpp \
|
|
|
|
|
opt_swizzle_swizzle.cpp \
|
|
|
|
|
opt_tree_grafting.cpp \
|
2010-06-21 11:29:15 -07:00
|
|
|
s_expression.cpp
|
|
|
|
|
|
|
|
|
|
LIBS = \
|
|
|
|
|
$(TOP)/src/glsl/libglsl.a \
|
2010-08-22 17:34:18 -07:00
|
|
|
$(TALLOC_LIBS)
|
2010-06-21 11:29:15 -07:00
|
|
|
|
2010-07-14 14:48:15 -07:00
|
|
|
APPS = glsl_compiler glcpp/glcpp
|
|
|
|
|
|
2010-06-21 11:29:15 -07:00
|
|
|
GLSL2_C_SOURCES = \
|
2010-07-26 17:47:59 -07:00
|
|
|
../mesa/program/hash_table.c \
|
|
|
|
|
../mesa/program/symbol_table.c
|
2010-06-21 11:29:15 -07:00
|
|
|
GLSL2_CXX_SOURCES = \
|
|
|
|
|
main.cpp
|
|
|
|
|
|
|
|
|
|
GLSL2_OBJECTS = \
|
|
|
|
|
$(GLSL2_C_SOURCES:.c=.o) \
|
|
|
|
|
$(GLSL2_CXX_SOURCES:.cpp=.o)
|
|
|
|
|
|
|
|
|
|
### Basic defines ###
|
|
|
|
|
|
2010-07-28 16:44:56 -07:00
|
|
|
DEFINES += \
|
2010-07-22 15:17:23 -07:00
|
|
|
$(LIBRARY_DEFINES) \
|
|
|
|
|
$(API_DEFINES)
|
|
|
|
|
|
2010-07-14 14:48:15 -07:00
|
|
|
GLCPP_OBJECTS = \
|
|
|
|
|
$(GLCPP_SOURCES:.c=.o) \
|
2010-07-26 17:47:59 -07:00
|
|
|
../mesa/program/hash_table.o
|
2010-07-14 14:48:15 -07:00
|
|
|
|
2010-06-21 11:29:15 -07:00
|
|
|
OBJECTS = \
|
|
|
|
|
$(C_SOURCES:.c=.o) \
|
|
|
|
|
$(CXX_SOURCES:.cpp=.o)
|
|
|
|
|
|
|
|
|
|
INCLUDES = \
|
2010-08-22 17:34:18 -07:00
|
|
|
$(TALLOC_CFLAGS) \
|
2010-06-21 11:29:15 -07:00
|
|
|
-I. \
|
|
|
|
|
-I../mesa \
|
|
|
|
|
-I../mapi \
|
2010-07-18 15:59:43 -07:00
|
|
|
-I../../include \
|
2010-06-21 11:29:15 -07:00
|
|
|
$(LIBRARY_INCLUDES)
|
|
|
|
|
|
2010-06-25 12:23:20 -07:00
|
|
|
ALL_SOURCES = \
|
|
|
|
|
$(C_SOURCES) \
|
|
|
|
|
$(CXX_SOURCES) \
|
|
|
|
|
$(GLSL2_CXX_SOURCES) \
|
|
|
|
|
$(GLSL2_C_SOURCES)
|
2010-06-21 11:29:15 -07:00
|
|
|
|
|
|
|
|
##### TARGETS #####
|
|
|
|
|
|
|
|
|
|
default: depend lib$(LIBNAME).a $(APPS)
|
|
|
|
|
|
|
|
|
|
lib$(LIBNAME).a: $(OBJECTS) Makefile $(TOP)/src/glsl/Makefile.template
|
|
|
|
|
$(MKLIB) -cplusplus -o $(LIBNAME) -static $(OBJECTS)
|
|
|
|
|
|
2010-06-25 12:23:20 -07:00
|
|
|
depend: $(ALL_SOURCES) Makefile
|
2010-06-21 11:29:15 -07:00
|
|
|
rm -f depend
|
|
|
|
|
touch depend
|
2010-06-25 12:23:20 -07:00
|
|
|
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(ALL_SOURCES) 2> /dev/null
|
2010-06-21 11:29:15 -07:00
|
|
|
|
|
|
|
|
# Remove .o and backup files
|
|
|
|
|
clean:
|
2010-08-24 16:10:28 +10:00
|
|
|
rm -f $(GLCPP_OBJECTS) $(GLSL2_OBJECTS) $(OBJECTS) lib$(LIBNAME).a depend depend.bak
|
2010-06-21 11:29:15 -07:00
|
|
|
-rm -f $(APPS)
|
|
|
|
|
|
|
|
|
|
# Dummy target
|
|
|
|
|
install:
|
|
|
|
|
@echo -n ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##### RULES #####
|
|
|
|
|
|
|
|
|
|
glsl_compiler: $(GLSL2_OBJECTS) libglsl.a
|
|
|
|
|
$(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLSL2_OBJECTS) $(LIBS) -o $@
|
|
|
|
|
|
2010-07-14 14:48:15 -07:00
|
|
|
glcpp/glcpp: $(GLCPP_OBJECTS) libglsl.a
|
|
|
|
|
$(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLCPP_OBJECTS) $(LIBS) -o $@
|
|
|
|
|
|
2010-06-21 11:29:15 -07:00
|
|
|
.cpp.o:
|
2010-07-22 15:17:23 -07:00
|
|
|
$(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@
|
2010-06-21 11:29:15 -07:00
|
|
|
|
|
|
|
|
.c.o:
|
2010-07-22 15:17:23 -07:00
|
|
|
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
2010-06-21 11:29:15 -07:00
|
|
|
|
|
|
|
|
glsl_lexer.cpp: glsl_lexer.lpp
|
2010-08-13 13:08:54 -07:00
|
|
|
flex --nounistd -o$@ $<
|
2010-06-21 11:29:15 -07:00
|
|
|
|
|
|
|
|
glsl_parser.cpp: glsl_parser.ypp
|
2010-08-11 17:14:02 -07:00
|
|
|
bison -v -o "$@" -p "_mesa_glsl_" --defines=glsl_parser.h $<
|
2010-06-21 11:29:15 -07:00
|
|
|
|
|
|
|
|
glcpp/glcpp-lex.c: glcpp/glcpp-lex.l
|
2010-08-13 13:08:54 -07:00
|
|
|
flex --nounistd -o$@ $<
|
2010-06-21 11:29:15 -07:00
|
|
|
|
|
|
|
|
glcpp/glcpp-parse.c: glcpp/glcpp-parse.y
|
|
|
|
|
bison -v -o "$@" --defines=glcpp/glcpp-parse.h $<
|
|
|
|
|
|
2010-08-13 17:46:25 -07:00
|
|
|
builtins: builtin_function.cpp builtins/profiles/* builtins/ir/* builtins/tools/generate_builtins.py builtins/tools/texture_builtins.py
|
|
|
|
|
@echo Bootstrapping the compiler...
|
2010-08-11 16:53:52 -07:00
|
|
|
cp builtins/tools/builtin_function.cpp .
|
2010-08-13 17:46:25 -07:00
|
|
|
make glsl_compiler
|
|
|
|
|
@echo Regenerating builtin_function.cpp...
|
2010-10-25 13:52:58 -07:00
|
|
|
$(PYTHON2) $(PYTHON_FLAGS) builtins/tools/generate_builtins.py > builtin_function.cpp
|
2010-08-13 17:46:25 -07:00
|
|
|
@echo Rebuilding the real compiler...
|
|
|
|
|
make glsl_compiler
|
2010-06-21 11:29:15 -07:00
|
|
|
|
|
|
|
|
-include depend
|