help-make
[Top][All Lists]
Advanced

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

Re: Running one Makefile from another in an "isolated" way


From: Paul Smith
Subject: Re: Running one Makefile from another in an "isolated" way
Date: Tue, 27 Oct 2020 15:33:44 -0400
User-agent: Evolution 3.36.4-0ubuntu1

On Tue, 2020-10-27 at 13:56 +0300, Nikolay Shaplov wrote:
> How to reproduce. I am working with postgres sources, so download
> latest source, i.e. https://www.postgresql.org/ftp/source/v13.0/
> ./confiugre it and in some separate dir write a Makefile that runs
> make form the dir with the sources
> 
> all:
>         make -C /home/nataraj/test/make-ci/zzz/build/postgres

First you should never use plain "make" to invoke a recursive make.

You must always use $(MAKE) (or ${MAKE} if you prefer: they are
equivalent).

> and then run make, it will finish with "No such file or directory"
> error.

Sorry, are you saying that with a makefile containing the above rule
and NOTHING else, you get this behavior?  Or is that just one rule in a
larger makefile?

If the former I don't really see how that would happen.  Make doesn't
add or change any environment variables in the environment it receives
from its parent, when it invokes processes in the recipe.  The only
environment variable it modifies is MAKEFLAGS which shouldn't matter.

However we'd need more detail about how exactly the sub-make is failing
before we can understand what's happening here.

For example, you say the postgres make will "finish" with an error.
 Does that mean most of the build works?  What command is being invoked
when you get the "No such file or directory" error?  What is the
difference between that command when it works and when it fails?




reply via email to

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