=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/share/mk/bsd.README,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- src/share/mk/bsd.README 2017/07/05 10:41:01 1.67 +++ src/share/mk/bsd.README 2017/07/09 17:17:46 1.68 @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.README,v 1.67 2017/07/05 10:41:01 espie Exp $ +# $OpenBSD: bsd.README,v 1.68 2017/07/09 17:17:46 espie Exp $ # $NetBSD: bsd.README,v 1.17 1996/04/13 02:08:08 thorpej Exp $ # @(#)bsd.README 5.1 (Berkeley) 5/11/90 @@ -67,8 +67,8 @@ a= bar -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, +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, but the second $(a) is only expanded when needed, at which point a contains bar. @@ -81,8 +81,11 @@ count.) 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 . + also provides an empty depend target to and +, for backward compatibility. + The variable DESTDIR works as before. It's not set anywhere but will change the tree where the file gets installed. @@ -124,7 +127,7 @@ linked-to file must come first, the linked file second, 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 not .PHONY targets). @@ -252,7 +255,7 @@ more source files, along with their manual pages. It has a limited number of suffixes, consistent with the current needs of the BSD tree. -It has seven targets: +It has six targets: all: build the program and its manual page @@ -262,9 +265,6 @@ cleandir: remove all of the files removed by the target clean, as 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: install any header files. install: @@ -390,12 +390,26 @@ 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 contains the default targets for building -subdirectories. It has the same seven targets as : all, -clean, cleandir, depend, includes, install, and tags. For all of -the directories listed in the variable SUBDIR, the specified directory +subdirectories. It has the same six targets as : all, +clean, cleandir, includes, install, and tags. For all of +the directories listed in the variable SUBDIR, the specified directory 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 the variable SUBDIR. @@ -411,7 +425,7 @@ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= The include file has support for building libraries. It has -the same seven targets as : all, clean, cleandir, depend, +the same seven targets as : all, clean, cleandir, includes, install, and tags. It has a limited number of suffixes, consistent with the current needs of the BSD tree. @@ -437,7 +451,10 @@ SRCS List of source files to build the library. Suffix types .s, .c, and .f are supported. Note, .s files are preferred 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 + is provided. The include file includes the file named "../Makefile.inc" if it exists, as well as the include file .