Discussion:
[9fans] mk: the `D' flag
(too old to reply)
dexen deVries
2013-06-18 13:50:35 UTC
Permalink
in mk(1), why is the `D' flag (if the recipe exits with a non-null status, the
target is deleted) optional, rather than default?

i can see why it makes little sense with together `V' flag, but for non-V
rules, targeting plain files, i'd like it by default.
--
dexen deVries

[[[↓][→]]]
Friedrich Psiorz
2013-06-18 14:05:52 UTC
Permalink
I wouldn't. It doesn't make sense to me to delete the old, working
executable of my program just because I messed up when I made a change.
Post by dexen deVries
in mk(1), why is the `D' flag (if the recipe exits with a non-null status, the
target is deleted) optional, rather than default?
i can see why it makes little sense with together `V' flag, but for non-V
rules, targeting plain files, i'd like it by default.
Anthony Sorace
2013-06-19 17:51:19 UTC
Permalink
I can't find a record of it quickly ("mk" and "D" don't lend themselves to
helpful searches), but I feel like we had this conversation about a year
ago, no?

Summary, from my memory:

Some people would prefer it, others not. Keeping intermediaries and
failed targets around is often helpful for debugging. Keep in mind mk
can be used for things other than binaries. The cost of leaving things
around you don't want is often/usually higher than the cost of
removing things you do; the inverse is uncommon. These are all
reasons to prefer the current behavior. Add to that the high cost of
changing a default with decades of precedence, and it seems pretty
darned unlikely that mk's behavior will change here.

Anthony

Continue reading on narkive:
Loading...