DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
make

Implicit rules

The make program uses a table of suffixes and a set of transformation rules to supply default dependency information and implied commands. The default suffix list (in order) is as follows:


.o
object file

.c
C source file

.c~
SCCS C source file

.y
yacc C source grammar

.y~
SCCS yacc C source grammar

.l
lex C source grammar

.l~
SCCS lex C source grammar

.s
assembler source file

.s~
SCCS assembler source file

.sh
shell file

.sh~
SCCS shell file

.h
header file

.h~
SCCS header file

.C
C++ source file

.C~
SCCS C++ source file

.Y
yacc C++ source grammar

.Y~
SCCS yacc C++ source grammar

.L
lex C++ source grammar

.L~
SCCS lex C++ source grammar

.f
FORTRAN source file

.f~
SCCS FORTRAN source file

See ``Summary of default transformation path'' for a summary of the default transformation paths. If there are two paths connecting a pair of suffixes, the longer one is used only if the intermediate file exists or is named in the makefile.

Summary of default transformation path

If the file x.o is needed and an x.c is found in the makefile directory, the x.c would be compiled. If there is an x.l and an x.c file and the x.l has been modified (that is, has a later modification date than the x.c), then make runs lex on the x.l file to re-create the x.c file. Otherwise, just the x.c file would be recompiled to produce the x.o file. However, if there is no x.c but there is an x.l, make uses the direct link as shown in ``Summary of default transformation path''

It is possible to change the names of some of the compilers used in the default or the flag arguments with which they are invoked by knowing the macro names used. AS, CC, CCC, F77, YACC, and LEX are the macro names of the compilers used by make. By specifically changing a compiler macro, a programmer can select which compiler is to be used. For example:

make CC=newcc

This causes the newcc command to be used instead of the usual C language compiler. The macros ASFLAGS, CFLAGS, CCFLAGS, F77FLAGS, YFLAGS, and LFLAGS can be set to cause these commands to be issued with optional flags. For example:

make "CFLAGS=-g"

This causes the cc command to include debugging information.


Next topic: Archive libraries
Previous topic: Suffixes and transformation rules

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003