wisp
 
(Arne Babenhauserheide)
2015-09-24: try to separate bootstrapping wisp.scm and preparing the reader.

try to separate bootstrapping wisp.scm and preparing the reader.

diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
-wisp = wisp.scm wisp-scheme.scm language/wisp/spec.scm
+wisp = wisp-scheme.scm language/wisp/spec.scm
 wisp_SOURCES = wisp-guile.w wisp-reader.w wisp-scheme.w
-EXTRA_DIST = $(wisp_SOURCES) $(wisp_DATA) bootstrap.sh wisp.py examples tests wisp-repl-guile.sh testrunner.w wisp.scm
+EXTRA_DIST = $(wisp_SOURCES) $(wisp_DATA) bootstrap.sh bootstrap-reader.sh examples tests wisp-repl-guile.sh testrunner.w wisp.py wisp.scm
 CLEANFILES = ${wisp} ChangeLog
 DISTCLEANFILES = ${CLEANFILES} @abs_top_builddir@/1 @abs_top_builddir@/2 @abs_top_builddir@/syntaxtests.sh @abs_top_builddir@/syntaxtestsreader.sh
 # don't spout out lots of stuff at each distcheck. Disable for debugging.
@@ -16,7 +16,10 @@ ChangeLog :
 ${wisp} : input.in.intermediate
 
 .INTERMEDIATE: input.in.intermediate
-input.in.intermediate: ${wisp_SOURCES}
+input.in.intermediate: ${wisp_SOURCES} wisp.scm
+	@abs_top_srcdir@/bootstrap-reader.sh @abs_top_srcdir@ @guile@ wisp.scm 2>&1 | sed "s/^;;;.*//" 2>&1 | grep . 1>&2 ; test ! $$? -eq 0 # it worked if grep does not find anything
+
+wisp.scm: wisp-guile.w wisp.py
 	@abs_top_srcdir@/bootstrap.sh @abs_top_srcdir@ @guile@ @python3@ 2>&1 | sed "s/^;;;.*//" 2>&1 | grep . 1>&2 ; test ! $$? -eq 0 # it worked if grep does not find anything
 
 .PHONY: syntaxtests.sh
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+wisp 0.9.0 (2015-09-24):
+- actually distribute wisp.scm
+
 wisp 0.8.7 (2015-09-24):
 - new example say.w, companion to 
 - bootstrap now explicitly requires bash
diff --git a/bootstrap.sh b/bootstrap-reader.sh
copy from bootstrap.sh
copy to bootstrap-reader.sh
--- a/bootstrap.sh
+++ b/bootstrap-reader.sh
@@ -1,45 +1,37 @@
 #!/bin/bash
 
-# Bootstrap wisp-guile with wisp.py
 if [[ x"$1" == x"" ]]; then 
     srcdir=.
 else
     srcdir="$1"
 fi
 
-# Bootstrap wisp-guile with wisp.py
 if [[ x"$2" == x"" ]]; then 
     guile='guile'
 else
     guile="$2"
 fi
 
-# Bootstrap wisp-guile with wisp.py
 if [[ x"$3" == x"" ]]; then 
-    python3="python3"
+    wisp=wisp.scm
 else
-    python3="$3"
+    wisp="$3"
 fi
 
-diff=$(${python3} ${srcdir}/wisp.py ${srcdir}/wisp-guile.w > 1 && ${guile} 1 ${srcdir}/wisp-guile.w > 2 && ${guile} 2 ${srcdir}/wisp-guile.w > wisp.scm && diff 2 wisp.scm && echo success)
-if [[ ! x"${diff}" == x"success" ]]; then
-    echo "failed to bootstrap wisp.scm. diff: " ${diff}
-    exit 1
-fi
-# put all output into stderr via 1>&2 and prefix it with ;;; to make it possible to kill it alongside the auto-compile output from guile with one sed.
-echo ";;;" "successfully bootstrapped wisp.scm" 1>&2
+
+
 mkdir -p language/wisp
 
 echo ";;;" preparing the reader: wisp at the REPL 1>&2
 
 echo ";;;" parsing wisp-scheme.w with the parser for the REPL 1>&2
-${guile} wisp.scm ${srcdir}/wisp-scheme.w 2>/dev/null > wisp-scheme.scm \
+${guile} ${wisp} ${srcdir}/wisp-scheme.w 2>/dev/null > wisp-scheme.scm \
     && echo ";;;" ...precompiling the parser... 1>&2 \
     && ${guile} -s wisp-scheme.scm 2>/dev/null \
     && echo ";;;" ...succeeded 1>&2 \
 
 echo ";;;"  parsing the spec file... 1>&2
-${guile} wisp.scm ${srcdir}/wisp-reader.w 2>/dev/null > language/wisp/spec.scm \
+${guile} ${wisp} ${srcdir}/wisp-reader.w 2>/dev/null > language/wisp/spec.scm \
     && echo ";;;" ...precompiling the spec file... 1>&2 \
     && ${guile} -L . -s language/wisp/spec.scm \
     && echo ";;;" ...succeeded 1>&2 \
diff --git a/bootstrap.sh b/bootstrap.sh
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -28,19 +28,3 @@ if [[ ! x"${diff}" == x"success" ]]; the
 fi
 # put all output into stderr via 1>&2 and prefix it with ;;; to make it possible to kill it alongside the auto-compile output from guile with one sed.
 echo ";;;" "successfully bootstrapped wisp.scm" 1>&2
-mkdir -p language/wisp
-
-echo ";;;" preparing the reader: wisp at the REPL 1>&2
-
-echo ";;;" parsing wisp-scheme.w with the parser for the REPL 1>&2
-${guile} wisp.scm ${srcdir}/wisp-scheme.w 2>/dev/null > wisp-scheme.scm \
-    && echo ";;;" ...precompiling the parser... 1>&2 \
-    && ${guile} -s wisp-scheme.scm 2>/dev/null \
-    && echo ";;;" ...succeeded 1>&2 \
-
-echo ";;;"  parsing the spec file... 1>&2
-${guile} wisp.scm ${srcdir}/wisp-reader.w 2>/dev/null > language/wisp/spec.scm \
-    && echo ";;;" ...precompiling the spec file... 1>&2 \
-    && ${guile} -L . -s language/wisp/spec.scm \
-    && echo ";;;" ...succeeded 1>&2 \
-    && echo ";;;" to use wisp at the REPL, run '`'${guile} -L . --language=wisp'`' 1>&2