2010-05-12 12:17:10 -07:00
|
|
|
# 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.
|
2010-05-10 13:17:25 -07:00
|
|
|
override CFLAGS += -Wall -Wextra -Wwrite-strings -Wswitch-enum -Wno-unused
|
|
|
|
|
|
2010-05-12 12:45:33 -07:00
|
|
|
glcpp: glcpp.o glcpp-lex.o glcpp-parse.o hash_table.o xtalloc.o
|
2010-05-27 14:36:29 -07:00
|
|
|
gcc -o $@ -ltalloc -lm $^
|
2010-05-10 11:44:09 -07:00
|
|
|
|
|
|
|
|
%.c %.h: %.y
|
2010-05-10 16:14:59 -07:00
|
|
|
bison --debug --defines=$*.h --output=$*.c $^
|
2010-05-10 11:44:09 -07:00
|
|
|
|
|
|
|
|
%.c: %.l
|
2010-05-19 10:01:29 -07:00
|
|
|
flex --prefix=glcpp_ --outfile=$@ $<
|
2010-05-10 11:44:09 -07:00
|
|
|
|
|
|
|
|
glcpp-lex.c: glcpp-parse.h
|
|
|
|
|
|
2010-05-13 10:45:32 -07:00
|
|
|
test: glcpp
|
2010-05-10 16:21:10 -07:00
|
|
|
@(cd tests; ./glcpp-test)
|
|
|
|
|
|
2010-05-10 11:44:09 -07:00
|
|
|
clean:
|
2010-05-14 16:53:52 -07:00
|
|
|
rm -f glcpp glcpp-lex.c glcpp-parse.c *.o *~
|
2010-06-02 15:59:45 -07:00
|
|
|
rm -f tests/*.out tests/*~
|