forked from yasserislam/MROGeometry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (26 loc) · 1.01 KB
/
Makefile
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
#!/usr/bin/make
# ##############################################################
# ragel stuff. http://www.complang.org/ragel/
DOT ?= dot
RAGEL ?= ragel
RAGEL_DIR := .
GENERATED_DIR := .
RAGEL_SOURCES := $(wildcard ./$(RAGEL_DIR)/*.rl)
RAGEL_GENERATED := $(RAGEL_SOURCES:./$(RAGEL_DIR)/%.rl=./$(GENERATED_DIR)/%.m)
RAGEL_PDF := $(RAGEL_SOURCES:./$(RAGEL_DIR)/%.rl=./$(GENERATED_DIR)/%.pdf)
./$(GENERATED_DIR)/%.m : ./$(RAGEL_DIR)/%.rl
$(RAGEL) -e -s -G2 -C -o $@ $<
./$(GENERATED_DIR)/%.dot : ./$(RAGEL_DIR)/%.rl
$(RAGEL) -e -p -V -o $@ $<
%.pdf: %.dot
$(DOT) -Tpdf -o $@ $<
################################################################
## Run ragel to generate statemachine implementations
generate: $(RAGEL_GENERATED)
################################################################
## Create ragel statemachine charts - runs literally for hours
doc: $(RAGEL_PDF)
################################################################
## remove all ragel generated artifacts
clean:
-rm $(RAGEL_GENERATED) $(RAGEL_PDF)