glsl2: Add a new pass at the IR level to break down matrix ops to vector ops.
[mesa.git] / src / glsl / Makefile
1 #src/glsl/pp/Makefile
2
3 TOP = ../..
4
5 include $(TOP)/configs/current
6
7 LIBNAME = glsl
8
9 C_SOURCES = \
10 glcpp/glcpp.c \
11 glcpp/glcpp-lex.c \
12 glcpp/glcpp-parse.c \
13 glcpp/pp.c \
14 glcpp/xtalloc.c
15
16 CXX_SOURCES = \
17 ast_expr.cpp \
18 ast_function.cpp \
19 ast_to_hir.cpp \
20 ast_type.cpp \
21 builtin_function.cpp \
22 glsl_lexer.cpp \
23 glsl_parser.cpp \
24 glsl_parser_extras.cpp \
25 glsl_types.cpp \
26 hir_field_selection.cpp \
27 ir_basic_block.cpp \
28 ir_clone.cpp \
29 ir_constant_expression.cpp \
30 ir_constant_folding.cpp \
31 ir_constant_variable.cpp \
32 ir_copy_propagation.cpp \
33 ir.cpp \
34 ir_dead_code.cpp \
35 ir_dead_code_local.cpp \
36 ir_div_to_mul_rcp.cpp \
37 ir_expression_flattening.cpp \
38 ir_function_can_inline.cpp \
39 ir_function.cpp \
40 ir_function_inlining.cpp \
41 ir_hierarchical_visitor.cpp \
42 ir_hv_accept.cpp \
43 ir_if_return.cpp \
44 ir_if_simplification.cpp \
45 ir_mat_op_to_vec.cpp \
46 ir_mod_to_fract.cpp \
47 ir_print_visitor.cpp \
48 ir_reader.cpp \
49 ir_swizzle_swizzle.cpp \
50 ir_validate.cpp \
51 ir_variable.cpp \
52 ir_vec_index_to_cond_assign.cpp \
53 ir_vec_index_to_swizzle.cpp \
54 linker.cpp \
55 s_expression.cpp
56
57 LIBS = \
58 $(TOP)/src/glsl/libglsl.a \
59 $(shell pkg-config --libs talloc)
60
61 APPS = glsl_compiler
62 GLSL2_C_SOURCES = \
63 ../mesa/shader/hash_table.c \
64 ../mesa/shader/symbol_table.c
65 GLSL2_CXX_SOURCES = \
66 main.cpp
67
68 GLSL2_OBJECTS = \
69 $(GLSL2_C_SOURCES:.c=.o) \
70 $(GLSL2_CXX_SOURCES:.cpp=.o)
71
72 ### Basic defines ###
73
74 OBJECTS = \
75 $(C_SOURCES:.c=.o) \
76 $(CXX_SOURCES:.cpp=.o)
77
78 INCLUDES = \
79 -I. \
80 -I../mesa \
81 -I../mapi \
82 -I../mesa/shader \
83 $(LIBRARY_INCLUDES)
84
85 ALL_SOURCES = \
86 $(C_SOURCES) \
87 $(CXX_SOURCES) \
88 $(GLSL2_CXX_SOURCES) \
89 $(GLSL2_C_SOURCES)
90
91 ##### TARGETS #####
92
93 default: depend lib$(LIBNAME).a $(APPS)
94
95 lib$(LIBNAME).a: $(OBJECTS) Makefile $(TOP)/src/glsl/Makefile.template
96 $(MKLIB) -cplusplus -o $(LIBNAME) -static $(OBJECTS)
97
98 depend: $(ALL_SOURCES) Makefile
99 rm -f depend
100 touch depend
101 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(ALL_SOURCES) 2> /dev/null
102
103 # Remove .o and backup files
104 clean:
105 rm -f $(OBJECTS) lib$(LIBNAME).a depend depend.bak
106 -rm -f $(APPS)
107
108 # Dummy target
109 install:
110 @echo -n ""
111
112
113 ##### RULES #####
114
115 glsl_compiler: $(GLSL2_OBJECTS) libglsl.a
116 $(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLSL2_OBJECTS) $(LIBS) -o $@
117
118 .cpp.o:
119 $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(LIBRARY_DEFINES) $< -o $@
120
121 .c.o:
122 $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
123
124 glsl_lexer.cpp: glsl_lexer.lpp
125 flex --never-interactive --outfile="$@" $<
126
127 glsl_parser.cpp: glsl_parser.ypp
128 bison -v -o "$@" --defines=glsl_parser.h $<
129
130 glcpp/glcpp-lex.c: glcpp/glcpp-lex.l
131 flex --never-interactive --outfile="$@" $<
132
133 glcpp/glcpp-parse.c: glcpp/glcpp-parse.y
134 bison -v -o "$@" --defines=glcpp/glcpp-parse.h $<
135
136 builtin_function.cpp: builtins/*/*
137 ./builtins/tools/generate_builtins.pl > builtin_function.cpp
138
139 -include depend