Rename .cc files to .cpp
[mesa.git] / Makefile
1 CSRCS = symbol_table.c hash_table.c glsl_types.c
2 CCSRCS = glsl_parser.tab.cpp glsl_lexer.cpp glsl_parser_extras.cpp
3 # ast_to_hir.cpp ir.cpp hir_field_selection.cpp
4 OBJS = $(CSRCS:.c=.o) $(CCSRCS:.cpp=.o)
5
6 CC = gcc
7 CXX = g++
8 WARN = -Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector \
9 -Wunreachable-code
10 CPPFLAGS = -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
11 CFLAGS = -O0 -ggdb3 -fstack-protector $(CPPFLAGS) $(WARN) -std=c89 -ansi -pedantic
12 CXXFLAGS = -O0 -ggdb3 -fstack-protector $(CPPFLAGS) $(WARN)
13 LDLAGS = -ggdb3
14
15 glsl: $(OBJS)
16 $(CXX) $(LDLAGS) $(OBJS) -o glsl
17
18 glsl_parser.tab.cpp glsl_parser.tab.h: glsl_parser.y
19 bison --report-file=glsl_parser.output -v -d \
20 --output=glsl_parser.tab.cpp \
21 --name-prefix=_mesa_glsl_ $< && \
22 mv glsl_parser.tab.hpp glsl_parser.tab.h
23
24 glsl_lexer.cpp: glsl_lexer.l
25 flex --outfile="glsl_lexer.cpp" $<
26
27 glsl_parser_tab.o: glsl_parser.tab.cpp
28 glsl_types.o: glsl_types.c glsl_types.h builtin_types.h
29 glsl_lexer.o: glsl_lexer.cpp glsl_parser.tab.h glsl_parser_extras.h ast.h
30 glsl_parser.o: glsl_parser_extras.h ast.h
31 ast_to_hir.o: ast_to_hir.cpp symbol_table.h glsl_parser_extras.h ast.h glsl_types.h ir.h
32
33 builtin_types.h: builtin_types.sh
34 ./builtin_types.sh > builtin_types.h
35
36 clean:
37 rm -f $(OBJS) glsl
38 rm -f glsl_lexer.cpp glsl_parser.tab.{cpp,h,hpp} glsl_parser.output
39 rm -f builtin_types.h
40 rm -f *~