0
我的Makefile文件包含以下規則:如何在Makefile中使用算術進行模式規則?
result-n1 : inputs
foo $^
result-n2 : result-n1
hashandmash $^ > [email protected]
result-n3 : result-n2
hashandmash $^ > [email protected]
# ... [~ 50 more lines omitted for clarity]
result-n20 : result-n19
hashandmash $^ > [email protected]
我很想有隻有一個模式規則。這將更加清晰,並將避免20
的硬編碼限制。
但你會如何做到這一點? How do you say result-n
x取決於result-n
x-1?我只看到不雅的解決方案(比如命名我的文件在基礎1,例如,result-nIIIIIIII
)。
PS & FWIW,我用GNU Make 3.81
謝謝!這已經比我的示例Makefile更清晰簡單了。 – phs 2015-01-15 17:38:55