help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help: conversion from nmake to gnu make


From: Eric Melski
Subject: Re: help: conversion from nmake to gnu make
Date: Tue, 01 Dec 2009 12:27:04 -0800
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Paul Smith wrote:
On Tue, 2009-12-01 at 09:34 -0800, Eric Melski wrote:
Subramanian Olagappan wrote:
I am trying to convert a nmake Makefile to gnumake Makefile. Can someone help 
me to convert this code snipet to gnu compatible one

!if "$(LEVEL)"<"0" || "$(LEVEL)">"2"
!       error Level is not valid!
!endif
This looks like Microsoft NMAKE. In general, MS NMAKE has a much more expressive syntax for expressions like this, so you may have some difficulty converting. However, in this particular case, I think the following GNU make syntax is equivalent:

ifneq ("$(LEVEL)","1")
     $(error Level is not valid!)
endif

That's not equivalent.  But this would be:

ifeq (,$(filter $(LEVEL), 1 2 3))
  $(error Level is not valid!)
endif

Cheers!

LOL: I should have known better than to answer before my morning coffee, but it looks like you should have too! The original construct, with NMAKE, accepts LEVEL with values 0, 1 and 2. My first attempt accepted only LEVEL=1. Your attempt accepts LEVEL with values 1, 2 or 3.

The correct expression is:

ifeq (,$(filter $(LEVEL), 0 1 2))
  $(error Level is not valid!)
endif

Best regards,

Eric Melski
Electric Cloud, Inc.
http://blog.electric-cloud.com/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]