HP-UX Reference (11i v3 07/02) - 1 User Commands A-M (vol 1)
m
make(1) make(1)
is used each time a makefile is executed, the line:
SHELL=/usr/bin/sh
or a suitable equivalent should be put in the macro definition section of the makefile.
Suffixes
Target and/or dependent names often have suffixes. Knowledge about certain suffixes is built into
make
and used to identify appropriate inference rules to be applied to update a target (see the subsection on
Inference Rules). The current default list of suffixes is:
.o .c .c˜ .C .C˜ .cxx .cxx˜ .cpp .cpp˜ .cc .cc˜
.y .y˜ .l .l˜ .L .L˜ .Y .Y˜ .s .s˜ .sh .sh˜
.h .h˜ .H .H˜ .p .p˜ .f .f˜ .r .r˜
These suffixes are defined as the dependents of the special built-in target
.SUFFIXES. This is done
automatically by
make.
Additional suffixes can be specified in a makefile as the dependents list for
.SUFFIXES. These additional
values are added to the default values. Multiple suffix lists accumulate. The order of the suffix list is
significant (see the Inference Rules subsection). If the user wishes to change the order of the suffixes, he
must first define
.SUFFIXES with a null dependent list, which clears the current value for
.SUFFIXES,
and then define
.SUFFIXES with the suffixes in the desired order. The list of suffixes built into
make on
any machine can be displayed by:
make -fp - 2>/dev/null </dev/null
The list of built-in suffixes incorporated with the definitions in a given makefile called
mymakefile can be
displayed by:
make -fp mymakefile 2>/dev/null </dev/null
Inference Rules
Certain target or dependent names (such as those ending with .o) have inferable dependents such as
.c
and .s, etc. If no update commands for such a name appear in the makefile, and if an inferable dependent
file exists, that dependent file is compiled to update the target. In this case, make
has inference rules that
allow building files from other files by examining the suffixes and determining an appropriate inference rule
to use. There are currently default inference rules defined for:
Single Suffix Rules
.c .c˜
.C .C˜ .cxx .cxx˜ .cpp .cpp˜ .cc .cc˜
.sh .sh˜
.p .p˜
.f .f˜
.r .r˜
Double Suffix Rules
.c.o .c˜.o .c˜.c .c.a .c˜.a
.C.o .C˜.o .C˜.C .C.a .C˜.a
.cxx.o .cxx˜.o .cxx˜.cxx .cxx.a .cxx˜.a
.cpp.o .cpp˜.o .cpp˜.cpp .cpp.a .cpp˜.a
.cc.o .cc˜.o .cc˜.cc .cc.a .cc˜.a
.s.o .s˜.o .s˜.a
.p.o .p˜.o .p˜.p .p.a .p˜.a
.f.o .f˜.o .f˜.f .f.a .f˜.a
.r.o .r˜.o .r˜.r .r.a .r˜.a
.y.o .y˜.o .y.c .y˜.c
.l.o .l˜.o .l.c
.h˜.h .H˜.H .hxx˜.hxx .hpp˜.hpp
.C.o .C˜.o .C.a .C˜.a
.L.C .L.o .L˜.C .L˜.L .L˜.o
.Y.C .Y.o .Y˜.C .Y˜.Y .Y˜.o
Double suffix inference rules (.c.o) define how to build x.o from x.c. Single suffix inference rules (.c)
define how to build x from x.c. In effect, the first suffix is null. Single suffix rules are useful for building
targets from only one source file; e.g., shell procedures and simple C programs.
HP-UX 11i Version 3: February 2007 − 5 − Hewlett-Packard Company 639