Skip to content

Hadrian: refactor .o and .hi rules into a single rule that produces both files

Refactor the rules for .hi and .o into a single rule using &%>

Currently the rule for .hi files just triggers (via need) the rule for the .o file, and .o rule generates both the .o and .hi file. Likewise for .o-boot and .hi-boot files. This is a bit of an abuse of Shake, and in fact shake supports rules with multiple output with the &%> function. This exact use case appears in Neil Mitchell's paper Shake Before Building section 6.3.

Edited by David Eichmann
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information