Support nanosecond timestamps in stat() for AIX 5.2+.
[make.git] / build.template
blob7c31050e2b1bb970a4ac7b32d2027f6d251d2de6
1 #!/bin/sh
2 # Shell script to build GNU Make in the absence of any 'make' program.
3 # @configure_input@
5 # Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
6 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software
7 # Foundation, Inc.
8 # This file is part of GNU Make.
10 # GNU Make is free software; you can redistribute it and/or modify it under
11 # the terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 3 of the License, or (at your option) any later
13 # version.
15 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 # details.
20 # You should have received a copy of the GNU General Public License along with
21 # this program. If not, see <http://www.gnu.org/licenses/>.
23 # See Makefile.in for comments describing these variables.
25 srcdir='@srcdir@'
26 CC='@CC@'
27 CFLAGS='@CFLAGS@'
28 CPPFLAGS='@CPPFLAGS@'
29 LDFLAGS='@LDFLAGS@'
30 ALLOCA='@ALLOCA@'
31 LOADLIBES='@LIBS@ @LIBINTL@'
32 eval extras=\'@LIBOBJS@\'
33 REMOTE='@REMOTE@'
34 GLOBLIB='@GLOBLIB@'
35 PATH_SEPARATOR='@PATH_SEPARATOR@'
36 OBJEXT='@OBJEXT@'
37 EXEEXT='@EXEEXT@'
39 # Common prefix for machine-independent installed files.
40 prefix='@prefix@'
41 # Common prefix for machine-dependent installed files.
42 exec_prefix=`eval echo @exec_prefix@`
43 # Directory to find libraries in for '-lXXX'.
44 libdir=${exec_prefix}/lib
45 # Directory to search by default for included makefiles.
46 includedir=${prefix}/include
48 localedir=${prefix}/share/locale
49 aliaspath=${localedir}${PATH_SEPARATOR}.
51 defines="-DALIASPATH=\"${aliaspath}\" -DLOCALEDIR=\"${localedir}\" -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\""' @DEFS@'
53 # Exit as soon as any command fails.
54 set -e
56 # These are all the objects we need to link together.
57 objs="%objs% remote-${REMOTE}.${OBJEXT} ${extras} ${ALLOCA}"
59 if [ x"$GLOBLIB" != x ]; then
60 objs="$objs %globobjs%"
61 globinc=-I${srcdir}/glob
64 # Compile the source files into those objects.
65 for file in `echo ${objs} | sed 's/\.'${OBJEXT}'/.c/g'`; do
66 echo compiling ${file}...
67 $CC $defines $CPPFLAGS $CFLAGS \
68 -c -I. -I${srcdir} ${globinc} ${srcdir}/$file
69 done
71 # The object files were actually all put in the current directory.
72 # Remove the source directory names from the list.
73 srcobjs="$objs"
74 objs=
75 for obj in $srcobjs; do
76 objs="$objs `basename $obj`"
77 done
79 # Link all the objects together.
80 echo linking make...
81 $CC $CFLAGS $LDFLAGS $objs $LOADLIBES -o makenew${EXEEXT}
82 echo done
83 mv -f makenew${EXEEXT} make${EXEEXT}