How do you configure extconf.rb so files are outputtet to a given folder?

extconf.rb generates a MAKE file in the same folder as itself.

However, for my project I compile on Windows and OSX. I would like to
make it so that when I compile on one platform all the files generated
is placed in a folder for that platform. So that under windows
everything is outputted in an folder named “win” and under OSX a folder
named “osx”.

I really cannot find how you configure a custom output folder.