summaryrefslogtreecommitdiff
path: root/tools/dfagen/examples/Makefile
diff options
context:
space:
mode:
authorNicolas Schodet2008-03-17 22:53:01 +0100
committerNicolas Schodet2008-03-17 22:53:01 +0100
commit164ac3a34cbac441e82b256c97cb8784ea9d482c (patch)
treeb0db1276083d168b50e6aa2be9621368a36184cd /tools/dfagen/examples/Makefile
parent388a90600023cca7d7b28702fa4cc75ed5074123 (diff)
* tools/dfagen:
- added dfagen.
Diffstat (limited to 'tools/dfagen/examples/Makefile')
-rw-r--r--tools/dfagen/examples/Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/tools/dfagen/examples/Makefile b/tools/dfagen/examples/Makefile
new file mode 100644
index 00000000..b78f1121
--- /dev/null
+++ b/tools/dfagen/examples/Makefile
@@ -0,0 +1,40 @@
+CFLAGS = -O2 -Wall
+
+all: ex1 ex2 ex1.png ex2.png
+
+ex1: ex1.o ex1_cb.o
+
+ex1.c: ex1.fsm ex1.conf
+ python ../dfagen.py -o c -d ex1.fsm -c ex1.conf -p ex1
+
+ex1.h ex1_cb_skel.c ex1_cb.h: ex1.c
+
+ex1_cb.c: ex1_cb_skel.c ex1_cb.c.patch
+ cp $< $@
+ patch $@ ex1_cb.c.patch
+
+ex1.o: ex1_cb.h ex1.h
+ex1_cb.o: ex1_cb.h ex1.h
+
+ex2: ex2.o ex2_cb.o ex2_robot.o
+
+ex2.c: ex2.fsm ex2.conf
+ python ../dfagen.py -o c -d ex2.fsm -c ex2.conf -p ex2
+
+ex2.h ex2_cb_skel.c ex2_cb.h: ex2.c
+
+ex2_cb.c: ex2_cb_skel.c ex2_cb.c.patch
+ cp $< $@
+ patch $@ ex2_cb.c.patch
+
+%.dot: %.fsm
+ python ../dfagen.py -o dot -d $< -p $(@:%.dot=%)
+
+%.png: %.dot
+ dot -Tpng $< -o $@
+
+clean:
+ rm -f ex1 ex1.o ex1_cb.o ex1.c ex1.h ex1_cb_skel.c ex1_cb.h ex1_cb.c
+ rm -f ex1.dot ex1.png
+ rm -f ex2 ex2.o ex2_cb.o ex2_robot.o ex2.c ex2.h ex2_cb_skel.c ex2_cb.h ex2_cb.c
+ rm -f ex2.dot ex2.png