help-make
[Top][All Lists]
Advanced

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

Re: run checks which myy abort before build?: Pls review/show better way


From: Paul Smith
Subject: Re: run checks which myy abort before build?: Pls review/show better way.
Date: Tue, 06 Jun 2017 17:24:27 -0400

On Tue, 2017-06-06 at 16:07 -0500, address@hidden wrote:
> Works:
> 
>     SHELL = /bin/bash
>     STARTUP_CHECK_NOP := $(shell set -x;: Checking for FINALDESTDIR:;[[ -d 
> $(FINALDESTDIR) ]] || kill 0)
> 
> Is there a cleaner way?  The STARTUP_CHECK_NOP macro is liable to
> confuse a maintainer since it's value is never used.

It's helpful if you describe in words what you want to do.

If you're trying to fail immediately if a directory doesn't exist, you
can do something like this:

  $(if $(wildcard $(FINALDESTDIR)/.),,$(error $(FINALDESTDIR) does not exist))

This also uses only make constructs so is slightly more portable.



reply via email to

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