[Top][All Lists]

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

Re: VPATH and prerequisites

From: Paul D. Smith
Subject: Re: VPATH and prerequisites
Date: Sun, 30 Apr 2006 13:38:58 -0400

%% Joost Leeuwesteijn <address@hidden> writes:

  jl> You can check if make is run from the root directory by including a 
  jl> first/default rule in the dir1 makefile that stops the build. Something 
  jl> like:
  jl> ----------------------------------------
  jl> .PHONY : dir1_default_rule
  jl> dir1_default_rule :
  jl>       echo "ERROR: only run the toplevel makefile"
  jl>       <not sure what's the best way to bail out (exit 1?, $$(error ...)>

  jl> and/or check on a variable that must be set by the toplevel makefile and 
  jl> call $(error ...)
  jl> ----------------------------------------

You could instead check the MAKELEVEL variable to see whether this is
the top-level make, or a recursive invocation.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

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