Some of GNU make's Implicit Rules
This is an edited excerpt from the info documentation for GNU
make.
Catalogue of Implicit Rules
===========================
Here is a catalogue of predefined implicit rules which are always
available unless the makefile explicitly overrides or cancels them. The
`-r' or `--no-builtin-rules' option cancels all predefined rules.
Not all of these rules will always be defined, even when the `-r'
option is not given. Many of the predefined implicit rules are
implemented in `make' as suffix rules, so which ones will be defined
depends on the "suffix list" (the list of dependencies of the special
target `.SUFFIXES'). The default suffix list is: `.out', `.a', `.ln',
`.o', `.c', `.cc', `.C', `.p', `.f', `.F', `.r', `.y', `.l', `.s',
`.S', `.mod', `.sym', `.def', `.h', `.info', `.dvi', `.tex',
`.texinfo', `.texi', `.txinfo', `.w', `.ch' `.web', `.sh', `.elc',
`.el'. All of the implicit rules described below whose dependencies
have one of these suffixes are actually suffix rules. If you modify
the suffix list, the only predefined suffix rules in effect will be
those named by one or two of the suffixes that are on the list you
specify; rules whose suffixes fail to be on the list are disabled.
Compiling C programs
`N.o' is made automatically from `N.c' with a command of the form
`$(CC) -c $(CPPFLAGS) $(CFLAGS)'.
Compiling C++ programs
`N.o' is made automatically from `N.cc' or `N.C' with a command of
the form `$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)'. We encourage you to
use the suffix `.cc' for C++ source files instead of `.C'.
Assembling and preprocessing assembler programs
`N.o' is made automatically from `N.s' by running the assembler,
`as'. The precise command is `$(AS) $(ASFLAGS)'.
`N.s' is made automatically from `N.S' by running the C
preprocessor, `cpp'. The precise command is `$(CPP) $(CPPFLAGS)'.
Linking a single object file
`N' is made automatically from `N.o' by running the linker
(usually called `ld') via the C compiler. The precise command
used is `$(CC) $(LDFLAGS) N.o $(LDLIBS)'.
This rule does the right thing for a simple program with only one
source file. It will also do the right thing if there are multiple
object files (presumably coming from various other source files),
one of which has a name matching that of the executable file.
In more complicated cases, such as when there is no object file
whose name derives from the executable file name, you must write
an explicit command for linking.
RCS
Any file `N' is extracted if necessary from an RCS file named
either `N,v' or `RCS/N,v'. The precise command used is `$(CO)
$(COFLAGS)'. `N' will not be extracted from RCS if it already
exists, even if the RCS file is newer. The rules for RCS are
terminal, so RCS files cannot be generated from another source;
they must actually exist.
Christopher Vickery
Computer Science Department
Queens College of CUNY