I did not see anybody do this, so I am sharing it.

There is semi-nice way to get a per-rule software environment in #makefile .

Here is an example with #guix :

(i didnt manage to format the code on mastodon ..., code is in alternative text)

@GuilloteauQ take a look at Guile Scheme implementation of Make https://codeberg.org/lapislazuli/blue
blue

BLUE - Build Language User Extensible. A generic build-system crafted entirely in Guile.

Codeberg.org