summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 359aeb0d3fae0c4b63c1891f10357c2c5da0bacf (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
41
42
43
44
45

CC     = gcc
CFLAGS = -ggdb3 `pkg-config --cflags --libs eina`
BIN = eo_tokenizer
SRC = main.c eo_tokenizer.c eo_definitions.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) $< -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_definitions.o: eo_definitions.c eo_definitions.h
eo_tokenizer.o: eo_tokenizer.c eo_tokenizer.h eo_definitions.h
main.o: main.c eo_tokenizer.h

eo_tokenizer: main.o eo_tokenizer.o eo_definitions.o
	$(CC) -Wall -I. $(CFLAGS) main.o eo_tokenizer.o eo_definitions.o -o $@

test: eo_tokenizer
	$(LOG) ./eo_tokenizer ./data/*.c

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