help-make
[Top][All Lists]
Advanced

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

Re: VPATH, pattern rules and building from any directory.


From: Oleksandr Gavenko
Subject: Re: VPATH, pattern rules and building from any directory.
Date: Wed, 24 Oct 2012 23:33:05 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

On 2012-10-24, Oleksandr Gavenko wrote:

> and all build artefacts has been placed at current dir. Another benefits I
> can change build dir (like this like usual proprietary standard for
> dev-projects, but little trick required to create this dir if it does not
> exist):
>
>   $ cat Makefile
>
>   ifeq '' '${B}'
>     B := $(abspath .)/
>   else
>     $(shell mkdir -p ${B})
>   endif
>
>   $ make B=_build/

I fix above code for production use:

  B := $(abspath .)/
  ifeq '' '$(filter %/,${B})'
    $(error B value must end with slash but actually is '${B}')
  endif
  ifeq '' '$(wildcard ${B})'
    $(shell mkdir -p ${B})
  endif

It handle case when user set B without trailing slash and dynamically create
non-existing dir.

-- 
Best regards!




reply via email to

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