Some more movement of code and data within the layer between frontend and
[external/ragel.git] / examples / Makefile
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 distclean clean:
34         rm -Rf *.o *.c *.cpp $(TARGS)
35
36 %.o: %.c
37         gcc $(CFLAGS) -Wall -g -c -O3 -o $@ $<
38
39 %.o: %.cpp
40         g++ $(CXXFLAGS) -Wall -g -c -O3 -o $@ $<
41
42 #########################################
43
44 gotocallret: gotocallret.o
45         g++ -g -o gotocallret gotocallret.o 
46
47 gotocallret.cpp: gotocallret.rl
48         $(RAGEL) -G2 -o gotocallret.cpp gotocallret.rl 
49
50 gotocallret.o: gotocallret.cpp
51         g++ -Wall -g -c -O3 -o $@ $<
52
53
54 pullscan: pullscan.o
55         gcc -g -o $@ $<
56
57 pullscan.c: pullscan.rl $(RAGEL) 
58         $(RAGEL) -G2 -o $@ pullscan.rl
59
60 concurrent: concurrent.o
61         g++ -g -o concurrent concurrent.o 
62
63 concurrent.cpp: concurrent.rl $(RAGEL)
64         $(RAGEL) -G2 -o concurrent.cpp concurrent.rl
65
66 rlscan: rlscan.o
67         g++ -g -o rlscan rlscan.o 
68
69 rlscan.cpp: rlscan.rl 
70         $(RAGEL) -G2 -o rlscan.cpp rlscan.rl
71
72 statechart: statechart.o
73         g++ -g -o statechart statechart.o 
74
75 statechart.cpp: statechart.rl 
76         $(RAGEL) -G2 -o statechart.cpp statechart.rl
77
78 statechart.o: statechart.cpp
79         g++ -Wall -g -c -O3 -o $@ $<
80
81 params: params.o 
82         gcc -g -o params params.o
83
84 params.c: params.rl
85         $(RAGEL) -G2 -o params.c params.rl
86
87 clang: clang.o 
88         gcc -g -o clang clang.o
89
90 clang.c: clang.rl 
91         $(RAGEL) -G2 -o clang.c clang.rl
92
93 optional: lex-cppscan re2c-cppscan
94
95 cppscan: cppscan.o
96         g++ -g -o $@ $<
97
98 lex-cppscan: lex-cppscan.o
99         g++ -g -o $@ $<
100         
101 re2c-cppscan: re2c-cppscan.o
102         g++ -g -o $@ $<
103         
104 cppscan.cpp: cppscan.rl 
105         $(RAGEL) -G2 -o $@ cppscan.rl
106
107 lex-cppscan.cpp: cppscan.lex
108         $(FLEX) -f -o $@ $<
109
110 re2c-cppscan.cpp: cppscan.rec
111         $(RE2C) -s $< > $@
112
113 example.cpp: example.rec
114         $(RE2C) -s $< > $@
115
116 format: format.o 
117         gcc -g -o format format.o
118
119 format.c: format.rl
120         $(RAGEL) -G2 -o format.c format.rl
121
122 awkemu: awkemu.o
123         gcc -g -o awkemu awkemu.o
124
125 awkemu.c: awkemu.rl
126         $(RAGEL) -G2 -o awkemu.c awkemu.rl
127
128
129 mailbox: mailbox.o
130         g++ -g -o mailbox mailbox.o 
131
132 mailbox.cpp: mailbox.rl
133         $(RAGEL) -G2 -o mailbox.cpp mailbox.rl
134
135 atoi: atoi.o
136         g++ -g -o atoi atoi.o 
137
138 atoi.cpp: atoi.rl
139         $(RAGEL) -G2 -o atoi.cpp atoi.rl
140
141 atoi.o: atoi.cpp
142         g++ -Wall -g -c -O3 -o $@ $<