From 0ea47a3a09704684d4d8af70a2f9e851300845a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 20 Mar 2009 01:11:16 +0100 Subject: Aggregate `Makefile.am' files under `examples/'. * configure.in: Don't produce `examples/*/Makefile'. * examples/Makefile.am (SUBDIRS): Remove. (EXTRA_DIST, AM_CFLAGS, AM_LIBS): New. (box/box, box/box.o, box-module/box, box-module/box.o, libbox.la, box-dynamic/box.lo, libbox-module.la, box-dynamic-module/box.lo, installcheck, CLEANFILES, clean-local): New targets, aggregated from `Makefile.am' files formerly in sub-directories. * examples/check.test: New file, aggregated from `check.test' files in sub-directories. --- examples/Makefile.am | 77 ++++++++++- examples/box-dynamic-module/Makefile.am | 36 ----- examples/box-dynamic-module/check.test | 48 ------- examples/box-dynamic/Makefile.am | 36 ----- examples/box-dynamic/check.test | 38 ----- examples/box-module/Makefile.am | 36 ----- examples/box-module/check.test | 38 ----- examples/box/Makefile.am | 36 ----- examples/box/check.test | 38 ----- examples/check.test | 238 ++++++++++++++++++++++++++++++++ examples/modules/Makefile.am | 25 ---- examples/modules/check.test | 27 ---- examples/safe/Makefile.am | 25 ---- examples/safe/check.test | 40 ------ examples/scripts/Makefile.am | 25 ---- examples/scripts/check.test | 53 ------- 16 files changed, 311 insertions(+), 505 deletions(-) delete mode 100644 examples/box-dynamic-module/Makefile.am delete mode 100755 examples/box-dynamic-module/check.test delete mode 100644 examples/box-dynamic/Makefile.am delete mode 100755 examples/box-dynamic/check.test delete mode 100644 examples/box-module/Makefile.am delete mode 100755 examples/box-module/check.test delete mode 100644 examples/box/Makefile.am delete mode 100755 examples/box/check.test create mode 100755 examples/check.test delete mode 100644 examples/modules/Makefile.am delete mode 100755 examples/modules/check.test delete mode 100644 examples/safe/Makefile.am delete mode 100755 examples/safe/check.test delete mode 100644 examples/scripts/Makefile.am delete mode 100755 examples/scripts/check.test (limited to 'examples') diff --git a/examples/Makefile.am b/examples/Makefile.am index 84503088f..1b995b521 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with Automake to create Makefile.in ## -## Copyright (C) 2001, 2006, 2008 Free Software Foundation, Inc. +## Copyright (C) 2001, 2006, 2008, 2009 Free Software Foundation, Inc. ## ## This file is part of GUILE. ## @@ -19,7 +19,76 @@ ## to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ## Floor, Boston, MA 02110-1301 USA -SUBDIRS = scripts box box-module box-dynamic box-dynamic-module\ - modules safe +EXTRA_DIST = README ChangeLog-2008 check.test \ + \ + scripts/README scripts/simple-hello.scm scripts/hello \ + scripts/fact \ + \ + box/README box/box.c \ + \ + box-module/README box-module/box.c \ + \ + box-dynamic/README box-dynamic/box.c \ + \ + box-dynamic-module/README box-dynamic-module/box.c \ + box-dynamic-module/box-module.scm box-dynamic-module/box-mixed.scm \ + \ + modules/README modules/module-0.scm modules/module-1.scm \ + modules/module-2.scm modules/main \ + \ + safe/README safe/safe safe/untrusted.scm safe/evil.scm -EXTRA_DIST = README ChangeLog-2008 +AM_CFLAGS = `$(bindir)/guile-config compile` +AM_LIBS = `$(bindir)/guile-config link` + + +box/box: box/box.o + -$(MKDIR_P) box + $(CC) $< $(AM_LIBS) -o $@ + +box/box.o: box/box.c + -$(MKDIR_P) box + $(CC) $(AM_CFLAGS) -c $< -o $@ + + +box-module/box: box-module/box.o + -$(MKDIR_P) box-module + $(CC) $< $(AM_LIBS) -o $@ + +box-module/box.o: box-module/box.c + -$(MKDIR_P) box-module + $(CC) $(AM_CFLAGS) -c $< -o $@ + + +libbox.la: box-dynamic/box.lo + $(top_builddir)/libtool --mode=link $(CC) $< $(AM_LIBS) -rpath $(libdir) -o $@ + +box-dynamic/box.lo: box-dynamic/box.c + -$(MKDIR_P) box-dynamic + $(top_builddir)/libtool --mode=compile $(CC) $(AM_CFLAGS) -c $< -o $@ + + +libbox-module.la: box-dynamic-module/box.lo + $(top_builddir)/libtool --mode=link $(CC) $< $(AM_LIBS) -rpath $(libdir) -o $@ + +box-dynamic-module/box.lo: box-dynamic-module/box.c + -$(MKDIR_P) box-dynamic-module + $(top_builddir)/libtool --mode=compile $(CC) $(AM_CFLAGS) -c $< -o $@ + + +installcheck: box/box box-module/box libbox.la libbox-module.la + LD_LIBRARY_PATH="$(libdir):$$LD_LIBRARY_PATH" \ + LTDL_LIBRARY_PATH="$(builddir):$$LTDL_LIBRARY_PATH" \ + GUILE_LOAD_PATH="$(abs_top_srcdir):$$GUILE_LOAD_PATH" \ + PATH="$(bindir):$$PATH" \ + srcdir="$(srcdir)" \ + $(srcdir)/check.test + +CLEANFILES = \ + box/box box/box.o \ + box-module/box box-module/box.o + +clean-local: + $(top_builddir)/libtool --mode=clean rm -f \ + box-dynamic/box.lo libbox.la \ + box-dynamic-module/box.lo libbox-module.la diff --git a/examples/box-dynamic-module/Makefile.am b/examples/box-dynamic-module/Makefile.am deleted file mode 100644 index bf18f4f66..000000000 --- a/examples/box-dynamic-module/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -## Process this file with Automake to create Makefile.in -## -## Copyright (C) 2001, 2006 Free Software Foundation, Inc. -## -## This file is part of GUILE. -## -## GUILE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as -## published by the Free Software Foundation; either version 2, or -## (at your option) any later version. -## -## GUILE is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public -## License along with GUILE; see the file COPYING. If not, write -## to the Free Software Foundation, Inc., 51 Franklin Street, Fifth -## Floor, Boston, MA 02110-1301 USA - -EXTRA_DIST = README box.c box-module.scm box-mixed.scm check.test - -CFLAGS=`$(bindir)/guile-config compile` -LIBS=`$(bindir)/guile-config link` - -libbox-module: box.lo - sh ../../libtool --mode=link $(CC) $< $(LIBS) -rpath $(libdir) -o libbox-module.la - -box.lo: box.c - sh ../../libtool --mode=compile $(CC) $(CFLAGS) -c $< - -installcheck: libbox-module - LTDL_LIBRARY_PATH=.libs GUILE_LOAD_PATH=$(top_srcdir):$(srcdir) $(srcdir)/check.test - -CLEANFILES=libbox-module.la box.lo box.o diff --git a/examples/box-dynamic-module/check.test b/examples/box-dynamic-module/check.test deleted file mode 100755 index 935176d20..000000000 --- a/examples/box-dynamic-module/check.test +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -# must be run from this directory -guile=${GUILE-../../libguile/guile} - -set -e - -# -# ./box test #1 -# -$guile -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline)))' > TMP -cat < -EOF -rm -f TMP - -# -# ./box test #2 -# -$guile -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP -cat < -# -EOF -rm -f TMP - -# -# ./box test #3 -# -$guile -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP -cat < -# -1 -EOF -rm -f TMP - -# -# ./box test #4 -# -$guile -c '(begin (use-modules (box-mixed)) (let ((b (make-box-list 1 2 3))) (display b) (newline) (display (box-map 1+ b)) (newline)))' > TMP -cat < # #) -(# # #) -EOF -rm -f TMP - -# check.test ends here diff --git a/examples/box-dynamic/Makefile.am b/examples/box-dynamic/Makefile.am deleted file mode 100644 index 6fa20c59c..000000000 --- a/examples/box-dynamic/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -## Process this file with Automake to create Makefile.in -## -## Copyright (C) 2001, 2006 Free Software Foundation, Inc. -## -## This file is part of GUILE. -## -## GUILE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as -## published by the Free Software Foundation; either version 2, or -## (at your option) any later version. -## -## GUILE is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public -## License along with GUILE; see the file COPYING. If not, write -## to the Free Software Foundation, Inc., 51 Franklin Street, Fifth -## Floor, Boston, MA 02110-1301 USA - -EXTRA_DIST = README box.c check.test - -CFLAGS=`$(bindir)/guile-config compile` -LIBS=`$(bindir)/guile-config link` - -libbox: box.lo - sh ../../libtool --mode=link $(CC) $< $(LIBS) -rpath $(libdir) -o libbox.la - -box.lo: box.c - sh ../../libtool --mode=compile $(CC) $(CFLAGS) -c $< - -installcheck: libbox - LTDL_LIBRARY_PATH=.libs GUILE_LOAD_PATH=$(top_srcdir):$(srcdir) $(srcdir)/check.test - -CLEANFILES=libbox.la box.lo box.o diff --git a/examples/box-dynamic/check.test b/examples/box-dynamic/check.test deleted file mode 100755 index c0923365c..000000000 --- a/examples/box-dynamic/check.test +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -# must be run from this directory -guile=${GUILE-../../libguile/guile} - -set -e - -# -# ./box test #1 -# -$guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline)))' > TMP -cat < -EOF -rm -f TMP - -# -# ./box test #2 -# -$guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP -cat < -# -EOF -rm -f TMP - -# -# ./box test #3 -# -$guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP -cat < -# -1 -EOF -rm -f TMP - -# check.test ends here diff --git a/examples/box-module/Makefile.am b/examples/box-module/Makefile.am deleted file mode 100644 index 4790a296c..000000000 --- a/examples/box-module/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -## Process this file with Automake to create Makefile.in -## -## Copyright (C) 2001, 2006 Free Software Foundation, Inc. -## -## This file is part of GUILE. -## -## GUILE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as -## published by the Free Software Foundation; either version 2, or -## (at your option) any later version. -## -## GUILE is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public -## License along with GUILE; see the file COPYING. If not, write -## to the Free Software Foundation, Inc., 51 Franklin Street, Fifth -## Floor, Boston, MA 02110-1301 USA - -EXTRA_DIST = README box.c check.test - -CFLAGS=`$(bindir)/guile-config compile` -LIBS=`$(bindir)/guile-config link` - -box: box.o - $(CC) $< $(LIBS) -o box - -box.o: box.c - $(CC) $(CFLAGS) -c $< - -installcheck: box - LD_LIBRARY_PATH=$(libdir) GUILE_LOAD_PATH=$(top_srcdir) $(srcdir)/check.test - -CLEANFILES=box box.o diff --git a/examples/box-module/check.test b/examples/box-module/check.test deleted file mode 100755 index 28a79d45b..000000000 --- a/examples/box-module/check.test +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -# must be run from this directory -guile=${GUILE-../../libguile/guile} - -set -e - -# -# ./box test #1 -# -./box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline)))' > TMP -cat < -EOF -rm -f TMP - -# -# ./box test #2 -# -./box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP -cat < -# -EOF -rm -f TMP - -# -# ./box test #3 -# -./box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP -cat < -# -1 -EOF -rm -f TMP - -# check.test ends here diff --git a/examples/box/Makefile.am b/examples/box/Makefile.am deleted file mode 100644 index 4790a296c..000000000 --- a/examples/box/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -## Process this file with Automake to create Makefile.in -## -## Copyright (C) 2001, 2006 Free Software Foundation, Inc. -## -## This file is part of GUILE. -## -## GUILE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as -## published by the Free Software Foundation; either version 2, or -## (at your option) any later version. -## -## GUILE is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public -## License along with GUILE; see the file COPYING. If not, write -## to the Free Software Foundation, Inc., 51 Franklin Street, Fifth -## Floor, Boston, MA 02110-1301 USA - -EXTRA_DIST = README box.c check.test - -CFLAGS=`$(bindir)/guile-config compile` -LIBS=`$(bindir)/guile-config link` - -box: box.o - $(CC) $< $(LIBS) -o box - -box.o: box.c - $(CC) $(CFLAGS) -c $< - -installcheck: box - LD_LIBRARY_PATH=$(libdir) GUILE_LOAD_PATH=$(top_srcdir) $(srcdir)/check.test - -CLEANFILES=box box.o diff --git a/examples/box/check.test b/examples/box/check.test deleted file mode 100755 index 1909ffb7e..000000000 --- a/examples/box/check.test +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -# must be run from this directory -guile=${GUILE-../../libguile/guile} - -set -e - -# -# ./box test #1 -# -./box -c '(let ((b (make-box))) (display b) (newline))' > TMP -cat < -EOF -rm -f TMP - -# -# ./box test #2 -# -./box -c '(let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline))' > TMP -cat < -# -EOF -rm -f TMP - -# -# ./box test #3 -# -./box -c '(let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline))' > TMP -cat < -# -1 -EOF -rm -f TMP - -# check.test ends here diff --git a/examples/check.test b/examples/check.test new file mode 100755 index 000000000..b659ce8dc --- /dev/null +++ b/examples/check.test @@ -0,0 +1,238 @@ +#!/bin/sh + +# must be run from this directory +guile=${GUILE-../libguile/guile} +if [ -x $guile ] ; then + : +else + echo could not find guile interpreter. + echo '(are you running this script from' `dirname $0` '?)' + echo GUILE env var: ${GUILE-not set} + exit 1 +fi + +if test "X$srcdir" = X; then + srcdir=. +fi + +set -e + +# +# simple-hello.scm +# +$guile -s $srcdir/scripts/simple-hello.scm > TMP +cat < TMP +echo "Hello, World!" | diff -u - TMP +rm -f TMP + +$guile -s $srcdir/scripts/hello --version > TMP +echo "hello 0.0.1" | diff -u - TMP +rm -f TMP + +$guile -s $srcdir/scripts/hello --help > TMP +cat < TMP +cat < +EOF +rm -f TMP + +# +# ./box/box test #2 +# +./box/box -c '(let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline))' > TMP +cat < +# +EOF +rm -f TMP + +# +# ./box/box test #3 +# +./box/box -c '(let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline))' > TMP +cat < +# +1 +EOF +rm -f TMP + + + +# +# ./box-module/box test #1 +# +./box-module/box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline)))' > TMP +cat < +EOF +rm -f TMP + +# +# ./box-module/box test #2 +# +./box-module/box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP +cat < +# +EOF +rm -f TMP + +# +# ./box-module/box test #3 +# +./box-module/box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP +cat < +# +1 +EOF +rm -f TMP + + +# +# ./box-dynamic/box test #1 +# +$guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline)))' > TMP +cat < +EOF +rm -f TMP + +# +# ./box-dynamic/box test #2 +# +$guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP +cat < +# +EOF +rm -f TMP + +# +# ./box-dynamic/box test #3 +# +$guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP +cat < +# +1 +EOF +rm -f TMP + + +# +# ./box-dynamic-module/box test #1 +# +$guile -L $srcdir/box-dynamic-module \ + -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline)))' > TMP +cat < +EOF +rm -f TMP + +# +# ./box-dynamic-module/box test #2 +# +$guile -L $srcdir/box-dynamic-module \ + -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP +cat < +# +EOF +rm -f TMP + +# +# ./box-dynamic-module/box test #3 +# +$guile -L $srcdir/box-dynamic-module \ + -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP +cat < +# +1 +EOF +rm -f TMP + +# +# ./box-dynamic-module/box test #4 +# +$guile -L $srcdir/box-dynamic-module \ + -c '(begin (use-modules (box-mixed)) (let ((b (make-box-list 1 2 3))) (display b) (newline) (display (box-map 1+ b)) (newline)))' > TMP +cat < # #) +(# # #) +EOF +rm -f TMP + + + +# +# ./main test +# +$guile -L $srcdir/modules -s $srcdir/modules/main > TMP +cat < TMP +cat < TMP +cat < TMP -cat < TMP -cat < TMP -cat < TMP -cat < TMP -echo "Hello, World!" | diff -u - TMP -rm -f TMP - -$guile -s $srcdir/hello --version > TMP -echo "hello 0.0.1" | diff -u - TMP -rm -f TMP - -$guile -s $srcdir/hello --help > TMP -cat <