]> sourceware.org Git - automake.git/commitdiff
* lib/compile: Change how lockdir is computed. If linking or
authorTom Tromey <tromey@redhat.com>
Wed, 18 Jul 2001 05:59:07 +0000 (05:59 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 18 Jul 2001 05:59:07 +0000 (05:59 +0000)
compiling without `-o', just run the compiler.

ChangeLog
lib/compile

index cd2924c518f94d103e21d98c9c820f3021eddd40..ae561879bff01cc28d39f8d70b46ddf583213bcd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2001-07-18  Tom Tromey  <tromey@redhat.com>
 
+       * lib/compile: Change how lockdir is computed.  If linking or
+       compiling without `-o', just run the compiler.
+
        * tests/Makefile.am (TESTS): Added ccnoco.test.
        (XFAIL_TESTS): Likewise.
        * tests/ccnoco.test: New file.
index 0d11ac5573577fa0d188e662679255a7f1fa772d..7370ae595606a12c843a15254e5685c97f4cd922 100755 (executable)
@@ -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
This page took 0.03191 seconds and 5 git commands to generate.