version 1.67, 2017/07/05 10:41:01 |
version 1.68, 2017/07/09 17:17:46 |
|
|
|
|
a= bar |
a= bar |
|
|
the command "make b" will echo "foo"; echo "bar". The first $(a) means |
the command "make b" will echo "foo"; echo "bar". The first $(a) means |
"foo", because it's needed to generate the dependency rule when it's read, |
"foo", because it's needed to generate the dependency rule when it's read, |
but the second $(a) is only expanded when needed, at which point a contains |
but the second $(a) is only expanded when needed, at which point a contains |
bar. |
bar. |
|
|
|
|
count.) |
count.) |
|
|
Dependencies are handled using the compiler's -M* options, resulting in |
Dependencies are handled using the compiler's -M* options, resulting in |
lots of .d files. These are manually included through bsd.dep.mk. |
lots of .d files. These are manually included through <bsd.dep.mk>. |
|
|
|
<bsd.dep.mk> also provides an empty depend target to <bsd.prog.mk> and |
|
<bsd.lib.mk>, for backward compatibility. |
|
|
The variable DESTDIR works as before. It's not set anywhere but will change |
The variable DESTDIR works as before. It's not set anywhere but will change |
the tree where the file gets installed. |
the tree where the file gets installed. |
|
|
|
|
linked-to file must come first, the linked file second, |
linked-to file must come first, the linked file second, |
and there may be multiple pairs. The files are soft-linked. |
and there may be multiple pairs. The files are soft-linked. |
|
|
BEFOREMAN List of extra targets that must be already built before the |
BEFOREMAN List of extra targets that must be already built before the |
man target can be run. Those targets must be real files (and |
man target can be run. Those targets must be real files (and |
not .PHONY targets). |
not .PHONY targets). |
|
|
|
|
more source files, along with their manual pages. It has a limited number |
more source files, along with their manual pages. It has a limited number |
of suffixes, consistent with the current needs of the BSD tree. |
of suffixes, consistent with the current needs of the BSD tree. |
|
|
It has seven targets: |
It has six targets: |
|
|
all: |
all: |
build the program and its manual page |
build the program and its manual page |
|
|
cleandir: |
cleandir: |
remove all of the files removed by the target clean, as |
remove all of the files removed by the target clean, as |
well as .depend, tags, and any manual pages. |
well as .depend, tags, and any manual pages. |
depend: |
|
Misnomer as dependencies are built on-the-fly during make all. |
|
No longer used in normal builds. |
|
includes: |
includes: |
install any header files. |
install any header files. |
install: |
install: |
|
|
|
|
SRCS= a.c b.c c.c d.c |
SRCS= a.c b.c c.c d.c |
|
|
|
SRCS may contain lex and yacc files, in which case the framework will |
|
convert these files to C and header files first, before building anything |
|
else. |
|
|
|
SRCS may contain C++ files, in which case the C++ compiler will be used |
|
for linking. |
|
|
|
If YFLAGS contains -d, the header file will be named like the C file, |
|
and a proper rule tying both together will be generated. For instance, if |
|
SRCS contains grammar.y, then effectively you will have |
|
|
|
grammar.c grammar.h: grammar.y |
|
${YACC.Y} -o grammar.c grammar.y |
|
|
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
|
|
The include file <bsd.subdir.mk> contains the default targets for building |
The include file <bsd.subdir.mk> contains the default targets for building |
subdirectories. It has the same seven targets as <bsd.prog.mk>: all, |
subdirectories. It has the same six targets as <bsd.prog.mk>: all, |
clean, cleandir, depend, includes, install, and tags. For all of |
clean, cleandir, includes, install, and tags. For all of |
the directories listed in the variable SUBDIR, the specified directory |
the directories listed in the variable SUBDIR, the specified directory |
will be visited and the target made. There is also a default target which |
will be visited and the target made. There is also a default target which |
allows the command "make subdir" where subdir is any directory listed in |
allows the command "make subdir" where subdir is any directory listed in |
the variable SUBDIR. |
the variable SUBDIR. |
|
|
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
|
|
The include file <bsd.lib.mk> has support for building libraries. It has |
The include file <bsd.lib.mk> has support for building libraries. It has |
the same seven targets as <bsd.prog.mk>: all, clean, cleandir, depend, |
the same seven targets as <bsd.prog.mk>: all, clean, cleandir, |
includes, install, and tags. It has a limited number of suffixes, |
includes, install, and tags. It has a limited number of suffixes, |
consistent with the current needs of the BSD tree. |
consistent with the current needs of the BSD tree. |
|
|
|
|
SRCS List of source files to build the library. Suffix types |
SRCS List of source files to build the library. Suffix types |
.s, .c, and .f are supported. Note, .s files are preferred |
.s, .c, and .f are supported. Note, .s files are preferred |
to .c files of the same name. (This is not the default for |
to .c files of the same name. (This is not the default for |
versions of make.) |
POSIX make without bsd.lib.mk). |
|
|
|
The same support for yacc and lex files as <bsd.prog.mk> |
|
is provided. |
|
|
The include file <bsd.lib.mk> includes the file named "../Makefile.inc" |
The include file <bsd.lib.mk> includes the file named "../Makefile.inc" |
if it exists, as well as the include file <bsd.man.mk>. |
if it exists, as well as the include file <bsd.man.mk>. |