DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Managing file interactions with make

The null suffix

There are many programs that consist of a single source file. make handles this case by the null suffix rule. Thus, to maintain the UNIX system program cat, a rule in the makefile of the following form is needed:

   .c:
           $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
In fact, this .c: rule is internally defined so no makefile is necessary at all. The user only needs to enter
   $ make cat dd echo date
(these are all UNIX system single-file programs) and all four C language source files are passed through the above shell command line associated with the .c: rule. The internally defined single suffix rules are


.c:
.c~:
.s:
.s~:

.sh:
.sh~:
.f:

.f~:
.C:
.C~:

Others may be added in the makefile by the user.


Next topic: Included files
Previous topic: Source code control system file names

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