On Sun, Jun 02, 2019 at 09:03:55AM +1000, Cameron Simpson wrote: > >I'm not a Makefile person myself. My "fix" added the version.sh > >prerequisite and appended to the version.h explicitly just to > >match the target below, reldate.h. > > > >If there is something to be gained by using the Makefile variables > >I'm all ears, but personally I find the recipe less readable with > >that way. > > The only thing gained from using $? and $@ is that renaming the > target or prerequisite doesn't require matching adjustment of the > recipe. But the recipe is very small and I agree it is less readable > with $? and $@.
In this specific instance that may be the case, but in the general case it may also save a lot of typing (including copying and pasting other similar targets), and avoids changes to the recipe if your target or dependencies change. I think once you've written a few make files, this is the sort of thing that would tend to become second nature. The problem with avoiding using these things because you're not familiar with them is that you never become familiar with them--they never get the chance to become second nature. You also tend to attract criticism from experienced users who expect them to be used... -- Derek D. Martin http://www.pizzashack.org/ GPG Key ID: 0xDFBEAD02 -=-=-=-=- This message is posted from an invalid address. Replying to it will result in undeliverable mail due to spam prevention. Sorry for the inconvenience.
pgpsECJfc3EPt.pgp
Description: PGP signature