In the variable statement changed the name "curstate" to "cs" (the default
[ragel.git] / examples / Makefile
blob7e4738688d0f762994fb08b5f179451b393c5fef
2 # Copyright 2002-2007 Adrian Thurston <thurston@cs.queensu.ca>
5 # This file is part of Ragel.
7 # Ragel is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # Ragel is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Ragel; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 RAGEL = ../ragel/ragel
22 RLCODEGEN = ../rlgen-cd/rlgen-cd
23 FLEX = flex
24 RE2C = re2c
25 CFLAGS = -Wall -g -O3
27 TARGS = \
28 atoi awkemu clang concurrent cppscan format gotocallret mailbox params \
29 pullscan rlscan statechart
31 #########################################
33 all: $(TARGS)
35 distclean clean:
36 rm -Rf *.o *.c *.cpp $(TARGS)
38 %.o: %.c
39 gcc $(CFLAGS) -Wall -g -c -O3 -o $@ $<
41 %.o: %.cpp
42 g++ $(CFLAGS) -Wall -g -c -O3 -o $@ $<
44 #########################################
46 gotocallret: gotocallret.o
47 g++ -g -o gotocallret gotocallret.o
49 gotocallret.cpp: gotocallret.rl $(RAGEL) $(RLCODEGEN)
50 $(RAGEL) gotocallret.rl | $(RLCODEGEN) -G2 -o gotocallret.cpp
52 gotocallret.o: gotocallret.cpp
53 g++ -Wall -g -c -O3 -o $@ $<
56 pullscan: pullscan.o
57 gcc -g -o $@ $<
59 pullscan.c: pullscan.rl $(RAGEL) $(RLCODEGEN)
60 $(RAGEL) pullscan.rl | $(RLCODEGEN) -G2 -o $@
62 concurrent: concurrent.o
63 g++ -g -o concurrent concurrent.o
65 concurrent.cpp: concurrent.rl $(RAGEL) $(RLCODEGEN)
66 $(RAGEL) concurrent.rl | $(RLCODEGEN) -G2 -o concurrent.cpp
68 rlscan: rlscan.o
69 g++ -g -o rlscan rlscan.o
71 rlscan.cpp: rlscan.rl $(RAGEL) $(RLCODEGEN)
72 $(RAGEL) rlscan.rl | $(RLCODEGEN) -G2 -o rlscan.cpp
74 statechart: statechart.o
75 g++ -g -o statechart statechart.o
77 statechart.cpp: statechart.rl $(RAGEL) $(RLCODEGEN)
78 $(RAGEL) statechart.rl | $(RLCODEGEN) -G2 -o statechart.cpp
80 statechart.o: statechart.cpp
81 g++ -Wall -g -c -O3 -o $@ $<
83 params: params.o
84 gcc -g -o params params.o
86 params.c: params.rl $(RAGEL) $(RLCODEGEN)
87 $(RAGEL) params.rl | $(RLCODEGEN) -G2 -o params.c
89 clang: clang.o
90 gcc -g -o clang clang.o
92 clang.c: clang.rl $(RAGEL) $(RLCODEGEN)
93 $(RAGEL) clang.rl | $(RLCODEGEN) -G2 -o clang.c
95 optional: lex-cppscan re2c-cppscan
97 cppscan: cppscan.o
98 g++ -g -o $@ $<
100 lex-cppscan: lex-cppscan.o
101 g++ -g -o $@ $<
103 re2c-cppscan: re2c-cppscan.o
104 g++ -g -o $@ $<
106 cppscan.cpp: cppscan.rl $(RAGEL) $(RLCODEGEN)
107 $(RAGEL) cppscan.rl | $(RLCODEGEN) -G2 -o $@
109 lex-cppscan.cpp: cppscan.lex
110 $(FLEX) -f -o $@ $<
112 re2c-cppscan.cpp: cppscan.rec
113 $(RE2C) -s $< > $@
115 example.cpp: example.rec
116 $(RE2C) -s $< > $@
118 format: format.o
119 gcc -g -o format format.o
121 format.c: format.rl $(RAGEL) $(RLCODEGEN)
122 $(RAGEL) format.rl | $(RLCODEGEN) -G2 -o format.c
124 awkemu: awkemu.o
125 gcc -g -o awkemu awkemu.o
127 awkemu.c: awkemu.rl $(RAGEL) $(RLCODEGEN)
128 $(RAGEL) awkemu.rl | $(RLCODEGEN) -G2 -o awkemu.c
131 mailbox: mailbox.o
132 g++ -g -o mailbox mailbox.o
134 mailbox.cpp: mailbox.rl $(RAGEL) $(RLCODEGEN)
135 $(RAGEL) mailbox.rl | $(RLCODEGEN) -G2 -o mailbox.cpp
137 atoi: atoi.o
138 g++ -g -o atoi atoi.o
140 atoi.cpp: atoi.rl $(RAGEL) $(RLCODEGEN)
141 $(RAGEL) atoi.rl | $(RLCODEGEN) -G2 -o atoi.cpp
143 atoi.o: atoi.cpp
144 g++ -Wall -g -c -O3 -o $@ $<