Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8077814

Add .DELETE_ON_ERROR to makefiles

XMLWordPrintable

    • b61

        From the gnu make documentation:

        "Usually when a recipe line fails, if it has changed the target file at all, the file is corrupted and cannot be used—or at least it is not completely updated. Yet the file’s time stamp says that it is now up to date, so the next time make runs, it will not try to update that file. The situation is just the same as when the shell is killed by a signal; see Interrupts. So generally the right thing to do is to delete the target file if the recipe fails after beginning to change the file. make will do this if .DELETE_ON_ERROR appears as a target. This is almost always what you want make to do, but it is not historical practice; so for compatibility, you must explicitly request it."

        In many cases we work around this by working on a temporary file and then as the last step mv it to the final location. In some cases this practice isn't employed and would be inconvenient to do. It would be better to just use the built in feature that is already there. Adding it to make/common/MakeBase.gmk should do the trick.

              erikj Erik Joelsson
              erikj Erik Joelsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: