On September 10, 2012 at 1:41 PM Jim Meyering <[email protected]> wrote:
> I want each *existing* .1 file to depend solely on its corresponding .c file. > However, when a .1 file does not exist, *then* I want it to depend on > its corresponding executable. > I.e., I do *not* want to rebuild an existing .1 file > solely because we have a newer binary, when the .1 file > is newer than its dependents (.c and .version). > I started work on a prefix to the .x.1 rule in man/local.mk, > but it relies on test's -nt operator. With a shell lacking > that feature, or when things are out of date, the regular commands > would run. Otherwise, it would simply touch the .1 file and exit > successfully. > > AFAIK, there is no way in GNU make to specify dependencies that vary > depending on the existence of a target. Does anyone know otherwise? > I.e., a rule that would apply when foo.1 does not exist, vs. another > one (with different dependents) that would apply when it does exist. Not sure, but maybe something for .SECONDARYEXPANSION ? http://www.gnu.org/software/make/manual/html_node/Secondary-Expansion.html#Secondary-Expansion <http://www.gnu.org/software/make/manual/html_node/Secondary-Expansion.html#Secondary-Expansion> Have a nice day, Berny
