summaryrefslogtreecommitdiff
path: root/build.template
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1993-01-12 23:00:41 +0000
committerRoland McGrath <roland@redhat.com>1993-01-12 23:00:41 +0000
commit099b4d56433c3866ddf1f69a20e26729809f208f (patch)
tree8034a4f9c45d9782df6e553d4eab87f4972cff66 /build.template
parent5e83d8b10aa70c6be78449a3fbc16fdc4d10da7f (diff)
downloadgunmake-099b4d56433c3866ddf1f69a20e26729809f208f.tar.gz
Formerly build.template.~2~
Diffstat (limited to 'build.template')
-rw-r--r--build.template18
1 files changed, 15 insertions, 3 deletions
diff --git a/build.template b/build.template
index 3e9f51e..15d83f1 100644
--- a/build.template
+++ b/build.template
@@ -24,13 +24,11 @@
srcdir='@srcdir@'
CC='@CC@'
CFLAGS="${CFLAGS--g}"
-defines='@DEFS@ -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\"'
+defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
ALLOCA='@ALLOCA@'
LOADLIBES='@LIBS@'
extras='@LIBOBJS@'
-objs="%objs% ${extras} ${ALLOCA}"
-
# Common prefix for machine-independent installed files.
prefix=/usr/local
# Common prefix for machine-dependent installed files.
@@ -40,9 +38,23 @@ libdir=${exec_prefix}/lib
# Directory to search by default for included makefiles.
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}"
+
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
$CC $LDFLAGS $objs $LOADLIBES -o make.new
mv -f make.new make