Why does bsd.port.mk override make's search for Makefiles...?

Chuck Swiger cswiger at mac.com
Fri Jul 9 10:37:28 PDT 2004

Will Andrews wrote:
> On Fri, Jul 09, 2004 at 12:47:46PM -0400, Chuck Swiger wrote:
>>.if defined(MAKEFILE)
> You did not read the PR referenced.  We're completely serious.

Hmm, you're right.  OK, I am more literate now, and I believe I understand the 
problem mentioned in the PR, I'm just not sure I agree with renaming MAKEFILE 
to MAKE_FILE everywhere.

"man make" doesn't seem to document that variable being used:

      The make utility uses the following environment variables, if they exist:

...and GNU make seems to prefer MAKEFILES instead (from "info make"):

The Variable `MAKEFILES'

    If the environment variable `MAKEFILES' is defined, `make' considers
its value as a list of names (separated by whitespace) of additional
makefiles to be read before the others.  This works much like the
`include' directive: various directories are searched for those files
(*note Including Other Makefiles: Include.).  In addition, the default
goal is never taken from one of these makefiles and it is not an error
if the files listed in `MAKEFILES' are not found.

    The main use of `MAKEFILES' is in communication between recursive
invocations of `make' (*note Recursive Use of `make': Recursion.).  It
usually is not desirable to set the environment variable before a
top-level invocation of `make', because it is usually better not to
mess with a makefile from outside.  However, if you are running `make'
without a specific makefile, a makefile in `MAKEFILES' can do useful
things to help the built-in implicit rules work better, such as
defining search paths (*note Directory Search::).


...so which standard do we want to choose from?  :-)  Does POSIX say anything 
(useful) about what make should do with regard to $MAKEFILE...?


More information about the freebsd-ports mailing list