Is it possible to write cross-platform makefiles that work both with Unix make utilites (like GNU make)
and Mirosoft nmake?
I have this simple test which determines which macro definitions to load:
Platform = Win32
ifeq ($(OSTYPE),linux)
Platform = Linux
endif
ifeq ($(OSTYPE),linux-gnu)
Platform = Linux
endif
ifeq ($(OSTYPE),Linux)
Platform = Linux
endif
include ../Makefile.$(Platform).cfg
However, Microsoft nmake doesn't want to parse that file. It can't understand the ifeq/endif directives.
The corresponding file working with nmake looks like that:
Platform = Win32
!if "$(OSTYPE)" == "linux"
Platform = Linux
!endif
!if "$(OSTYPE)" == "linux-gnu"
Platform = Linux
!endif
!if "$(OSTYPE)" == "Linux"
Platform = Linux
!endif
include Makefile.$(Platform).cfg
Is it possible to overcome these incompatibilities? Maybe you wouldn't even support the Microsoft tool, just the standard make syntax?
Tell me more... Thanks.
[edited by - Origin on January 22, 2003 3:01:21 PM]