source: trunk/src/gmake/build.sh.in@ 512

Last change on this file since 512 was 503, checked in by bird, 19 years ago

Untested merge with GNU Make v3.81 (vendor/gnumake/2005-05-16 -> vendor/gnumake/current).

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 2.9 KB
Line 
1
2# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
3# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4# This file is part of GNU Make.
5#
6# GNU Make is free software; you can redistribute it and/or modify it under the
7# terms of the GNU General Public License as published by the Free Software
8# Foundation; either version 2, or (at your option) any later version.
9#
10# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
11# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along with
15# GNU Make; see the file COPYING. If not, write to the Free Software
16# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
18# See Makefile.in for comments describing these variables.
19
20srcdir='@srcdir@'
21CC='@CC@'
22CFLAGS='@CFLAGS@'
23CPPFLAGS='@CPPFLAGS@'
24LDFLAGS='@LDFLAGS@'
25ALLOCA='@ALLOCA@'
26LOADLIBES='@LIBS@ @LIBINTL@'
27eval extras=\'@LIBOBJS@\'
28REMOTE='@REMOTE@'
29GLOBLIB='@GLOBLIB@'
30PATH_SEPARATOR='@PATH_SEPARATOR@'
31OBJEXT='@OBJEXT@'
32EXEEXT='@EXEEXT@'
33
34# Common prefix for machine-independent installed files.
35prefix='@prefix@'
36# Common prefix for machine-dependent installed files.
37exec_prefix=`eval echo @exec_prefix@`
38# Directory to find libraries in for `-lXXX'.
39libdir=${exec_prefix}/lib
40# Directory to search by default for included makefiles.
41includedir=${prefix}/include
42
43localedir=${prefix}/share/locale
44aliaspath=${localedir}${PATH_SEPARATOR}.
45
46defines="-DALIASPATH=\"${aliaspath}\" -DLOCALEDIR=\"${localedir}\" -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\""' @DEFS@'
47
48# Exit as soon as any command fails.
49set -e
50
51# These are all the objects we need to link together.
52objs="ar.${OBJEXT} arscan.${OBJEXT} commands.${OBJEXT} default.${OBJEXT} dir.${OBJEXT} expand.${OBJEXT} file.${OBJEXT} function.${OBJEXT} getopt.${OBJEXT} getopt1.${OBJEXT} implicit.${OBJEXT} job.${OBJEXT} main.${OBJEXT} misc.${OBJEXT} read.${OBJEXT} remake.${OBJEXT} rule.${OBJEXT} signame.${OBJEXT} strcache.${OBJEXT} variable.${OBJEXT} version.${OBJEXT} vpath.${OBJEXT} hash.${OBJEXT} remote-${REMOTE}.${OBJEXT} ${extras} ${ALLOCA}"
53
54if [ x"$GLOBLIB" != x ]; then
55 objs="$objs glob/fnmatch.${OBJEXT} glob/glob.${OBJEXT}"
56 globinc=-I${srcdir}/glob
57fi
58
59# Compile the source files into those objects.
60for file in `echo ${objs} | sed 's/\.'${OBJEXT}'/.c/g'`; do
61 echo compiling ${file}...
62 $CC $defines $CPPFLAGS $CFLAGS \
63 -c -I. -I${srcdir} ${globinc} ${srcdir}/$file
64done
65
66# The object files were actually all put in the current directory.
67# Remove the source directory names from the list.
68srcobjs="$objs"
69objs=
70for obj in $srcobjs; do
71 objs="$objs `basename $obj`"
72done
73
74# Link all the objects together.
75echo linking make...
76$CC $CFLAGS $LDFLAGS $objs $LOADLIBES -o makenew${EXEEXT}
77echo done
78mv -f makenew${EXEEXT} make${EXEEXT}
Note: See TracBrowser for help on using the repository browser.