I wanted to compile my own SD2IEC firmware version for a long time. I started to create my environment several times but failed. Then came a bit stronger motivation: IEC-ATA made his SD1551 which is an SD2IEC (hardware) based device that connects to the Commodore 264 series (C16, C116, plus/4 and the rarities/prototypes: C232, C264, V364) expansion port and uses the TCBM protocol of the 1551 with SD card bases storage but with custome firmware.
My idea was that as the SD2IEC firmware already supports different hardware variants and bus implementations (Commodore serial, DophinDOS parallel, IEEE-488) we could easily add support for TCBM too and use all the other (like SD-card handling, filesystem, disk image and file handling, firmware update) functions from the original SD2IEC software. Of course I jumped on it but as soon as I was able to compile and flash firmware for my SD2IEC my enhusiasm faded as other projects got in focus. (I didn't give up but it got back beside the other numerous things :) )
So: this post was created to document what do you need to compile the firmware.