Hash :
1acbdd67
Author :
Date :
1995-11-15T00:23:13
Put version info in Makefile header
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
#! /bin/sh
# automake - create Makefile.in from Makefile.am
# 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>.
VERSION=@VERSION@
AM_DIR=@prefix@/share/automake
usage="Usage: automake [--help] [--version] Makefile..."
# These are commonly found files that we look for and automatically
# include in DIST_FILES.
common='README NEWS COPYING COPYING.LIB INSTALL NLS ChangeLog configure configure.in mkinstalldirs install-sh texinfo.tex'
# NLS nuisances.
# Only set `LANG' and `LC_ALL' to "C" if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
mfiles=
while test $# -gt 0; do
case "$1" in
--help | --h* )
echo "${usage}" 1>&2
exit 0
;;
--version | --v* )
echo "Automake version $VERSION"
exit 0
;;
-- ) # Stop option processing.
shift
break
;;
-*)
# FIXME consider "-" meaning stdin as input?
echo "automake: unrecognized option -- \`$1'" 1>&2
echo "${usage}" 1>&2
exit 1
;;
* )
mfiles="$mfiles $1"
;;
esac
shift
done
# FIXME in this case, should look for Makefile.am, */Makefile.am and
# use those.
test -n "$mfiles" || {
echo "${usage}" 1>&2
exit 1
}
am_status=0
# Remove \newline.
am_rmnl=/tmp/am.sed1
cat > $am_rmnl <<\EOF
/\\$/{
s///
H
d
}
/[^\\]$/{
H
x
s/\n//g
p
s/.*//
h
}
EOF
# Turn Makefile target and variable assignments
# into shell variable assignments.
am_ass=/tmp/am.sed2
cat > $am_ass <<\EOF
s/(/{/g
s/)/}/g
/^ *\([a-zA-Z_.][a-zA-Z0-9_.]*\):.*/{
s//target_\1=explicit/
s/\./_/g
p
}
s/^ *\([A-Z][A-Z0-9_]*\)[ ]*=[ ]*\(.*\)/\1='\2'/p
EOF
for am_makefile in $mfiles
do
if test ! -f ${am_makefile}.am; then
echo "automake: ${am_makefile}.am: No such honkin' file"
am_status=1
continue
fi
echo creating ${am_makefile}.in
exec 4> ${am_makefile}.vars
exec 5> ${am_makefile}.rules
echo "# Makefile.in generated automatically by automake $VERSION from Makefile.am." >&4
cat $AM_DIR/header-vars.am >&4
cat $AM_DIR/header.am >&5
DEFS= INCLUDES= CPPFLAGS= CFLAGS=
SOURCES= CONFIG_HEADER= SUBDIRS= PROGRAMS= LIBPROGRAMS= SCRIPTS= LIBSCRIPTS=
LIBRARIES= TEXINFOS= MANS= ALLPROGRAMS=
eval `sed -n -f $am_rmnl ${am_makefile}.am | sed -n -f $am_ass`
test -n "$ALLPROGRAMS" || {
echo "ALLPROGRAMS = $PROGRAMS" >&4
}
if grep @kr@ ${am_makefile}.am >/dev/null; then
kr='${kr}'
else
kr=
fi
if test -n "$PROGRAMS$LIBPROGRAMS$LIBRARIES"; then
cat $AM_DIR/compile-vars.am >&4
cat $AM_DIR/compile.am >&5
grep @kr@ ${am_makefile}.am >/dev/null && cat $AM_DIR/compile-kr.am >&5
for am_file in $PROGRAMS $LIBPROGRAMS $LIBRARIES ''; do
if grep "^[ ]*${am_file}_SOURCES[ ]*=" ${am_makefile}.am >/dev/null; then
if grep "^[ ]*${am_file}_OBJECTS[ ]*=" ${am_makefile}.am >/dev/null; then
:
else
sed -n -f $am_rmnl ${am_makefile}.am |
sed -n "/^[ ]*${am_file}_SOURCES[ ]*=/{
s/SOURCES/OBJECTS/
s/@[^@]*@//g
s/\$([^)]*)//g
s/\${[^}]*}//g
s/\\.cc/.${kr}o/g
s/\\.\${kr}c/.${kr}o/g
s/\\.\$(kr)c/.${kr}o/g
s/\\.[cCmylfs]/.${kr}o/g
p
}" >&4
fi
SOURCES="$SOURCES \${${am_file}_SOURCES}"
else
echo "${am_file}_SOURCES = ${am_file}.c
${am_file}_OBJECTS = ${am_file}.${kr}o" >&4
SOURCES="$SOURCES ${am_file}.c"
fi
if test -n "$CONFIG_HEADER"; then
echo "\$(${am_file}_OBJECTS): $CONFIG_HEADER" >&5
fi
done
fi
if test -n "$PROGRAMS$LIBPROGRAMS$SCRIPTS$LIBSCRIPTS"; then
if test -n "$PROGRAMS$SCRIPTS"; then
cat $AM_DIR/programs.am >&5
fi
if test -n "$LIBPROGRAMS$LIBSCRIPTS"; then
cat $AM_DIR/libprograms.am >&5
fi
if test -n "$PROGRAMS$LIBPROGRAMS"; then
for am_prog in $PROGRAMS $LIBPROGRAMS; do
eval "test \"\$target_$am_prog\" != explicit" &&
sed "s/@PROGRAM@/$am_prog/g" $AM_DIR/program.am >&5
done
fi
fi
if test -n "$LIBRARIES"; then
echo "LIBFILES = " `echo "$LIBRARIES"|sed 's/\([a-zA-Z0-9_][a-zA-Z0-9_]*\)/lib\1.a/g'` >&4
cat $AM_DIR/libraries-vars.am >&4
cat $AM_DIR/libraries.am >&5
for am_lib in $LIBRARIES; do
sed "s/@LIBRARY@/$am_lib/g" $AM_DIR/library.am >&5
done
fi
if test -n "$TEXINFOS"; then
cat $AM_DIR/texinfos-vars.am >&4
cat $AM_DIR/texinfos.am >&5
echo "$TEXINFOS" | sed 's/^/INFOS = /; s/\.texi/.info*/g' >&4
echo "$TEXINFOS" | sed 's/^/INFO_DEPS = /; s/\.texi/.info/g' >&4
echo "$TEXINFOS" | sed 's/^/DVIS = /; s/\.texi/.dvi/g' >&4
fi
if test -n "$MANS"; then
cat $AM_DIR/mans-vars.am >&4
cat $AM_DIR/mans.am >&5
fi
case "$SUBDIRS" in
"") if grep @kr@ ${am_makefile}.am >/dev/null; then
cat $AM_DIR/clean-kr.am >&5
else cat $AM_DIR/clean.am >&5
fi
cat $AM_DIR/footer.am >&5 ;;
*) cat $AM_DIR/subdirs.am >&5 ;;
esac
case "$am_makefile" in
*/*)
cat $AM_DIR/remake-subd.am >&5
;;
*)
test -f aclocal.m4 && echo "ACLOCAL = aclocal.m4" >&4
cat $AM_DIR/remake.am >&5
;;
esac
case "$CONFIG_HEADER" in
"") ;;
*/*) ;; # It's in some other directory, so don't remake it in this one.
*)
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 $AM_DIR/remake-hdr.am >&5 ;;
esac
echo "SOURCES = $SOURCES" >&4
#
# Handle "dist" targets.
#
amdir=`echo "$am_makefile" | sed 's,//*[^/][^/]*$,,g'`
if test "$amdir" = "$am_makefile"; then
# Bogus.
amdir=.
fi
# Look for certain common files and make sure they are included.
dlist=
for cfile in $common; do
if test -f $amdir/$cfile; then
dlist="$dlist $cfile"
fi
done
echo "DIST_COMMON = $dlist" >&4
# Include "dist" boilerplate.
case "$am_makefile" in
*/*)
cat $AM_DIR/dist-subd-vars.am >&4
echo "subdir = $amdir" >&5
cat $AM_DIR/dist-subd.am >&5
;;
*)
cat $AM_DIR/dist-vars.am >&4
if test -n "$SUBDIRS"; then
cat $AM_DIR/dist-subd-top.am >&5
else
cat $AM_DIR/dist.am >&5
fi
;;
esac
sed '/^[^#=]*:/,$d' ${am_makefile}.am >&4
sed -n '/^[^#=]*:/,$p' ${am_makefile}.am >&5
cat ${am_makefile}.vars ${am_makefile}.rules > ${am_makefile}.in
rm -f ${am_makefile}.vars ${am_makefile}.rules
done
rm -f $am_rmnl $am_ass
exit $am_status