#!/bin/sh
# automake - create Makefile.in from Makefile.am
-# Usage: automake Makefile lib/Makefile src/Makefile man/Makefile
+# Copyright (C) 1994 Free Software Foundation, Inc.
+
+# This program 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.
+
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Sample usage: automake Makefile lib/Makefile src/Makefile man/Makefile
# Written by David Mackenzie <djm@gnu.ai.mit.edu>.
if test $# -eq 0; then
exit 1
fi
-status=0
-amdir=`echo $0|sed s%automake%%`
+am_status=0
+am_dir=`echo $0|sed s%automake%%`
-for makefile
+for am_makefile
do
- if test ! -f ${makefile}.am; then
- echo "automake: ${makefile}.am: No such honkin' file"
- status=1
+ if test ! -f ${am_makefile}.am; then
+ echo "automake: ${am_makefile}.am: No such honkin' file"
+ am_status=1
continue
fi
- exec 4> ${makefile}.in
+ exec 4> ${am_makefile}.in
- cat $amdir/header.am >&4
+ cat $am_dir/header.am >&4
- cat ${makefile}.am >&4
+ cat ${am_makefile}.am >&4
+ target_distname=default
CONFIG_HEADER= SUBDIRS= PROGRAMS= LIBRARIES= TEXINFOS= MANS=
eval `sed -n '
-s/^[ ]*\([A-Z][A-Z0-9_]*\)=[ ]*\(.*\)/\1=\2/p' ${makefile}.am`
+s/^ *\([a-zA-Z_][a-zA-Z0-9_]*\):.*/target_\1=explicit/
+s/^ *\([A-Z][A-Z0-9_]*\)=[ ]*\(.*\)/\1=\2/p' ${am_makefile}.am`
case "$SUBDIRS" in
- "") cat $amdir/clean.am >&4 ;;
- *) cat $amdir/subdirs.am >&4 ;;
+ "") cat $am_dir/clean.am >&4 ;;
+ *) cat $am_dir/subdirs.am >&4 ;;
esac
if test -n "$PROGRAMS" || test -n "$LIBRARIES"; then
- cat $amdir/compile.am >&4
- for file in $PROGRAMS $LIBRARIES; do
- sed -n "/^[ ]*${file}_SOURCES[ ]*=/{
+ cat $am_dir/compile.am >&4
+ for am_file in $PROGRAMS $LIBRARIES; do
+ sed -n "/^[ ]*${am_file}_SOURCES[ ]*=/{
s/SOURCES/OBJECTS/
s/\\.cc/.o/g
s/\\.\${kr}c/.o/g
s/\\.\$(kr)c/.o/g
s/\\.[cCmylfs]/.o/g
p
-}" ${makefile}.am >&4
+}" ${am_makefile}.am >&4
if test -n "$CONFIG_HEADER"; then
- echo "\$(${file}_OBJECTS): $CONFIG_HEADER" >&4
+ echo "\$(${am_file}_OBJECTS): $CONFIG_HEADER" >&4
fi
done
fi
if test -n "$PROGRAMS"; then
- cat $amdir/programs.am >&4
- for prog in $PROGRAMS; do
- sed "s/@PROGRAM@/$prog/g" $amdir/program.am >&4
+ cat $am_dir/programs.am >&4
+ for am_prog in $PROGRAMS; do
+ sed "s/@PROGRAM@/$am_prog/g" $am_dir/program.am >&4
done
fi
if test -n "$LIBRARIES"; then
- cat $amdir/libraries.am >&4
- for lib in $LIBRARIES; do
- sed "s/@LIBRARY@/$lib/g" $amdir/library.am >&4
+ cat $am_dir/libraries.am >&4
+ for am_lib in $LIBRARIES; do
+ sed "s/@LIBRARY@/$am_lib/g" $am_dir/library.am >&4
done
fi
if test -n "$TEXINFOS"; then
- cat $amdir/texinfos.am >&4
+ cat $am_dir/texinfos.am >&4
echo "$TEXINFOS" | sed 's/^/INFOS = /; s/\.texi/.info/g' >&4
echo "$TEXINFOS" | sed 's/^/DVIS = /; s/\.texi/.dvi/g' >&4
fi
if test -n "$MANS"; then
- cat $amdir/mans.am >&4
+ cat $am_dir/mans.am >&4
fi
- case "$makefile" in
- */*) cat $amdir/remake-subdir.am >&4 ;;
+ case "$am_makefile" in
+ */*) cat $am_dir/remake-subd.am >&4 ;;
*) test -f aclocal.m4 && echo "ACLOCAL = aclocal.m4" >&4
- cat $amdir/remake.am >&4 ;;
+ cat $am_dir/remake.am >&4 ;;
esac
case "$CONFIG_HEADER" in
test -f acconfig.h && echo "ACCONFIG = acconfig.h" >&4
test -f config.h.top && echo "CONFIG_TOP = config.h.top" >&4
test -f config.h.bot && echo "CONFIG_BOT = config.h.bot" >&4
- cat $amdir/remake-hdr.am >&4 ;;
+ cat $am_dir/remake-hdr.am >&4 ;;
esac
- case "$makefile" in
- */*) cat $amdir/dist-subdir.am >&4 ;;
- *) cat $amdir/dist.am >&4 ;;
+ case "$am_makefile" in
+ */*) cat $am_dir/dist-subd.am >&4 ;;
+ *) test "$target_distname" != explicit && cat $am_dir/distname.am >&4
+ cat $am_dir/dist.am >&4 ;;
esac
- cat $amdir/footer.am >&4
+ cat $am_dir/footer.am >&4
done
-exit $status
+exit $am_status