revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / mesa / src / glsl / Makefile
blobd1422c2a4d6b63c923567640f65c615aa87dc519
2 #src/glsl/pp/Makefile
4 TOP = ../..
6 include $(TOP)/configs/current
8 LIBNAME = glsl
10 LIBGLCPP_SOURCES = \
11 glcpp/glcpp-lex.c \
12 glcpp/glcpp-parse.c \
13 glcpp/pp.c
15 GLCPP_SOURCES = \
16 $(LIBGLCPP_SOURCES) \
17 ralloc.c \
18 glcpp/glcpp.c
20 C_SOURCES = \
21 strtod.c \
22 ralloc.c \
23 $(LIBGLCPP_SOURCES)
25 CXX_SOURCES = \
26 ast_expr.cpp \
27 ast_function.cpp \
28 ast_to_hir.cpp \
29 ast_type.cpp \
30 glsl_lexer.cpp \
31 glsl_parser.cpp \
32 glsl_parser_extras.cpp \
33 glsl_types.cpp \
34 glsl_symbol_table.cpp \
35 hir_field_selection.cpp \
36 ir_basic_block.cpp \
37 ir_clone.cpp \
38 ir_constant_expression.cpp \
39 ir.cpp \
40 ir_expression_flattening.cpp \
41 ir_function_can_inline.cpp \
42 ir_function_detect_recursion.cpp \
43 ir_function.cpp \
44 ir_hierarchical_visitor.cpp \
45 ir_hv_accept.cpp \
46 ir_import_prototypes.cpp \
47 ir_print_visitor.cpp \
48 ir_reader.cpp \
49 ir_rvalue_visitor.cpp \
50 ir_set_program_inouts.cpp \
51 ir_validate.cpp \
52 ir_variable.cpp \
53 ir_variable_refcount.cpp \
54 linker.cpp \
55 link_functions.cpp \
56 loop_analysis.cpp \
57 loop_controls.cpp \
58 loop_unroll.cpp \
59 lower_discard.cpp \
60 lower_if_to_cond_assign.cpp \
61 lower_instructions.cpp \
62 lower_jumps.cpp \
63 lower_mat_op_to_vec.cpp \
64 lower_noise.cpp \
65 lower_texture_projection.cpp \
66 lower_variable_index_to_cond_assign.cpp \
67 lower_vec_index_to_cond_assign.cpp \
68 lower_vec_index_to_swizzle.cpp \
69 lower_vector.cpp \
70 opt_algebraic.cpp \
71 opt_constant_folding.cpp \
72 opt_constant_propagation.cpp \
73 opt_constant_variable.cpp \
74 opt_copy_propagation.cpp \
75 opt_copy_propagation_elements.cpp \
76 opt_dead_code.cpp \
77 opt_dead_code_local.cpp \
78 opt_dead_functions.cpp \
79 opt_discard_simplification.cpp \
80 opt_function_inlining.cpp \
81 opt_if_simplification.cpp \
82 opt_noop_swizzle.cpp \
83 opt_redundant_jumps.cpp \
84 opt_structure_splitting.cpp \
85 opt_swizzle_swizzle.cpp \
86 opt_tree_grafting.cpp \
87 s_expression.cpp
89 LIBS = \
90 $(TOP)/src/glsl/libglsl.a
92 APPS = glsl_compiler glcpp/glcpp
94 GLSL2_C_SOURCES = \
95 ../mesa/program/hash_table.c \
96 ../mesa/program/symbol_table.c
97 GLSL2_CXX_SOURCES = \
98 main.cpp
100 GLSL2_OBJECTS = \
101 $(GLSL2_C_SOURCES:.c=.o) \
102 $(GLSL2_CXX_SOURCES:.cpp=.o)
104 ### Basic defines ###
106 DEFINES += \
107 $(LIBRARY_DEFINES) \
108 $(API_DEFINES)
110 GLCPP_OBJECTS = \
111 $(GLCPP_SOURCES:.c=.o) \
112 ../mesa/program/hash_table.o
114 OBJECTS = \
115 $(C_SOURCES:.c=.o) \
116 $(CXX_SOURCES:.cpp=.o)
118 DRICORE_OBJ_DIR = obj-visible
119 OBJECTS_DRICORE = $(addprefix $(DRICORE_OBJ_DIR)/,$(OBJECTS))
121 INCLUDES = \
122 -I. \
123 -I../mesa \
124 -I../mapi \
125 -I../../include \
126 $(LIBRARY_INCLUDES)
128 ALL_SOURCES = \
129 $(C_SOURCES) \
130 $(CXX_SOURCES) \
131 $(GLSL2_CXX_SOURCES) \
132 $(GLSL2_C_SOURCES)
134 ##### TARGETS #####
136 default: depend lib$(LIBNAME).a $(APPS) $(DRICORE_GLSL_LIBS)
138 $(TOP)/$(LIB_DIR)/libglsl.so: $(OBJECTS_DRICORE) builtin_function.o Makefile $(TOP)/src/glsl/Makefile.template
139 $(MKLIB) -o $@ -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
140 -cplusplus -noprefix \
141 -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/$@.dylib \
142 $(OBJECTS_DRICORE) builtin_function.o
144 lib$(LIBNAME).a: $(OBJECTS) builtin_function.o Makefile $(TOP)/src/glsl/Makefile.template
145 $(MKLIB) -cplusplus -o $(LIBNAME) -static $(OBJECTS) builtin_function.o
147 depend: $(ALL_SOURCES) Makefile
148 rm -f depend
149 touch depend
150 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(ALL_SOURCES) 2> /dev/null
152 # Remove .o and backup files
153 clean: clean-dricore
154 rm -f $(GLCPP_OBJECTS) $(GLSL2_OBJECTS) $(OBJECTS) lib$(LIBNAME).a depend depend.bak builtin_function.cpp builtin_function.o builtin_stubs.o builtin_compiler
155 -rm -f $(APPS)
157 clean-dricore:
158 -rm -f $(OBJECTS_DRICORE) $(TOP)/$(LIB_DIR)/libglsl.so libglsl.so
160 ifneq (,$(DRICORE_GLSL_LIBS))
161 DRICORE_INSTALL_TARGET = install-dricore
162 endif
164 # Dummy target
165 install: $(DRICORE_INSTALL_TARGET)
166 @echo -n ""
168 install-dricore: default
169 $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
170 $(INSTALL) -m 755 $(DRICORE_GLSL_LIBS) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
172 ##### RULES #####
174 glsl_compiler: $(GLSL2_OBJECTS) libglsl.a builtin_stubs.o
175 $(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLSL2_OBJECTS) builtin_stubs.o $(LIBS) -o $@
177 glcpp: glcpp/glcpp
178 glcpp/glcpp: $(GLCPP_OBJECTS)
179 $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLCPP_OBJECTS) -o $@
181 .cpp.o:
182 $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@
184 .c.o:
185 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
187 $(DRICORE_OBJ_DIR)/%.o : %.cpp
188 @mkdir -p $(dir $@)
189 $(CXX) -c $(INCLUDES) $(DRI_CXXFLAGS) $(DEFINES) $< -o $@
191 $(DRICORE_OBJ_DIR)/%.o : %.c
192 @mkdir -p $(dir $@)
193 $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DEFINES) $< -o $@
195 glsl_lexer.cpp: glsl_lexer.ll
196 $(FLEX) --nounistd -o$@ $<
198 glsl_parser.cpp: glsl_parser.yy
199 $(BISON) -v -o "$@" -p "_mesa_glsl_" --defines=glsl_parser.h $<
201 glcpp/glcpp-lex.c: glcpp/glcpp-lex.l
202 $(FLEX) --nounistd -o$@ $<
204 glcpp/glcpp-parse.c: glcpp/glcpp-parse.y
205 $(BISON) -v -o "$@" --defines=glcpp/glcpp-parse.h $<
207 builtin_compiler: $(GLSL2_OBJECTS) $(OBJECTS) builtin_stubs.o
208 $(APP_CXX) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(GLSL2_OBJECTS) builtin_stubs.o -o $@
210 builtin_function.cpp: builtins/profiles/* builtins/ir/* builtins/tools/generate_builtins.py builtins/tools/texture_builtins.py builtin_compiler
211 @echo Regenerating builtin_function.cpp...
212 $(PYTHON2) $(PYTHON_FLAGS) builtins/tools/generate_builtins.py ./builtin_compiler > builtin_function.cpp || rm -f builtin_function.cpp
214 -include depend