Add support for the structure of function-like macros.
[mesa.git] / Makefile
1 # Debug symbols by default, but let the user avoid that with something
2 # like "make CFLAGS=-O2"
3 CFLAGS = -g
4
5 # But we use 'override' here so that "make CFLAGS=-O2" will still have
6 # all the warnings enabled.
7 override CFLAGS += -Wall -Wextra -Wwrite-strings -Wswitch-enum -Wno-unused
8
9 glcpp: glcpp.o glcpp-lex.o glcpp-parse.o hash_table.o xtalloc.o
10 gcc -o $@ -ltalloc $^
11
12 %.c %.h: %.y
13 bison --debug --defines=$*.h --output=$*.c $^
14
15 %.c: %.l
16 flex --outfile=$@ $<
17
18 glcpp-lex.c: glcpp-parse.h
19
20 test:
21 @(cd tests; ./glcpp-test)
22
23 clean:
24 rm -f glcpp-lex.c glcpp-parse.c *.o *~
25 rm -f tests/*.out tests/*.gcc tests/*.expected tests/*~