summaryrefslogtreecommitdiff
path: root/glcpp/Makefile
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-06-21 11:22:11 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-06-21 11:22:11 -0700
commit6f510a49d2f3271432844d6b7e2bfe459b2126d4 (patch)
tree7ad316228b4353bbdf0070d61a754b84b29c1a30 /glcpp/Makefile
parentf3eb42d200bb78afae64af6862e2b12396226707 (diff)
parent2fb30a2e492e466a7b383e8ca430ba7371b443ee (diff)
Merge Carl's preprocessor into the glcpp subdirectory.
Diffstat (limited to 'glcpp/Makefile')
-rw-r--r--glcpp/Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/glcpp/Makefile b/glcpp/Makefile
new file mode 100644
index 0000000000..3fb44ac3b2
--- /dev/null
+++ b/glcpp/Makefile
@@ -0,0 +1,25 @@
+# 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 -lm $^
+
+%.c %.h: %.y
+ bison --debug --defines=$*.h --output=$*.c $^
+
+%.c: %.l
+ flex --prefix=glcpp_ --outfile=$@ $<
+
+glcpp-lex.c: glcpp-parse.h
+
+test: glcpp
+ @(cd tests; ./glcpp-test)
+
+clean:
+ rm -f glcpp glcpp-lex.c glcpp-parse.c *.o *~
+ rm -f tests/*.out tests/*~