Commit 55f8fcfd08cbf15d65d61dd2db934b6c3171cf06

Mike Frysinger 2023-01-11T22:07:22

dirstamp: switch to a pattern rule We can leverage $(@D) to generate a single pattern rule for all dirstamp rules. This saves many lines in the output -- normally we create 2 rules (or 6 lines) per subdir, and projects that use subdirs tend to use them quite a bit. In the most extreme & unlikely case (1 subdir, no depdir support), the line count is the same. In every other case, it's always a win. Looking at a few real world projects, the line deltas: * GNU libgloss: +3 -66 * GNU newlib: +3 -714 * GNU sim: +3 -138 There shouldn't be any concerns about portability with $(@D) because: (0) This has been in POSIX (and beyond) for decades, (1) We only generate this rule iff we know the dirstamp is in a subdir (so we'd never have a case where $(@D) would expand to the cwd, and that is where a few implementations are known to be buggy), (2) We already rely on $(@D) in our depdir code, and have since 2014 (the Automake 1.16 release).