On 2023-09-03 14:57, Alejandro Colomar wrote: > On 2023-09-03 14:38, Paul Smith wrote: >> On Sun, 2023-09-03 at 13:14 +0200, Alejandro Colomar wrote: >>>> You need to put the ifdef outside the recipe: >>> >>> That would hurt readability a little bit. >> >> IMO a make preprocessor statement inside a recipe is a code smell and I >> would find the "outside the recipe" version simpler to understand, but >> of course this is a personal taste thing. >> > > The rule is something like this: > > target: source > sed 's/%date%/$(shell date)/' <$< | > ifneq ($(VERSION),) > sed 's/%version%/$(VERSION)/' | > endif > cp -T /dev/stdin $@
Heh, I wasn't seeing this, but VERSION := %version% would allow running this unconditionally. Problem solved. :) -- <http://www.alejandro-colomar.es/> GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
OpenPGP_signature
Description: OpenPGP digital signature