#### Archived

This topic is now archived and is closed to further replies.

# NMAKE vs. MAKE - Compatibility?

This topic is 5505 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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]

##### Share on other sites
Well, considering gmake exists on windows platforms, I''d say the incompatibilities are fairly easy to overcome

##### Share on other sites
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.

##### Share on other sites
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.