mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-21 15:10:21 +01:00
The lexer was previously using strdup (expecting the parser to free), but is now more consistent, easier to use, and slightly more efficent by using talloc along with the parser. Also, we add xtalloc and xtalloc_strdup wrappers around talloc and talloc_strdup to put all of the out-of-memory-checking code in one place.
25 lines
622 B
Makefile
25 lines
622 B
Makefile
# Debug symbols by default, but let the user avoid that with something
|
|
# like "make CFLAGS=-O2"
|
|
CFLAGS = -g
|
|
|
|
# But we use 'override' here so that "make CFLAGS=-O2" will still have
|
|
# all the warnings enabled.
|
|
override CFLAGS += -Wall -Wextra -Wwrite-strings -Wswitch-enum -Wno-unused
|
|
|
|
glcpp: glcpp.o glcpp-lex.o glcpp-parse.o hash_table.o xtalloc.o
|
|
gcc -o $@ -ltalloc $^
|
|
|
|
%.c %.h: %.y
|
|
bison --debug --defines=$*.h --output=$*.c $^
|
|
|
|
%.c: %.l
|
|
flex --outfile=$@ $<
|
|
|
|
glcpp-lex.c: glcpp-parse.h
|
|
|
|
test:
|
|
@(cd tests; ./glcpp-test)
|
|
|
|
clean:
|
|
rm -f glcpp-lex.c glcpp-parse.c *.o *~
|
|
rm -f tests/*.out tests/*.gcc tests/*.expected
|