I am trying to write a top level Makefile that will enter a directory and use the make.exe present in it to make a target. The project is based in Eclipse on a vendor SDK(hence bundling of the make binary). I wanted to create a generic Makefile that could work on both Windows cmd and WSL (Windows linux). I have been able to kind of get it to work individually, but I am unsure how to make it work irrespective of who is using which platform to run this makefile.
For Windows, here is what worked:
all:
cd DIR && make.exe TARGET
On WSL, I use this command:
all:
cd DIR && ./make.exe TARGET
I had to do this as the sub makefile checks if the binary used is actually the one bundled, else throws an error. How can I make this Makefile generic?