summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 949524c1f73371d84395239d87581c22de7bb17b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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)