我希望在Linux和Windows上构建相同的Makefile.我在Linux上使用默认的GNU make,在Windows上使用默认的mingw32-make(也是GNU make).
我想让Makefile检测它是在Windows还是Linux上运行.
例如,Windows上的make clean
命令如下所示:
clean:
del $(DESTDIR_TARGET)
但在Linux上:
clean:
rm $(DESTDIR_TARGET)
我还想在Windows(\
)和Linux(/
)上使用不同的目录分隔符.
It is possible to detect Windows operating system in Makefile?
PS:I do not want to emulate Linux on Windows (cygwin etc.)
还有一个类似的问题:OS detecting makefile,但我在这里没有找到答案.