Managing file interactions with make

Implicit rules

make 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:

Object file

C source file

SCCS C source file

yacc C source grammar

SCCS yacc C source grammar

lex C source grammar

SCCS lex C source grammar

Assembler source file

SCCS assembler source file

Shell file

SCCS shell file

Header file

SCCS header file

FORTRAN source file

SCCS FORTRAN source file

C++ source file

SCCS C++ source file

yacc C++ source grammar

SCCS yacc C++ source grammar

lex C++ source grammar

SCCS lex C++ source grammar

GREEK SMALL LETTER MUA summarizes 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 description.

Summary of default transformation path

If the file x.o is needed and an x.c is found in the description or directory, the x.o file would be compiled. If there is also an x.l, that source file would be run through lex before compiling the result. However, if there is no x.c but there is an x.l, make would discard the intermediate C language file and use the direct link as shown in GREEK SMALL LETTER MUA.

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. The compiler names are the macros AS, CC, C++C, F77, YACC, and LEX. The command

   $ make CC=newcc
will cause the newcc command to be used instead of the usual C language compiler. The macros CFLAGS, YFLAGS, LFLAGS, ASFLAGS, FFLAGS, and C++FLAGS may be set to cause these commands to be issued with optional flags. Thus
   $ make CFLAGS=-g
causes the cc command to include debugging information.
Next topic: Archive libraries
Previous topic: Suffixes and transformation rules

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004