summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-11-23 03:05:05 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-11-23 03:05:05 +0100
commit013625545c75dd63e62dc4470b5b90ac428e735d (patch)
tree60aad636287671f5a1a2ed122de26c1dd19a6b6c /Makefile
downloadeo_tokenizer-013625545c75dd63e62dc4470b5b90ac428e735d.zip
eo_tokenizer-013625545c75dd63e62dc4470b5b90ac428e735d.tar.gz
initial commit: support C/C++ comments
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..949524c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+
+CC = gcc
+CFLAGS = -ggdb3 `pkg-config --cflags --libs eina`
+BIN = eo_tokenizer
+SRC = main.c eo_tokenizer.c
+
+.PHONY: clean
+.SUFFIXES: .rl .xml .dot .png
+
+.rl.c:
+ ragel -s -o $@ $<
+
+.rl.xml:
+ ragel -x -o $@ $<
+
+.rl.dot:
+ ragel -V -p -S eo_tokenizer -o $@ $<
+
+.dot.png:
+ dot -Tpng >$@ $<
+
+.c.o:
+ $(CC) -c -Wall -I. $(CFLAGS) -D$(STD) -o $@ $<
+
+all: $(BIN)
+
+eo_tokenizer.c: eo_tokenizer.rl
+eo_tokenizer.xml: eo_tokenizer.rl
+eo_tokenizer.dot: eo_tokenizer.rl
+eo_tokenizer.png: eo_tokenizer.dot
+
+eo_tokenizer: main.c eo_tokenizer.c eo_tokenizer.h
+
+test-comments: eo_tokenizer
+ EINA_LOG_LEVELS=eo_toknz:4 ./eo_tokenizer ./data/comments.c
+
+clean:
+ rm -f *~ *.o *.dot *.png *.xml $(BIN).c $(BIN)
+