A fix to the documentation makefile from John D. Mitchell.
[ragel.git] / examples / Makefile
bloba392aa845ce35bdc697920263c06856f03cdb219
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 FLEX = flex
23 RE2C = re2c
24 CFLAGS = -Wall -g -O3
26 TARGS = \
27 atoi awkemu clang concurrent cppscan format gotocallret mailbox params \
28 pullscan rlscan statechart
30 #########################################
32 all: $(TARGS)
34 distclean clean:
35 rm -Rf *.o *.c *.cpp $(TARGS)
37 %.o: %.c
38 gcc $(CFLAGS) -Wall -g -c -O3 -o $@ $<
40 %.o: %.cpp
41 g++ $(CFLAGS) -Wall -g -c -O3 -o $@ $<
43 #########################################
45 gotocallret: gotocallret.o
46 g++ -g -o gotocallret gotocallret.o
48 gotocallret.cpp: gotocallret.rl
49 $(RAGEL) -G2 -o gotocallret.cpp gotocallret.rl
51 gotocallret.o: gotocallret.cpp
52 g++ -Wall -g -c -O3 -o $@ $<
55 pullscan: pullscan.o
56 gcc -g -o $@ $<
58 pullscan.c: pullscan.rl $(RAGEL)
59 $(RAGEL) -G2 -o $@ pullscan.rl
61 concurrent: concurrent.o
62 g++ -g -o concurrent concurrent.o
64 concurrent.cpp: concurrent.rl $(RAGEL)
65 $(RAGEL) -G2 -o concurrent.cpp concurrent.rl
67 rlscan: rlscan.o
68 g++ -g -o rlscan rlscan.o
70 rlscan.cpp: rlscan.rl
71 $(RAGEL) -G2 -o rlscan.cpp rlscan.rl
73 statechart: statechart.o
74 g++ -g -o statechart statechart.o
76 statechart.cpp: statechart.rl
77 $(RAGEL) -G2 -o statechart.cpp statechart.rl
79 statechart.o: statechart.cpp
80 g++ -Wall -g -c -O3 -o $@ $<
82 params: params.o
83 gcc -g -o params params.o
85 params.c: params.rl
86 $(RAGEL) -G2 -o params.c params.rl
88 clang: clang.o
89 gcc -g -o clang clang.o
91 clang.c: clang.rl
92 $(RAGEL) -G2 -o clang.c clang.rl
94 optional: lex-cppscan re2c-cppscan
96 cppscan: cppscan.o
97 g++ -g -o $@ $<
99 lex-cppscan: lex-cppscan.o
100 g++ -g -o $@ $<
102 re2c-cppscan: re2c-cppscan.o
103 g++ -g -o $@ $<
105 cppscan.cpp: cppscan.rl
106 $(RAGEL) -G2 -o $@ cppscan.rl
108 lex-cppscan.cpp: cppscan.lex
109 $(FLEX) -f -o $@ $<
111 re2c-cppscan.cpp: cppscan.rec
112 $(RE2C) -s $< > $@
114 example.cpp: example.rec
115 $(RE2C) -s $< > $@
117 format: format.o
118 gcc -g -o format format.o
120 format.c: format.rl
121 $(RAGEL) -G2 -o format.c format.rl
123 awkemu: awkemu.o
124 gcc -g -o awkemu awkemu.o
126 awkemu.c: awkemu.rl
127 $(RAGEL) -G2 -o awkemu.c awkemu.rl
130 mailbox: mailbox.o
131 g++ -g -o mailbox mailbox.o
133 mailbox.cpp: mailbox.rl
134 $(RAGEL) -G2 -o mailbox.cpp mailbox.rl
136 atoi: atoi.o
137 g++ -g -o atoi atoi.o
139 atoi.cpp: atoi.rl
140 $(RAGEL) -G2 -o atoi.cpp atoi.rl
142 atoi.o: atoi.cpp
143 g++ -Wall -g -c -O3 -o $@ $<