NMAKE vs. MAKE - Compatibility?

Started by
2 comments, last by Origin 21 years, 2 months ago
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]
Advertisement
Well, considering gmake exists on windows platforms, I''d say the incompatibilities are fairly easy to overcome
quote:Original post by CmndrM
Well, considering gmake exists on windows platforms, I''d say the incompatibilities are fairly easy to overcome
That was not the answer I intended to get.
quote:Original post by Origin
That was not the answer I intended to get.

Well, that''s the answer you got

Seriously, though, I don''t know too much about nmake makefiles, so I can''t help you out there. I still say the easiest solution to cross-platformability is to use gmake makefiles for all systems, since gmake exists on every platform that I''ve ever heard of.

This topic is closed to new replies.

Advertisement