mohawk2 / dmake

dmake - formerly used by openoffice.org
Other
15 stars 6 forks source link

Bug 48781 - Problem with attempted deletion of already-deleted intermediate file #3

Closed mohawk2 closed 10 years ago

mohawk2 commented 10 years ago
This is a re-log of a problem first described in issue #43310.

The problem is question is reproduced by the following makefile:

.USESHELL :

all :: foo.dll

foo.dll : foo.obj
    copy foo.obj foo.dll

all :: foo.xs

.c.obj :
    copy $*.c $*.obj

.xs.c :
    copy $*.xs $*.c

foo.xs ::
    echo foo>foo.xs

This almost works OK, but tries to delete foo.xs at the end of the process and
fails because it has already deleted it earlier.  Here's the output that I get:

echo foo>foo.xs
copy foo.xs foo.c
        1 file(s) copied.
del  foo.xs
copy foo.c foo.obj
        1 file(s) copied.
del  foo.c
copy foo.obj foo.dll
        1 file(s) copied.
del  foo.xs
Could Not Find C:\Temp\dmake-43310\foo.xs

If I remove the "all :: foo.xs" line then the extraneous deletion is not
attempted and all is well.

An even stranger thing happens if I changed the "foo.xs ::" line to just "foo.xs
:" instead.  In this case, the extra deletion is again attempted, but this time
succeeds because foo.xs actually gets remade first!  Here's the output:

echo foo>foo.xs
copy foo.xs foo.c
        1 file(s) copied.
del  foo.xs
copy foo.c foo.obj
        1 file(s) copied.
del  foo.c
copy foo.obj foo.dll
        1 file(s) copied.
echo foo>foo.xs
del  foo.xs
mohawk2 commented 10 years ago

Works fine on Windows 7, with dmake -V reporting "dmake - Version 4.12 (Windows / MinGW)".