summaryrefslogtreecommitdiff
path: root/build.template
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1993-01-13 21:05:03 +0000
committerRoland McGrath <roland@redhat.com>1993-01-13 21:05:03 +0000
commitfae8065d7fe1897d20147372512015b8ff82c3ee (patch)
tree1aa34890fca79c7dde94c6c8ba9191a8c90ece7f /build.template
parent099b4d56433c3866ddf1f69a20e26729809f208f (diff)
downloadgunmake-fae8065d7fe1897d20147372512015b8ff82c3ee.tar.gz
Formerly build.template.~3~
Diffstat (limited to 'build.template')
-rw-r--r--build.template23
1 files changed, 14 insertions, 9 deletions
diff --git a/build.template b/build.template
index 15d83f1..c9134ec 100644
--- a/build.template
+++ b/build.template
@@ -41,20 +41,25 @@ includedir=${prefix}/include
# Exit as soon as any command fails.
set -e
-globobjs="%globobjs%"
-
-# To make life simpler, just copy the glob sources into this directory.
-for file in `echo ${globobjs} | sed 's/\.o/.c/g'`; do
- ln ${srcdir}/glob/$file $file || cp ${srcdir}/glob/$file $file
-done
-
-objs="%objs% ${globobjs} ${extras} ${ALLOCA}"
+# These are all the objects we need to link together.
+objs="%objs% ${extras} ${ALLOCA}"
+# Compile the source files into those objects.
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
echo compiling ${file}...
$CC $CFLAGS $defines -c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
done
-echo linking make
+# The object files were actually all put in the current directory.
+# Remove the source directory names from the list.
+srcobjs="$objs"
+objs=
+for obj in $srcobjs; do
+ objs="$objs `basename $obj`"
+done
+
+# Link all the objects together.
+echo linking make...
$CC $LDFLAGS $objs $LOADLIBES -o make.new
+echo done
mv -f make.new make