Macros with Special Handling

CURDIR

The current working directory. Set by make but not used by it, for use in makefiles.

  

.LIBPATTERNS

Used for finding link library names as prerequisites of the form -l name. For each such prerequisite, make searches in the current directory, directories matching any vpath directives, directories named by the VPATH variable, /lib, /usr/lib, and prefix /lib, where prefix is the installation directory for GNU make (normally /usr/local).

The default value of .LIBPATTERNS is lib%.so lib%.a. Thus make first searches for a shared library file, and then for a regular archive library.

  

MAKE

The full pathname used to invoke make. It is special because command lines containing the string $(MAKE) or ${MAKE} are always executed, even when any of the -n, -q, or -t options are used.

  

MAKECMDGOALS

The targets given to make on the command line.

  

MAKEFILE_LIST

A list of makefiles read so far. The rightmost entry in the list is the name of the makefile currently being read.

  

MAKEFILES

Environment variable: make reads the whitespace-separated list of files named in it before reading any other makefiles.

  

MAKEFLAGS

Contains the flags inherited in the environment variable MAKEFLAGS, plus any command-line options. Used to pass the flags to subsequent invocations of make, usually via command lines in a makefile entry that contain $(MAKE).

  

MAKELEVEL

The depth of recursion (sub-make invocation). Primarily for use in conditional statements ...

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.