Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1901 | serge | 1 | #src/glsl/pp/Makefile |
2 | |||
3 | TOP = ../.. |
||
4 | |||
5 | include $(TOP)/configs/current |
||
6 | |||
7 | LIBNAME = glsl |
||
8 | |||
9 | LIBGLCPP_SOURCES = \ |
||
10 | glcpp/glcpp-lex.c \ |
||
11 | glcpp/glcpp-parse.c \ |
||
12 | glcpp/pp.c |
||
13 | |||
14 | GLCPP_SOURCES = \ |
||
15 | $(LIBGLCPP_SOURCES) \ |
||
16 | glcpp/glcpp.c |
||
17 | |||
18 | C_SOURCES = \ |
||
19 | strtod.c \ |
||
20 | ralloc.c \ |
||
21 | $(LIBGLCPP_SOURCES) |
||
22 | |||
23 | CXX_SOURCES = \ |
||
24 | ast_expr.cpp \ |
||
25 | ast_function.cpp \ |
||
26 | ast_to_hir.cpp \ |
||
27 | ast_type.cpp \ |
||
28 | builtin_function.cpp \ |
||
29 | glsl_lexer.cpp \ |
||
30 | glsl_parser.cpp \ |
||
31 | glsl_parser_extras.cpp \ |
||
32 | glsl_types.cpp \ |
||
33 | glsl_symbol_table.cpp \ |
||
34 | hir_field_selection.cpp \ |
||
35 | ir_basic_block.cpp \ |
||
36 | ir_clone.cpp \ |
||
37 | ir_constant_expression.cpp \ |
||
38 | ir.cpp \ |
||
39 | ir_expression_flattening.cpp \ |
||
40 | ir_function_can_inline.cpp \ |
||
41 | ir_function.cpp \ |
||
42 | ir_hierarchical_visitor.cpp \ |
||
43 | ir_hv_accept.cpp \ |
||
44 | ir_import_prototypes.cpp \ |
||
45 | ir_print_visitor.cpp \ |
||
46 | ir_reader.cpp \ |
||
47 | ir_rvalue_visitor.cpp \ |
||
48 | ir_set_program_inouts.cpp \ |
||
49 | ir_validate.cpp \ |
||
50 | ir_variable.cpp \ |
||
51 | ir_variable_refcount.cpp \ |
||
52 | linker.cpp \ |
||
53 | link_functions.cpp \ |
||
54 | loop_analysis.cpp \ |
||
55 | loop_controls.cpp \ |
||
56 | loop_unroll.cpp \ |
||
57 | lower_discard.cpp \ |
||
58 | lower_if_to_cond_assign.cpp \ |
||
59 | lower_instructions.cpp \ |
||
60 | lower_jumps.cpp \ |
||
61 | lower_mat_op_to_vec.cpp \ |
||
62 | lower_noise.cpp \ |
||
63 | lower_texture_projection.cpp \ |
||
64 | lower_variable_index_to_cond_assign.cpp \ |
||
65 | lower_vec_index_to_cond_assign.cpp \ |
||
66 | lower_vec_index_to_swizzle.cpp \ |
||
67 | lower_vector.cpp \ |
||
68 | opt_algebraic.cpp \ |
||
69 | opt_constant_folding.cpp \ |
||
70 | opt_constant_propagation.cpp \ |
||
71 | opt_constant_variable.cpp \ |
||
72 | opt_copy_propagation.cpp \ |
||
73 | opt_dead_code.cpp \ |
||
74 | opt_dead_code_local.cpp \ |
||
75 | opt_dead_functions.cpp \ |
||
76 | opt_discard_simplification.cpp \ |
||
77 | opt_function_inlining.cpp \ |
||
78 | opt_if_simplification.cpp \ |
||
79 | opt_noop_swizzle.cpp \ |
||
80 | opt_redundant_jumps.cpp \ |
||
81 | opt_structure_splitting.cpp \ |
||
82 | opt_swizzle_swizzle.cpp \ |
||
83 | opt_tree_grafting.cpp \ |
||
84 | s_expression.cpp |
||
85 | |||
86 | LIBS = \ |
||
87 | $(TOP)/src/glsl/libglsl.a |
||
88 | |||
89 | APPS = glsl_compiler glcpp/glcpp |
||
90 | |||
91 | GLSL2_C_SOURCES = \ |
||
92 | ../mesa/program/hash_table.c \ |
||
93 | ../mesa/program/symbol_table.c |
||
94 | GLSL2_CXX_SOURCES = \ |
||
95 | main.cpp |
||
96 | |||
97 | GLSL2_OBJECTS = \ |
||
98 | $(GLSL2_C_SOURCES:.c=.o) \ |
||
99 | $(GLSL2_CXX_SOURCES:.cpp=.o) |
||
100 | |||
101 | ### Basic defines ### |
||
102 | |||
103 | DEFINES += \ |
||
104 | $(LIBRARY_DEFINES) \ |
||
105 | $(API_DEFINES) |
||
106 | |||
107 | GLCPP_OBJECTS = \ |
||
108 | $(GLCPP_SOURCES:.c=.o) \ |
||
109 | ../mesa/program/hash_table.o |
||
110 | |||
111 | OBJECTS = \ |
||
112 | $(C_SOURCES:.c=.o) \ |
||
113 | $(CXX_SOURCES:.cpp=.o) |
||
114 | |||
115 | INCLUDES = \ |
||
116 | -I. \ |
||
117 | -I../mesa \ |
||
118 | -I../mapi \ |
||
119 | -I../../include \ |
||
120 | $(LIBRARY_INCLUDES) |
||
121 | |||
122 | ALL_SOURCES = \ |
||
123 | $(C_SOURCES) \ |
||
124 | $(CXX_SOURCES) \ |
||
125 | $(GLSL2_CXX_SOURCES) \ |
||
126 | $(GLSL2_C_SOURCES) |
||
127 | |||
128 | ##### TARGETS ##### |
||
129 | |||
130 | default: depend lib$(LIBNAME).a $(APPS) |
||
131 | |||
132 | lib$(LIBNAME).a: $(OBJECTS) Makefile $(TOP)/src/glsl/Makefile.template |
||
133 | $(MKLIB) -cplusplus -o $(LIBNAME) -static $(OBJECTS) |
||
134 | |||
135 | depend: $(ALL_SOURCES) Makefile |
||
136 | rm -f depend |
||
137 | touch depend |
||
138 | $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(ALL_SOURCES) 2> /dev/null |
||
139 | |||
140 | # Remove .o and backup files |
||
141 | clean: |
||
142 | rm -f $(GLCPP_OBJECTS) $(GLSL2_OBJECTS) $(OBJECTS) lib$(LIBNAME).a depend depend.bak |
||
143 | -rm -f $(APPS) |
||
144 | |||
145 | # Dummy target |
||
146 | install: |
||
147 | @echo -n "" |
||
148 | |||
149 | |||
150 | ##### RULES ##### |
||
151 | |||
152 | glsl_compiler: $(GLSL2_OBJECTS) libglsl.a |
||
153 | $(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLSL2_OBJECTS) $(LIBS) -o $@ |
||
154 | |||
155 | glcpp/glcpp: $(GLCPP_OBJECTS) libglsl.a |
||
156 | $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLCPP_OBJECTS) $(LIBS) -o $@ |
||
157 | |||
158 | .cpp.o: |
||
159 | $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@ |
||
160 | |||
161 | .c.o: |
||
162 | $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ |
||
163 | |||
164 | glsl_lexer.cpp: glsl_lexer.lpp |
||
165 | flex --nounistd -o$@ $< |
||
166 | |||
167 | glsl_parser.cpp: glsl_parser.ypp |
||
168 | bison -v -o "$@" -p "_mesa_glsl_" --defines=glsl_parser.h $< |
||
169 | |||
170 | glcpp/glcpp-lex.c: glcpp/glcpp-lex.l |
||
171 | flex --nounistd -o$@ $< |
||
172 | |||
173 | glcpp/glcpp-parse.c: glcpp/glcpp-parse.y |
||
174 | bison -v -o "$@" --defines=glcpp/glcpp-parse.h $< |
||
175 | |||
176 | builtins: builtin_function.cpp builtins/profiles/* builtins/ir/* builtins/tools/generate_builtins.py builtins/tools/texture_builtins.py |
||
177 | @echo Bootstrapping the compiler... |
||
178 | cp builtins/tools/builtin_function.cpp . |
||
179 | make glsl_compiler |
||
180 | @echo Regenerating builtin_function.cpp... |
||
181 | $(PYTHON2) $(PYTHON_FLAGS) builtins/tools/generate_builtins.py > builtin_function.cpp |
||
182 | @echo Rebuilding the real compiler... |
||
183 | make glsl_compiler |
||
184 | |||
185 | -include depend |