summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: db01b9438ee96aaf82fb82c8c51d216d323cbad4 (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
40

CC     = gcc
CFLAGS = -ggdb3 `pkg-config --cflags --libs eina`
BIN = eo_tokenizer
SRC = main.c eo_tokenizer.c
LOG = EINA_LOG_LEVELS=eo_toknz:4

.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
	$(LOG) ./eo_tokenizer ./data/comments.c

clean:
	rm -f *~ *.o *.dot *.png *.xml $(BIN).c $(BIN)