Eliminated per-example private directories.
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Fri, 2 Feb 2007 18:51:01 +0000 (18:51 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Fri, 2 Feb 2007 18:51:01 +0000 (18:51 +0000)
git-svn-id: http://svn.complang.org/ragel/trunk@59 052ea7fc-9027-0410-9066-f65837a77df0

28 files changed:
examples/Makefile
examples/atoi.rl [moved from examples/atoi/atoi.rl with 100% similarity]
examples/atoi/Makefile [deleted file]
examples/awkemu.rl [moved from examples/awkemu/awkemu.rl with 100% similarity]
examples/awkemu/Makefile [deleted file]
examples/awkequiv.awk [moved from examples/awkemu/awkequiv.awk with 100% similarity]
examples/clang.rl [moved from examples/clang/clang.rl with 100% similarity]
examples/clang/Makefile [deleted file]
examples/concurrent.rl [moved from examples/concurrent/concurrent.rl with 100% similarity]
examples/concurrent/Makefile [deleted file]
examples/cppscan.lex [moved from examples/cppscan/cppscan.lex with 100% similarity]
examples/cppscan.rec [moved from examples/cppscan/cppscan.rec with 100% similarity]
examples/cppscan.rl [moved from examples/cppscan/cppscan.rl with 100% similarity]
examples/format.rl [moved from examples/format/format.rl with 100% similarity]
examples/format/Makefile [deleted file]
examples/gotocallret.rl [moved from examples/gotocallret/gotocallret.rl with 100% similarity]
examples/gotocallret/Makefile [deleted file]
examples/mailbox.rl [moved from examples/mailbox/mailbox.rl with 100% similarity]
examples/mailbox/Makefile [deleted file]
examples/params.rl [moved from examples/params/params.rl with 100% similarity]
examples/params/Makefile [deleted file]
examples/pullscan.rl [moved from examples/pullscan/pullscan.rl with 100% similarity]
examples/pullscan/Makefile [deleted file]
examples/rlscan.rl [moved from examples/rlscan/rlscan.rl with 100% similarity]
examples/rlscan/Makefile [deleted file]
examples/statechart.rl [moved from examples/statechart/statechart.rl with 100% similarity]
examples/statechart/Makefile [deleted file]
examples/uri.rl [moved from examples/uri/uri.rl with 100% similarity]

index e1e7808..0d825a8 100644 (file)
@@ -1,5 +1,5 @@
 #
-#   Copyright 2002-2003 Adrian Thurston <thurston@cs.queensu.ca>
+#   Copyright 2002-2007 Adrian Thurston <thurston@cs.queensu.ca>
 #
 
 #   This file is part of Ragel.
 #   along with Ragel; if not, write to the Free Software
 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
 
+RAGEL = ../../ragel/ragel
+RLCODEGEN = ../../rlcodegen/rlcodegen
+FLEX = flex
+RE2C = re2c
+CFLAGS = -Wall -g -O3
 
-SUBDIRS = \
-       atoi awkemu clang concurrent format gotocallret mailbox params rlscan \
-       statechart cppscan
 
-all:
-       @for dir in $(SUBDIRS); do cd $$dir; $(MAKE) || exit 1; cd ..; done
+TARGS = \
+       atoi awkemu clang concurrent cppscan format gotocallret mailbox params \
+       pullscan rlscan statechart 
 
-ps:
-       @for dir in $(SUBDIRS); do cd $$dir; $(MAKE) ps || exit 1; cd ..; done
+all: $(TARS)
 
-clean:
-       @for dir in $(SUBDIRS); do cd $$dir; $(MAKE) clean || exit 1; cd ..; done
+gotocallret: gotocallret.o
+       g++ -g -o gotocallret gotocallret.o 
 
-distclean:
-       @for dir in $(SUBDIRS); do cd $$dir; $(MAKE) distclean || exit 1; cd ..; done
+gotocallret.cpp: gotocallret.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) gotocallret.rl | $(RLCODEGEN) -G2 -o gotocallret.cpp
 
+gotocallret.o: gotocallret.cpp
+       g++ -Wall -g -c -O3 -o $@ $<
+
+
+pullscan: pullscan.o
+       g++ -g -o $@ $<
+
+pullscan.c: pullscan.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) pullscan.rl | $(RLCODEGEN) -G2 -o $@
+
+%.o: %.c
+       gcc $(CFLAGS) -c -o $@ $<
+
+pullscan.ps: pullscan.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) pullscan.rl | $(RLCODEGEN) -V | dot -Tps > pullscan.ps
+
+distclean clean:
+       rm -Rf *.o pullscan.c pullscan pullscan.ps
+
+
+concurrent: concurrent.o
+       g++ -g -o concurrent concurrent.o 
+
+concurrent.cpp: concurrent.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) concurrent.rl | $(RLCODEGEN) -G2 -o concurrent.cpp
+
+concurrent.ps: concurrent.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) concurrent.rl | $(RLCODEGEN) -V | dot -Tps > concurrent.ps
+
+%.o: %.cpp
+       g++ -Wall -g -c -O3 -o $@ $<
+
+rlscan: rlscan.o
+       g++ -g -o rlscan rlscan.o 
+
+rlscan.cpp: rlscan.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) rlscan.rl | $(RLCODEGEN) -G2 -o rlscan.cpp
+
+%.o: %.cpp
+       g++ -Wall -g -c -O3 -o $@ $<
+
+rlscan.ps: rlscan.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) rlscan.rl | $(RLCODEGEN) -V | dot -Tps > rlscan.ps
+
+statechart: statechart.o
+       g++ -g -o statechart statechart.o 
+
+statechart.cpp: statechart.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) statechart.rl | $(RLCODEGEN) -G2 -o statechart.cpp
+
+statechart.o: statechart.cpp
+       g++ -Wall -g -c -O3 -o $@ $<
+
+statechart.ps: statechart.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) statechart.rl | $(RLCODEGEN) -V | dot -Tps > statechart.ps
+
+params: params.o 
+       gcc -g -o params params.o
+
+params.c: params.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) params.rl | $(RLCODEGEN) -G2 -o params.c
+
+params.ps: params.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) params.rl | $(RLCODEGEN) -V | dot -Tps > params.ps
+
+%.o: %.c
+       gcc -Wall -O3 -g -c -o $@ $<
+
+clang: clang.o 
+       gcc -g -o clang clang.o
+
+clang.c: clang.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) clang.rl | $(RLCODEGEN) -G2 -o clang.c
+
+clang.ps: clang.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) clang.rl | $(RLCODEGEN) -V | dot -Tps > clang.ps
+
+%.o: %.c
+       gcc -pedantic -Wall -O3 -g -c -o $@ $<
+
+optional: lex-cppscan re2c-cppscan
+
+cppscan: cppscan.o
+       g++ -g -o $@ $<
+
+lex-cppscan: lex-cppscan.o
+       g++ -g -o $@ $<
+       
+re2c-cppscan: re2c-cppscan.o
+       g++ -g -o $@ $<
+       
+cppscan.cpp: cppscan.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) cppscan.rl | $(RLCODEGEN) -G2 -o $@
+
+lex-cppscan.cpp: cppscan.lex
+       $(FLEX) -f -o $@ $<
+
+re2c-cppscan.cpp: cppscan.rec
+       $(RE2C) -s $< > $@
+
+example.cpp: example.rec
+       $(RE2C) -s $< > $@
+
+%.o: %.cpp
+       g++ $(CFLAGS) -c -o $@ $<
+
+cppscan.ps: cppscan.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) cppscan.rl | $(RLCODEGEN) -V | dot -Tps > cppscan.ps
+
+
+format: format.o 
+       gcc -g -o format format.o
+
+format.c: format.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) format.rl | $(RLCODEGEN) -G2 -o format.c
+
+format.ps: format.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) format.rl | $(RLCODEGEN) -V | dot -Tps > format.ps
+
+%.o: %.c
+       gcc -Wall -O3 -g -c -o $@ $<
+
+awkemu: awkemu.o
+       gcc -g -o awkemu awkemu.o
+
+awkemu.c: awkemu.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) awkemu.rl | $(RLCODEGEN) -G2 -o awkemu.c
+
+%.o: %.c
+       gcc -pedantic -Wall -g -c -O3 -o $@ $<
+
+
+mailbox: mailbox.o
+       g++ -g -o mailbox mailbox.o 
+
+mailbox.cpp: mailbox.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) mailbox.rl | $(RLCODEGEN) -G2 -o mailbox.cpp
+
+%.o: %.cpp
+       g++ -Wall -g -c -O3 -o $@ $<
+
+atoi: atoi.o
+       g++ -g -o atoi atoi.o 
+
+atoi.cpp: atoi.rl $(RAGEL) $(RLCODEGEN)
+       $(RAGEL) atoi.rl | $(RLCODEGEN) -G2 -o atoi.cpp
+
+atoi.o: atoi.cpp
+       g++ -Wall -g -c -O3 -o $@ $<
similarity index 100%
rename from examples/atoi/atoi.rl
rename to examples/atoi.rl
diff --git a/examples/atoi/Makefile b/examples/atoi/Makefile
deleted file mode 100644 (file)
index 901de19..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-RAGEL = ../../ragel/ragel
-RLCODEGEN = ../../rlcodegen/rlcodegen
-
-all: atoi
-
-ps: atoi.ps
-
-atoi: atoi.o
-       g++ -g -o atoi atoi.o 
-
-atoi.cpp: atoi.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) atoi.rl | $(RLCODEGEN) -G2 -o atoi.cpp
-
-atoi.o: atoi.cpp
-       g++ -Wall -g -c -O3 -o $@ $<
-
-atoi.ps: atoi.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) atoi.rl | $(RLCODEGEN) -V | dot -Tps > atoi.ps
-
-distclean clean:
-       rm -Rf *.o atoi.cpp atoi atoi.ps
similarity index 100%
rename from examples/awkemu/awkemu.rl
rename to examples/awkemu.rl
diff --git a/examples/awkemu/Makefile b/examples/awkemu/Makefile
deleted file mode 100644 (file)
index 5e6ecde..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-RAGEL = ../../ragel/ragel
-RLCODEGEN = ../../rlcodegen/rlcodegen
-
-all: awkemu
-
-ps: awkemu.ps
-
-awkemu: awkemu.o
-       gcc -g -o awkemu awkemu.o
-
-awkemu.c: awkemu.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) awkemu.rl | $(RLCODEGEN) -G2 -o awkemu.c
-
-awkemu.ps: awkemu.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) awkemu.rl | $(RLCODEGEN) -V | dot -Tps > awkemu.ps
-
-%.o: %.c
-       gcc -pedantic -Wall -g -c -O3 -o $@ $<
-
-distclean clean:
-       rm -Rf *.o awkemu.c awkemu awkemu.ps
similarity index 100%
rename from examples/clang/clang.rl
rename to examples/clang.rl
diff --git a/examples/clang/Makefile b/examples/clang/Makefile
deleted file mode 100644 (file)
index d305406..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-RAGEL = ../../ragel/ragel
-RLCODEGEN = ../../rlcodegen/rlcodegen
-
-all: clang
-
-ps: clang.ps
-
-clang: clang.o 
-       gcc -g -o clang clang.o
-
-clang.c: clang.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) clang.rl | $(RLCODEGEN) -G2 -o clang.c
-
-clang.ps: clang.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) clang.rl | $(RLCODEGEN) -V | dot -Tps > clang.ps
-
-%.o: %.c
-       gcc -pedantic -Wall -O3 -g -c -o $@ $<
-
-distclean clean:
-       rm -Rf *.o clang.c clang clang.ps
diff --git a/examples/concurrent/Makefile b/examples/concurrent/Makefile
deleted file mode 100644 (file)
index b9a09f6..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-RAGEL = ../../ragel/ragel
-RLCODEGEN = ../../rlcodegen/rlcodegen
-
-all: concurrent
-
-ps: concurrent.ps
-
-concurrent: concurrent.o
-       g++ -g -o concurrent concurrent.o 
-
-concurrent.cpp: concurrent.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) concurrent.rl | $(RLCODEGEN) -G2 -o concurrent.cpp
-
-concurrent.ps: concurrent.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) concurrent.rl | $(RLCODEGEN) -V | dot -Tps > concurrent.ps
-
-%.o: %.cpp
-       g++ -Wall -g -c -O3 -o $@ $<
-
-distclean clean:
-       rm -Rf *.o concurrent.cpp concurrent concurrent.ps
similarity index 100%
rename from examples/format/format.rl
rename to examples/format.rl
diff --git a/examples/format/Makefile b/examples/format/Makefile
deleted file mode 100644 (file)
index d5ac829..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-RAGEL = ../../ragel/ragel
-RLCODEGEN = ../../rlcodegen/rlcodegen
-
-all: format
-
-ps: format.ps
-
-format: format.o 
-       gcc -g -o format format.o
-
-format.c: format.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) format.rl | $(RLCODEGEN) -G2 -o format.c
-
-format.ps: format.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) format.rl | $(RLCODEGEN) -V | dot -Tps > format.ps
-
-%.o: %.c
-       gcc -Wall -O3 -g -c -o $@ $<
-
-distclean clean:
-       rm -Rf *.o format.c format format.ps
diff --git a/examples/gotocallret/Makefile b/examples/gotocallret/Makefile
deleted file mode 100644 (file)
index 13f9818..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-RAGEL = ../../ragel/ragel
-RLCODEGEN = ../../rlcodegen/rlcodegen
-
-all: gotocallret
-
-ps: gotocallret.ps
-
-gotocallret: gotocallret.o
-       g++ -g -o gotocallret gotocallret.o 
-
-gotocallret.cpp: gotocallret.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) gotocallret.rl | $(RLCODEGEN) -G2 -o gotocallret.cpp
-
-gotocallret.o: gotocallret.cpp
-       g++ -Wall -g -c -O3 -o $@ $<
-
-gotocallret.ps: gotocallret.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) gotocallret.rl | $(RLCODEGEN) -V | dot -Tps > gotocallret.ps
-
-distclean clean:
-       rm -Rf *.o gotocallret.cpp gotocallret gotocallret.ps
diff --git a/examples/mailbox/Makefile b/examples/mailbox/Makefile
deleted file mode 100644 (file)
index 94d6680..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-RAGEL = ../../ragel/ragel
-RLCODEGEN = ../../rlcodegen/rlcodegen
-
-all: mailbox
-
-mailbox: mailbox.o
-       g++ -g -o mailbox mailbox.o 
-
-mailbox.cpp: mailbox.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) mailbox.rl | $(RLCODEGEN) -G2 -o mailbox.cpp
-
-%.o: %.cpp
-       g++ -Wall -g -c -O3 -o $@ $<
-
-distclean clean:
-       rm -Rf *.o mailbox.cpp mailbox mailbox.ps
similarity index 100%
rename from examples/params/params.rl
rename to examples/params.rl
diff --git a/examples/params/Makefile b/examples/params/Makefile
deleted file mode 100644 (file)
index 98b950c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-RAGEL = ../../ragel/ragel
-RLCODEGEN = ../../rlcodegen/rlcodegen
-
-all: params
-
-ps: params.ps
-
-params: params.o 
-       gcc -g -o params params.o
-
-params.c: params.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) params.rl | $(RLCODEGEN) -G2 -o params.c
-
-params.ps: params.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) params.rl | $(RLCODEGEN) -V | dot -Tps > params.ps
-
-%.o: %.c
-       gcc -Wall -O3 -g -c -o $@ $<
-
-distclean clean:
-       rm -Rf *.o params.c params params.ps
diff --git a/examples/pullscan/Makefile b/examples/pullscan/Makefile
deleted file mode 100644 (file)
index 1a048ea..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-RAGEL = ../../ragel/ragel
-RLCODEGEN = ../../rlcodegen/rlcodegen
-
-CFLAGS = -Wall -g -O3
-
-all: pullscan
-
-ps: pullscan.ps
-
-pullscan: pullscan.o
-       g++ -g -o $@ $<
-
-pullscan.c: pullscan.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) pullscan.rl | $(RLCODEGEN) -G2 -o $@
-
-%.o: %.c
-       gcc $(CFLAGS) -c -o $@ $<
-
-pullscan.ps: pullscan.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) pullscan.rl | $(RLCODEGEN) -V | dot -Tps > pullscan.ps
-
-distclean clean:
-       rm -Rf *.o pullscan.c pullscan pullscan.ps
similarity index 100%
rename from examples/rlscan/rlscan.rl
rename to examples/rlscan.rl
diff --git a/examples/rlscan/Makefile b/examples/rlscan/Makefile
deleted file mode 100644 (file)
index 2021d27..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-RAGEL = ../../ragel/ragel
-RLCODEGEN = ../../rlcodegen/rlcodegen
-
-all: rlscan
-
-ps: rlscan.ps
-
-rlscan: rlscan.o
-       g++ -g -o rlscan rlscan.o 
-
-rlscan.cpp: rlscan.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) rlscan.rl | $(RLCODEGEN) -G2 -o rlscan.cpp
-
-%.o: %.cpp
-       g++ -Wall -g -c -O3 -o $@ $<
-
-rlscan.ps: rlscan.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) rlscan.rl | $(RLCODEGEN) -V | dot -Tps > rlscan.ps
-
-distclean clean:
-       rm -Rf *.o rlscan.cpp rlscan rlscan.ps
diff --git a/examples/statechart/Makefile b/examples/statechart/Makefile
deleted file mode 100644 (file)
index 3dec7fd..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-RAGEL = ../../ragel/ragel
-RLCODEGEN = ../../rlcodegen/rlcodegen
-
-all: statechart
-
-ps: statechart.ps
-
-statechart: statechart.o
-       g++ -g -o statechart statechart.o 
-
-statechart.cpp: statechart.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) statechart.rl | $(RLCODEGEN) -G2 -o statechart.cpp
-
-statechart.o: statechart.cpp
-       g++ -Wall -g -c -O3 -o $@ $<
-
-statechart.ps: statechart.rl $(RAGEL) $(RLCODEGEN)
-       $(RAGEL) statechart.rl | $(RLCODEGEN) -V | dot -Tps > statechart.ps
-
-distclean clean:
-       rm -Rf *.o statechart.cpp statechart statechart.ps
similarity index 100%
rename from examples/uri/uri.rl
rename to examples/uri.rl