Changeset View
Standalone View
share/mk/bsd.README
Show First 20 Lines • Show All 307 Lines • ▼ Show 20 Lines | |||||
LDFLAGS Additional loader flags. Passed to the loader via CC, | LDFLAGS Additional loader flags. Passed to the loader via CC, | ||||
since that's used to link programs as well, so loader | since that's used to link programs as well, so loader | ||||
specific flags need to be prefixed with -Wl, to work. | specific flags need to be prefixed with -Wl, to work. | ||||
LIBADD Additional libraries. This is for base system libraries | LIBADD Additional libraries. This is for base system libraries | ||||
and is only valid inside of the /usr/src tree. | and is only valid inside of the /usr/src tree. | ||||
Rather than use LDADD=-lname use LIBADD=name. | Rather than use LDADD=-lname use LIBADD=name. | ||||
LINKS The list of binary links; should be full pathnames, the | LINKS List of hard links. See bsd.links.mk for more details. | ||||
bdrewery: This file is supposed to be an easy reference for developers. I would prefer not pointing them… | |||||
Done Inline ActionsPlease see my other comment along these lines. I meant to point to the section (below) that describes bsd.links.mk , not the file itself. ngie: Please see my other comment along these lines. I meant to point to the section (below) that… | |||||
linked-to file coming first, followed by the linked | |||||
file. The files are hard-linked. For example, to link | |||||
/bin/test and /bin/[, use: | |||||
LINKS= /bin/test /bin/[ | |||||
MAN Manual pages. If no MAN variable is defined, | MAN Manual pages. If no MAN variable is defined, | ||||
"MAN=${PROG}.1" is assumed. See bsd.man.mk for more details. | "MAN=${PROG}.1" is assumed. See bsd.man.mk for more details. | ||||
MLINKS List of manual page links. See bsd.man.mk for more details. | |||||
PROG The name of the program to build. If not supplied, nothing | PROG The name of the program to build. If not supplied, nothing | ||||
is built. | is built. | ||||
PROGNAME The name that the above program will be installed as, if | PROGNAME The name that the above program will be installed as, if | ||||
different from ${PROG}. | different from ${PROG}. | ||||
PROG_CXX If defined, the name of the program to build. Also | PROG_CXX If defined, the name of the program to build. Also | ||||
causes <bsd.prog.mk> to link the program with the | causes <bsd.prog.mk> to link the program with the | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | STRIP The flag passed to the install program to cause the binary | ||||
to be stripped. This is to be used when building your | to be stripped. This is to be used when building your | ||||
own install script so that the entire system can be made | own install script so that the entire system can be made | ||||
stripped/not-stripped using a single nob. | stripped/not-stripped using a single nob. | ||||
SUBDIR A list of subdirectories that should be built as well. | SUBDIR A list of subdirectories that should be built as well. | ||||
Each of the targets will execute the same target in the | Each of the targets will execute the same target in the | ||||
subdirectories. | subdirectories. | ||||
SYMLINKS List of symbolic links. See bsd.links.mk for more details. | |||||
The include file <bsd.prog.mk> includes the file named "../Makefile.inc" | The include file <bsd.prog.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.links.mk> and <bsd.man.mk>. | ||||
Some simple examples: | Some simple examples: | ||||
To build foo from foo.c with a manual page foo.1, use: | To build foo from foo.c with a manual page foo.1, use: | ||||
PROG= foo | PROG= foo | ||||
.include <bsd.prog.mk> | .include <bsd.prog.mk> | ||||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | |||||
LIBRARIES_ONLY Do not build or install files other than the library. | LIBRARIES_ONLY Do not build or install files other than the library. | ||||
LIB_CXX The name of the library to build. It also causes | LIB_CXX The name of the library to build. It also causes | ||||
<bsd.lib.mk> to link the library with the | <bsd.lib.mk> to link the library with the | ||||
standard C++ library. LIB_CXX overrides the value | standard C++ library. LIB_CXX overrides the value | ||||
of LIB if LIB is also set. Both a shared and static library | of LIB if LIB is also set. Both a shared and static library | ||||
will be built. NO_PIC can be set to only build a static | will be built. NO_PIC can be set to only build a static | ||||
library. | library. | ||||
LINKS List of hard links. See bsd.links.mk for more details. | |||||
Done Inline ActionsMLINKS? rgrimes: MLINKS? | |||||
LINTLIBDIR Target directory for lint libraries. | LINTLIBDIR Target directory for lint libraries. | ||||
MAN The manual pages to be installed. See bsd.man.mk for more | MAN The manual pages to be installed. See bsd.man.mk for more | ||||
details. | details. | ||||
MLINKS List of manual page links. See bsd.man.mk for more details. | |||||
SHLIB Like LIB but only builds a shared library. | SHLIB Like LIB but only builds a shared library. | ||||
SHLIB_CXX Like LIB_CXX but only builds a shared library. | SHLIB_CXX Like LIB_CXX but only builds a shared library. | ||||
SHLIB_LDSCRIPT Template file to generate shared library linker script. | SHLIB_LDSCRIPT Template file to generate shared library linker script. | ||||
Unless used, a simple symlink is created to the real | Unless used, a simple symlink is created to the real | ||||
shared object. | shared object. | ||||
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.) | versions of make.) | ||||
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.links.mk> and <bsd.man.mk>. | ||||
It has rules for building profiled objects; profiled libraries are | It has rules for building profiled objects; profiled libraries are | ||||
built by default. | built by default. | ||||
Libraries are ranlib'd before installation. | Libraries are ranlib'd before installation. | ||||
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |||||
The include file <bsd.links.mk> is included by bsd.*.mk snippets that have | |||||
included bsd.init.mk. At the time of writing, this includes bsd.lib.mk and | |||||
bsd.prog.mk. bsd.links.mk contains business logic for creating hardlinks | |||||
and symlinks for install targets. | |||||
bsd.links.mk does not have any user-exposed targets, but instead builds on | |||||
the `realinstall` target provided by bsd.subdir.mk and bsd.sys.mk. It should | |||||
be invoked via the `install` target. | |||||
LINKS The list of binary links; should be full pathnames, the | |||||
linked-to file coming first, followed by the linked | |||||
file. The files are hard-linked. For example, to link | |||||
/bin/test and /bin/[, use: | |||||
LINKS= /bin/test /bin/[ | |||||
Done Inline Actions${DESTDIR} should never appear in LINKS, this is added by the .mk files in the proper places. rgrimes: ${DESTDIR} should never appear in LINKS, this is added by the .mk files in the proper places. | |||||
Done Inline ActionsUgh, you're right. The other example I copy-pasted from was faulty. ngie: Ugh, you're right. The other example I copy-pasted from was faulty. | |||||
SYMLINKS The list of symlinks; should be full pathnames, the | |||||
symlinked-to file coming first, followed by the symlinked | |||||
file. The files are symbolic-linked. For example, to | |||||
symlink /bin/[ to ./test using relative paths, use: | |||||
SYMLINKS= test /bin/[ | |||||
Done Inline Actions${DESTDIR} should never appear in SYMLINKS=, this is added by the .mk files in the proper places rgrimes: ${DESTDIR} should never appear in SYMLINKS=, this is added by the .mk files in the proper places | |||||
Done Inline ActionsI disagree. I'll note that either relative or absolute forms or allowed. ngie: I disagree. I'll note that either relative or absolute forms or allowed. | |||||
Done Inline ActionsYou can disagree but you will be wrong. You can prove this yourself with a simple find/xargs/grep, please take the time to do so. rgrimes: You can disagree but you will be wrong. You can prove this yourself with a simple… | |||||
Done Inline ActionsI overlooked the DESTDIR prefixing. You were right, my brain earlier today was wrong. I'll fix this. ngie: I overlooked the DESTDIR prefixing. You were right, my brain earlier today was wrong. I'll fix… | |||||
Alternatively, to symlink /bin/{ to /bin/test using absolute | |||||
paths, use: | |||||
SYMLINKS= /bin/test /bin/[ | |||||
Done Inline ActionsSame issue. Are you confusing DESTDIR with BINDIR? No as then these strings would be The more normalized forms of these would actually be ${BINDIR}/${PROG} /path/to/alias rgrimes: Same issue. Are you confusing DESTDIR with BINDIR? No as then these strings would be… | |||||
Done Inline ActionsBleh, you're right--the target is prefixed with ${DESTDIR} automatically (I accidentally glossed over that fact): 25 .for s t in ${SYMLINKS} 26 @${ECHO} "${t} -> ${s}" ;\ 27 ${INSTALL_SYMLINK} ${TAG_ARGS} ${s} ${DESTDIR}/${t} 28 .endfor Thank you for finding that error. ngie: Bleh, you're right--the target is prefixed with ${DESTDIR} automatically (I accidentally… | |||||
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | ||||
The include file <bsd.test.mk> handles building one or more test programs | The include file <bsd.test.mk> handles building one or more test programs | ||||
intended to be used in the FreeBSD Test Suite under /usr/tests/. | intended to be used in the FreeBSD Test Suite under /usr/tests/. | ||||
It has seven targets: | It has seven targets: | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |
This file is supposed to be an easy reference for developers. I would prefer not pointing them at many other files, especially ones where there is 0 documentation in them. I don't see why existing documentation is removed and replaced with none.