[Top][All Lists]

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

Re: Requiring environment variables

From: Mike Shal
Subject: Re: Requiring environment variables
Date: Mon, 28 Jan 2008 16:39:54 -0500

On 1/28/08, Yang Zhang <address@hidden> wrote:
> Does make have an equivalent to bash's `nounset`? This exits immediately
> with error if a variable or environment variable is unset. Thanks in
> advance.

I don't think there is a single specific command to do what you want,
but you can implement it like so:

ifeq ($(origin REQUIRED_VAR),undefined)
   $(error REQUIRED_VAR is not set)

You can read about the $(origin) command in the make manual to see if
you want to do something fancier than just check for 'undefined'.


reply via email to

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