959af6a5effdfdf25d3fa50c155ed084b7ad6047
[external/ragel.git] / examples / Makefile.am
1 #
2 #   Copyright 2002-2007 Adrian Thurston <thurston@complang.org>
3 #
4
5 #   This file is part of Ragel.
6 #
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.
11 #
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.
16 #
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 
20
21 RAGEL = ../ragel/ragel
22 FLEX = flex
23 RE2C = re2c
24
25 TARGS = \
26         atoi awkemu clang concurrent cppscan format gotocallret mailbox params \
27         pullscan rlscan statechart 
28
29 #########################################
30
31 all: $(TARGS)
32
33 #%.o: %.c
34 #       gcc $(CFLAGS) -Wall -g -c -O3 -o $@ $<
35
36 #%.o: %.cpp
37 #       g++ $(CXXFLAGS) -Wall -g -c -O3 -o $@ $<
38
39 #########################################
40
41 gotocallret: gotocallret.o
42         g++ -g -o gotocallret gotocallret.o 
43
44 gotocallret.cpp: gotocallret.rl
45         $(RAGEL) -G2 -o gotocallret.cpp gotocallret.rl 
46
47 gotocallret.o: gotocallret.cpp
48         g++ -Wall -g -c -O3 -o $@ $<
49
50
51 pullscan: pullscan.o
52         gcc -g -o $@ $<
53
54 pullscan.c: pullscan.rl $(RAGEL) 
55         $(RAGEL) -G2 -o $@ pullscan.rl
56
57 concurrent: concurrent.o
58         g++ -g -o concurrent concurrent.o 
59
60 concurrent.cpp: concurrent.rl $(RAGEL)
61         $(RAGEL) -G2 -o concurrent.cpp concurrent.rl
62
63 rlscan: rlscan.o
64         g++ -g -o rlscan rlscan.o 
65
66 rlscan.cpp: rlscan.rl 
67         $(RAGEL) -G2 -o rlscan.cpp rlscan.rl
68
69 statechart: statechart.o
70         g++ -g -o statechart statechart.o 
71
72 statechart.cpp: statechart.rl 
73         $(RAGEL) -G2 -o statechart.cpp statechart.rl
74
75 statechart.o: statechart.cpp
76         g++ -Wall -g -c -O3 -o $@ $<
77
78 params: params.o 
79         gcc -g -o params params.o
80
81 params.c: params.rl
82         $(RAGEL) -G2 -o params.c params.rl
83
84 clang: clang.o 
85         gcc -g -o clang clang.o
86
87 clang.c: clang.rl 
88         $(RAGEL) -G2 -o clang.c clang.rl
89
90 optional: lex-cppscan re2c-cppscan
91
92 cppscan: cppscan.o
93         g++ -g -o $@ $<
94
95 lex-cppscan: lex-cppscan.o
96         g++ -g -o $@ $<
97         
98 re2c-cppscan: re2c-cppscan.o
99         g++ -g -o $@ $<
100         
101 cppscan.cpp: cppscan.rl 
102         $(RAGEL) -G2 -o $@ cppscan.rl
103
104 lex-cppscan.cpp: cppscan.lex
105         $(FLEX) -f -o $@ $<
106
107 re2c-cppscan.cpp: cppscan.rec
108         $(RE2C) -s $< > $@
109
110 example.cpp: example.rec
111         $(RE2C) -s $< > $@
112
113 format: format.o 
114         gcc -g -o format format.o
115
116 format.c: format.rl
117         $(RAGEL) -G2 -o format.c format.rl
118
119 awkemu: awkemu.o
120         gcc -g -o awkemu awkemu.o
121
122 awkemu.c: awkemu.rl
123         $(RAGEL) -G2 -o awkemu.c awkemu.rl
124
125
126 mailbox: mailbox.o
127         g++ -g -o mailbox mailbox.o 
128
129 mailbox.cpp: mailbox.rl
130         $(RAGEL) -G2 -o mailbox.cpp mailbox.rl
131
132 atoi: atoi.o
133         g++ -g -o atoi atoi.o 
134
135 atoi.cpp: atoi.rl
136         $(RAGEL) -G2 -o atoi.cpp atoi.rl
137
138 atoi.o: atoi.cpp
139         g++ -Wall -g -c -O3 -o $@ $<