3
# libctl: flexible Guile-based control files for scientific software
4
# Copyright (C) 1998, 1999, 2000, 2001, 2002, Steven G. Johnson
6
# This library is free software; you can redistribute it and/or
7
# modify it under the terms of the GNU Lesser General Public
8
# License as published by the Free Software Foundation; either
9
# version 2 of the License, or (at your option) any later version.
11
# This library is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
# Lesser General Public License for more details.
16
# You should have received a copy of the GNU Lesser General Public
17
# License along with this library; if not, write to the
18
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
# Boston, MA 02111-1307, USA.
21
# Steven G. Johnson can be contacted at stevenj@alum.mit.edu.
23
output_dir="`dirname $1`"
25
if test "$#" = "2"; then
28
libctl_dir="@prefix@/share/libctl"
30
if test ! -r $libctl_dir/utils/ctl-io.scm; then
31
echo "couldn't find $libctl_dir/utils/ctl-io.scm"
35
rm -f $output_dir/ctl-io.c $output_dir/ctl-io.h
37
cat > $output_dir/ctl-io.h <<EOF
38
/* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT MODIFY! */
39
/* generated from the file: $1 */
49
#endif /* __cplusplus */
53
cat > $output_dir/ctl-io.c <<EOF
54
/* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT MODIFY! */
55
/* generated from the file: $1 */
63
guile -l $libctl_dir/base/include.scm \
64
-c "(include "'"'"$libctl_dir/base/ctl.scm"'"'") (include "'"'"$libctl_dir/utils/ctl-io.scm"'"'") (include "'"'"$1"'"'") (output-header)" >> $output_dir/ctl-io.h
66
guile -l $libctl_dir/base/include.scm \
67
-c "(include "'"'"$libctl_dir/base/ctl.scm"'"'") (include "'"'"$libctl_dir/utils/ctl-io.scm"'"'") (include "'"'"$1"'"'") (output-source)" >> $output_dir/ctl-io.c
69
cat >> $output_dir/ctl-io.h <<EOF
73
#endif /* __cplusplus */
79
@INDENT@ $output_dir/ctl-io.c > /dev/null 2>&1
80
@INDENT@ $output_dir/ctl-io.h > /dev/null 2>&1
81
rm -f $output_dir/ctl-io.c~ $output_dir/ctl-io.h~
82
rm -f $output_dir/ctl-io.c.BAK $output_dir/ctl-io.h.BAK