How to undo intermediate file deletion

前端 未结 3 1016
小蘑菇
小蘑菇 2020-12-10 00:35

I have a software stack that creates some intermediate files as a part of build process. There is some problem come up and the build breaks. I want to have a look at those i

3条回答
  •  情书的邮戳
    2020-12-10 01:19

    There is a restriction on the use of targets, which affects the behaviour of .PRECIOUS:

    I have targets A/%.foo: and B/%.foo: , so I have set:

    .PRECIOUS: %.foo
    

    and this did not work; I don't understand why, but expansion does not work this way; I had to explicitely list targets exactly as they are written:

    .PRECIOUS: A/%.foo B/%.foo
    

    But even after reading https://www.gnu.org/software/make/manual/html_node/Special-Targets.html I do not understand the difference between .PRECIOUS: and .SECONDARY: .

    It's accepted to use those special targets without depends, but I think this would be very dirty coding and would expect side effects. Some people just put .PRECIOUS: or .SECONDARY: without dep, and later, they complain they have to run make clean after a broken build ...

提交回复
热议问题