[Top][All Lists]

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

Re: Modify $PATH for all subdirectories

From: Ralf Wildenhues
Subject: Re: Modify $PATH for all subdirectories
Date: Thu, 7 Apr 2011 08:29:01 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

Hello Justin,

* Too, Justin A. wrote on Wed, Apr 06, 2011 at 10:45:06PM CEST:
> An executable is generated during 'make' in a directory called
> scripts/test/install/bin. This executable is used during the
> "check-local" rules in all of the's. In the top-level
>, how can I accomplish something like "export
> PATH=`pwd`/scripts/test/install/bin:$PATH" so the executable will be
> available to the "check-local" rules (where would I include this)? Or
> is there a better way to accomplish this?

There are several possible answers to this.

If your project requires GNU make, you can probably just write
  export PATH := $(shell echo `pwd`/scripts/test/install/bin:${PATH})

  export PATH := ${PWD}/scripts/test/install/bin:${PATH}

in the toplevel (untested).  But that won't work with
other makes.  With make 3.81 or newer, you can even limit that to
the check target by putting the above as a target-specific flag if
that is really necessary.

If all your tests use one of the Automake test drivers, you can use
  TESTS_ENVIRONMENT = PATH=$(top_builddir)/scripts/test/install/bin:$$PATH; 
export PATH;

but that won't help for check-local rules that invoke other test
drivers.  (Autotest has a similar feature, see 'info Autoconf --index
AUTOTEST_PATH' or the description for the atlocal file.)

It is also possible to change macros during the make recursion step
by messing with AM_MAKEFLAGS.  E.g., your toplevel could

 AM_MAKEFLAGS = PATH=`pwd`/scripts/test/install/bin:${PATH}

Hope that helps.


reply via email to

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