settings for build_parsers and build_manual. This allows the user of a dist to
enable only one.
Added missing files to doc/Makefile.am and examples/Makefile.am.
Added checks for pdflatex and fig2dev is build_manual is on.
git-svn-id: http://svn.complang.org/ragel/trunk@939
052ea7fc-9027-0410-9066-
f65837a77df0
-SUBDIRS = ragel aapl
-DIST_SUBDIRS = $(SUBDIRS) contrib examples test doc
+SUBDIRS = ragel doc
+DIST_SUBDIRS = $(SUBDIRS) aapl contrib examples test
dist_doc_DATA = CREDITS ChangeLog
EXTRA_DIST = ragel.vim
dist_doc_DATA = CREDITS ChangeLog
EXTRA_DIST = ragel.vim
# This file is checked for by the configure script and its existence causes the
# parsers and the manual to not be built when the distribution is built.
dist-hook:
# This file is checked for by the configure script and its existence causes the
# parsers and the manual to not be built when the distribution is built.
dist-hook:
- echo "This is a distribution of Ragel $(VERSION)." > $(distdir)/DIST
+ ( \
+ echo "#!/bin/sh"; \
+ echo ""; \
+ echo "# Change to yes to enable building of parsers or manual. Reconfigure"; \
+ echo "# afterwards."; \
+ echo "build_parsers=no;"; \
+ echo "build_manual=no;"; \
+ ) > $(distdir)/DIST
dnl Choose defaults for the build_parsers and build_manual vars. If the dist
dnl file is present in the root then default to no, otherwise go for it.
AC_CHECK_FILES( $srcdir/DIST,
dnl Choose defaults for the build_parsers and build_manual vars. If the dist
dnl file is present in the root then default to no, otherwise go for it.
AC_CHECK_FILES( $srcdir/DIST,
- [ build_parsers=no; build_manual=no; ],
[ build_parsers=yes; build_manual=yes; ] )
dnl Set to true if the build system should generate parsers from ragel and kelbt
[ build_parsers=yes; build_manual=yes; ] )
dnl Set to true if the build system should generate parsers from ragel and kelbt
dnl Check for definition of MAKE.
AC_PROG_MAKE_SET
dnl Check for definition of MAKE.
AC_PROG_MAKE_SET
+# Checks to carry out if we are building parsers.
if test "x$build_parsers" = "xyes"; then
if test "x$build_parsers" = "xyes"; then
AC_CHECK_PROG(RAGEL, ragel, ragel)
if test -z "$RAGEL"; then
echo
AC_CHECK_PROG(RAGEL, ragel, ragel)
if test -z "$RAGEL"; then
echo
AC_CHECK_PROG(KELBT, kelbt, kelbt)
if test -z "$KELBT"; then
echo
AC_CHECK_PROG(KELBT, kelbt, kelbt)
if test -z "$KELBT"; then
echo
+fi
+
+# Checks to carry out if we are building the manual.
+if test "x$build_manual" = "xyes"; then
+
+AC_CHECK_PROG(FIG2DEV, fig2dev, fig2dev)
+if test -z "$FIG2DEV"; then
+ echo
+ echo "error: fig2dev is required to build the manual"
+ echo
+ exit 1
+fi
+
+AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex)
+if test -z "$PDFLATEX"; then
+ echo
+ echo "error: pdflatex is required to build the manual"
+ echo
+ exit 1
+fi
+
+fi
dnl Check for the D compiler
AC_CHECK_PROG(GDC, gdc, gdc)
dnl Check for the D compiler
AC_CHECK_PROG(GDC, gdc, gdc)
dist_doc_DATA = ragel-guide.pdf
dist_doc_DATA = ragel-guide.pdf
+EXTRA_DIST = ragel-guide.tex \
+ bmconcat.fig bmregex.fig dropdown.fig exdoneact.fig \
+ exoutact1.fig exstrongsubtr.fig lines2.fig smallscanner.fig bmnull.fig \
+ comments1.fig entryguard.fig exinter.fig exoutact2.fig exsubtr.fig \
+ lmkleene.fig stembed.fig bmnum.fig comments2.fig exaction.fig \
+ exnegate.fig explus.fig finguard.fig opconcat.fig bmor.fig conds1.fig \
+ exallact.fig exoption.fig exstact.fig leftguard.fig opor.fig \
+ bmrange.fig conds2.fig exconcat.fig exor.fig exstar.fig lines1.fig \
+ opstar.fig
+
if BUILD_MANUAL
.fig.pdf:
if BUILD_MANUAL
.fig.pdf:
-# Copyright 2002-2007 Adrian Thurston <thurston@complang.org>
+# Copyright 2002-2009 Adrian Thurston <thurston@complang.org>
#
# This file is part of Ragel.
#
# This file is part of Ragel.
atoi awkemu clang concurrent cppscan format gotocallret mailbox params \
pullscan rlscan statechart
atoi awkemu clang concurrent cppscan format gotocallret mailbox params \
pullscan rlscan statechart
-#########################################
-
-all: $(TARGS)
-
-#%.o: %.c
-# gcc $(CFLAGS) -Wall -g -c -O3 -o $@ $<
-
-#%.o: %.cpp
-# g++ $(CXXFLAGS) -Wall -g -c -O3 -o $@ $<
-
-#########################################
-
-gotocallret: gotocallret.o
- g++ -g -o gotocallret gotocallret.o
+EXTRA_DIST = \
+ gotocallret.rl pullscan.rl concurrent.rl rlscan.rl statechart.rl \
+ params.rl clang.rl cppscan.rl format.rl awkemu.rl mailbox.rl atoi.rl
+
+gotocallret_SOURCES = gotocallret.cpp
+pullscan_SOURCES = pullscan.c
+concurrent_SOURCES = concurrent.cpp
+rlscan_SOURCES = rlscan.cpp
+statechart_SOURCES = statechart.cpp
+params_SOURCES = params.c
+clang_SOURCES = clang.c
+cppscan_SOURCES = cppscan.cpp
+format_SOURCES = format.c
+awkemu_SOURCES = awkemu.c
+mailbox_SOURCES = mailbox.cpp
+atoi_SOURCES = atoi.cpp
gotocallret.cpp: gotocallret.rl
$(RAGEL) -G2 -o gotocallret.cpp gotocallret.rl
gotocallret.cpp: gotocallret.rl
$(RAGEL) -G2 -o gotocallret.cpp gotocallret.rl
-gotocallret.o: gotocallret.cpp
- g++ -Wall -g -c -O3 -o $@ $<
-
-
-pullscan: pullscan.o
- gcc -g -o $@ $<
-
pullscan.c: pullscan.rl $(RAGEL)
$(RAGEL) -G2 -o $@ pullscan.rl
pullscan.c: pullscan.rl $(RAGEL)
$(RAGEL) -G2 -o $@ pullscan.rl
-concurrent: concurrent.o
- g++ -g -o concurrent concurrent.o
-
concurrent.cpp: concurrent.rl $(RAGEL)
$(RAGEL) -G2 -o concurrent.cpp concurrent.rl
concurrent.cpp: concurrent.rl $(RAGEL)
$(RAGEL) -G2 -o concurrent.cpp concurrent.rl
-rlscan: rlscan.o
- g++ -g -o rlscan rlscan.o
-
rlscan.cpp: rlscan.rl
$(RAGEL) -G2 -o rlscan.cpp rlscan.rl
rlscan.cpp: rlscan.rl
$(RAGEL) -G2 -o rlscan.cpp rlscan.rl
-statechart: statechart.o
- g++ -g -o statechart statechart.o
-
statechart.cpp: statechart.rl
$(RAGEL) -G2 -o statechart.cpp statechart.rl
statechart.cpp: statechart.rl
$(RAGEL) -G2 -o statechart.cpp statechart.rl
-statechart.o: statechart.cpp
- g++ -Wall -g -c -O3 -o $@ $<
-
-params: params.o
- gcc -g -o params params.o
-
params.c: params.rl
$(RAGEL) -G2 -o params.c params.rl
params.c: params.rl
$(RAGEL) -G2 -o params.c params.rl
-clang: clang.o
- gcc -g -o clang clang.o
-
clang.c: clang.rl
$(RAGEL) -G2 -o clang.c clang.rl
clang.c: clang.rl
$(RAGEL) -G2 -o clang.c clang.rl
-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) -G2 -o $@ cppscan.rl
cppscan.cpp: cppscan.rl
$(RAGEL) -G2 -o $@ cppscan.rl
-lex-cppscan.cpp: cppscan.lex
- $(FLEX) -f -o $@ $<
-
-re2c-cppscan.cpp: cppscan.rec
- $(RE2C) -s $< > $@
-
-example.cpp: example.rec
- $(RE2C) -s $< > $@
-
-format: format.o
- gcc -g -o format format.o
-
format.c: format.rl
$(RAGEL) -G2 -o format.c format.rl
format.c: format.rl
$(RAGEL) -G2 -o format.c format.rl
-awkemu: awkemu.o
- gcc -g -o awkemu awkemu.o
-
awkemu.c: awkemu.rl
$(RAGEL) -G2 -o awkemu.c awkemu.rl
awkemu.c: awkemu.rl
$(RAGEL) -G2 -o awkemu.c awkemu.rl
-
-mailbox: mailbox.o
- g++ -g -o mailbox mailbox.o
-
mailbox.cpp: mailbox.rl
$(RAGEL) -G2 -o mailbox.cpp mailbox.rl
mailbox.cpp: mailbox.rl
$(RAGEL) -G2 -o mailbox.cpp mailbox.rl
-atoi: atoi.o
- g++ -g -o atoi atoi.o
-
atoi.cpp: atoi.rl
$(RAGEL) -G2 -o atoi.cpp atoi.rl
atoi.cpp: atoi.rl
$(RAGEL) -G2 -o atoi.cpp atoi.rl
-atoi.o: atoi.cpp
- g++ -Wall -g -c -O3 -o $@ $<
+###
+
+lex-cppscan.cpp: cppscan.lex
+ $(FLEX) -f -o $@ $<
+
+re2c-cppscan.cpp: cppscan.rec
+ $(RE2C) -s $< > $@
+
+example.cpp: example.rec
+ $(RE2C) -s $< > $@