summaryrefslogtreecommitdiff
path: root/lib/compile
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-07-18 05:59:07 +0000
committerTom Tromey <tromey@redhat.com>2001-07-18 05:59:07 +0000
commitcd881a78e7232e973c3202eef3e8302608ca54f6 (patch)
treeebaec6a94527b3165b5b8deb14b565c149024c2b /lib/compile
parent0066e5961e36c1d9c3a57a772b745192cbdeb59d (diff)
downloadautomake-cd881a78e7232e973c3202eef3e8302608ca54f6.tar.gz
* lib/compile: Change how lockdir is computed. If linking or
compiling without `-o', just run the compiler.
Diffstat (limited to 'lib/compile')
-rwxr-xr-xlib/compile22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/compile b/lib/compile
index 0d11ac557..7370ae595 100755
--- a/lib/compile
+++ b/lib/compile
@@ -51,21 +51,23 @@ while test $# -gt 0; do
shift
done
-test -z "$ofile" && {
- echo "compile: no \`-o' option seen" 1>&2
- exit 1
-}
-
-test -z "$cfile" && {
- echo "compile: no \`.c' file seen" 1>&2
- exit 1
-}
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no `-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # `.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$prog" $args
+fi
# Name of file we expect compiler to create.
cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
-lockdir=`echo $ofile | sed -e 's|/|_|g'`
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d
while true; do
if mkdir $lockdir > /dev/null 2>&1; then
break