1*a34d5fb1SAntonio Huete Jimenez# $Id: README,v 1.2 2020/08/19 17:51:53 sjg Exp $ 25f1e34d9SAlexandre Perrin 35f1e34d9SAlexandre PerrinThis directory contains some macro's derrived from the NetBSD bsd.*.mk 45f1e34d9SAlexandre Perrinmacros. They have the same names but without the bsd., separate macro 55f1e34d9SAlexandre Perrinfiles are needed to ensure we can make them do what we want for 65f1e34d9SAlexandre Perrinbuiling things outside of /usr/src. Nearly all the comments below 75f1e34d9SAlexandre Perrinapply. 85f1e34d9SAlexandre Perrin 95f1e34d9SAlexandre Perrin# $NetBSD: bsd.README,v 1.18 1997/01/13 00:54:23 mark Exp $ 105f1e34d9SAlexandre Perrin# @(#)bsd.README 5.1 (Berkeley) 5/11/90 115f1e34d9SAlexandre Perrin 125f1e34d9SAlexandre PerrinThis is the README file for the new make "include" files for the BSD 135f1e34d9SAlexandre Perrinsource tree. The files are installed in /usr/share/mk, and are, by 145f1e34d9SAlexandre Perrinconvention, named with the suffix ".mk". 155f1e34d9SAlexandre Perrin 165f1e34d9SAlexandre PerrinNote, this file is not intended to replace reading through the .mk 175f1e34d9SAlexandre Perrinfiles for anything tricky. 185f1e34d9SAlexandre Perrin 195f1e34d9SAlexandre Perrin=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 205f1e34d9SAlexandre Perrin 215f1e34d9SAlexandre PerrinRANDOM THINGS WORTH KNOWING: 225f1e34d9SAlexandre Perrin 235f1e34d9SAlexandre PerrinThe files are simply C-style #include files, and pretty much behave like 245f1e34d9SAlexandre Perrinyou'd expect. The syntax is slightly different in that a single '.' is 255f1e34d9SAlexandre Perrinused instead of the hash mark, i.e. ".include <bsd.prog.mk>". 265f1e34d9SAlexandre Perrin 275f1e34d9SAlexandre PerrinOne difference that will save you lots of debugging time is that inclusion 285f1e34d9SAlexandre Perrinof the file is normally done at the *end* of the Makefile. The reason for 295f1e34d9SAlexandre Perrinthis is because .mk files often modify variables and behavior based on the 305f1e34d9SAlexandre Perrinvalues of variables set in the Makefile. To make this work, remember that 315f1e34d9SAlexandre Perrinthe FIRST target found is the target that is used, i.e. if the Makefile has: 325f1e34d9SAlexandre Perrin 335f1e34d9SAlexandre Perrin a: 345f1e34d9SAlexandre Perrin echo a 355f1e34d9SAlexandre Perrin a: 365f1e34d9SAlexandre Perrin echo a number two 375f1e34d9SAlexandre Perrin 385f1e34d9SAlexandre Perrinthe command "make a" will echo "a". To make things confusing, the SECOND 395f1e34d9SAlexandre Perrinvariable assignment is the overriding one, i.e. if the Makefile has: 405f1e34d9SAlexandre Perrin 415f1e34d9SAlexandre Perrin a= foo 425f1e34d9SAlexandre Perrin a= bar 435f1e34d9SAlexandre Perrin 445f1e34d9SAlexandre Perrin b: 455f1e34d9SAlexandre Perrin echo ${a} 465f1e34d9SAlexandre Perrin 475f1e34d9SAlexandre Perrinthe command "make b" will echo "bar". This is for compatibility with the 485f1e34d9SAlexandre Perrinway the V7 make behaved. 495f1e34d9SAlexandre Perrin 505f1e34d9SAlexandre PerrinIt's fairly difficult to make the BSD .mk files work when you're building 515f1e34d9SAlexandre Perrinmultiple programs in a single directory. It's a lot easier split up the 525f1e34d9SAlexandre Perrinprograms than to deal with the problem. Most of the agony comes from making 535f1e34d9SAlexandre Perrinthe "obj" directory stuff work right, not because we switch to a new version 545f1e34d9SAlexandre Perrinof make. So, don't get mad at us, figure out a better way to handle multiple 555f1e34d9SAlexandre Perrinarchitectures so we can quit using the symbolic link stuff. (Imake doesn't 565f1e34d9SAlexandre Perrincount.) 575f1e34d9SAlexandre Perrin 585f1e34d9SAlexandre PerrinThe file .depend in the source directory is expected to contain dependencies 595f1e34d9SAlexandre Perrinfor the source files. This file is read automatically by make after reading 605f1e34d9SAlexandre Perrinthe Makefile. 615f1e34d9SAlexandre Perrin 625f1e34d9SAlexandre PerrinThe variable DESTDIR works as before. It's not set anywhere but will change 635f1e34d9SAlexandre Perrinthe tree where the file gets installed. 645f1e34d9SAlexandre Perrin 655f1e34d9SAlexandre PerrinThe profiled libraries are no longer built in a different directory than 665f1e34d9SAlexandre Perrinthe regular libraries. A new suffix, ".po", is used to denote a profiled 675f1e34d9SAlexandre Perrinobject. 685f1e34d9SAlexandre Perrin 695f1e34d9SAlexandre Perrin=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 705f1e34d9SAlexandre Perrin 715f1e34d9SAlexandre PerrinThe include file <sys.mk> has the default rules for all makes, in the BSD 725f1e34d9SAlexandre Perrinenvironment or otherwise. You probably don't want to touch this file. 735f1e34d9SAlexandre Perrin 745f1e34d9SAlexandre Perrin=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 755f1e34d9SAlexandre Perrin 765f1e34d9SAlexandre PerrinThe include file <bsd.man.mk> handles installing manual pages and their 775f1e34d9SAlexandre Perrinlinks. 785f1e34d9SAlexandre Perrin 795f1e34d9SAlexandre PerrinIt has a single target: 805f1e34d9SAlexandre Perrin 815f1e34d9SAlexandre Perrin maninstall: 825f1e34d9SAlexandre Perrin Install the manual pages and their links. 835f1e34d9SAlexandre Perrin 845f1e34d9SAlexandre PerrinIt sets/uses the following variables: 855f1e34d9SAlexandre Perrin 865f1e34d9SAlexandre PerrinMANDIR Base path for manual installation. 875f1e34d9SAlexandre Perrin 885f1e34d9SAlexandre PerrinMANGRP Manual group. 895f1e34d9SAlexandre Perrin 905f1e34d9SAlexandre PerrinMANOWN Manual owner. 915f1e34d9SAlexandre Perrin 925f1e34d9SAlexandre PerrinMANMODE Manual mode. 935f1e34d9SAlexandre Perrin 945f1e34d9SAlexandre PerrinMANSUBDIR Subdirectory under the manual page section, i.e. "/vax" 955f1e34d9SAlexandre Perrin or "/tahoe" for machine specific manual pages. 965f1e34d9SAlexandre Perrin 975f1e34d9SAlexandre PerrinMAN The manual pages to be installed (use a .1 - .9 suffix). 985f1e34d9SAlexandre Perrin 995f1e34d9SAlexandre PerrinMLINKS List of manual page links (using a .1 - .9 suffix). The 1005f1e34d9SAlexandre Perrin linked-to file must come first, the linked file second, 1015f1e34d9SAlexandre Perrin and there may be multiple pairs. The files are soft-linked. 1025f1e34d9SAlexandre Perrin 1035f1e34d9SAlexandre PerrinThe include file <bsd.man.mk> includes a file named "../Makefile.inc" if 1045f1e34d9SAlexandre Perrinit exists. 1055f1e34d9SAlexandre Perrin 1065f1e34d9SAlexandre Perrin=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 1075f1e34d9SAlexandre Perrin 1085f1e34d9SAlexandre PerrinThe include file <bsd.own.mk> contains source tree configuration parameters, 1095f1e34d9SAlexandre Perrinsuch as the owners, groups, etc. for both manual pages and binaries, and 1105f1e34d9SAlexandre Perrina few global "feature configuration" parameters. 1115f1e34d9SAlexandre Perrin 1125f1e34d9SAlexandre PerrinIt has no targets. 1135f1e34d9SAlexandre Perrin 1145f1e34d9SAlexandre PerrinTo get system-specific configuration parameters, bsd.own.mk will try to 1155f1e34d9SAlexandre Perrininclude the file specified by the "MAKECONF" variable. If MAKECONF is not 1165f1e34d9SAlexandre Perrinset, or no such file exists, the system make configuration file, /etc/mk.conf 1175f1e34d9SAlexandre Perrinis included. These files may define any of the variables described below. 1185f1e34d9SAlexandre Perrin 1195f1e34d9SAlexandre Perrinbsd.own.mk sets the following variables, if they are not already defined 1205f1e34d9SAlexandre Perrin(defaults are in brackets): 1215f1e34d9SAlexandre Perrin 1225f1e34d9SAlexandre PerrinBSDSRCDIR The real path to the system sources, so that 'make obj' 1235f1e34d9SAlexandre Perrin will work correctly. [/usr/src] 1245f1e34d9SAlexandre Perrin 1255f1e34d9SAlexandre PerrinBSDOBJDIR The real path to the system 'obj' tree, so that 'make obj' 1265f1e34d9SAlexandre Perrin will work correctly. [/usr/obj] 1275f1e34d9SAlexandre Perrin 1285f1e34d9SAlexandre PerrinBINGRP Binary group. [bin] 1295f1e34d9SAlexandre Perrin 1305f1e34d9SAlexandre PerrinBINOWN Binary owner. [bin] 1315f1e34d9SAlexandre Perrin 1325f1e34d9SAlexandre PerrinBINMODE Binary mode. [555] 1335f1e34d9SAlexandre Perrin 1345f1e34d9SAlexandre PerrinNONBINMODE Mode for non-executable files. [444] 1355f1e34d9SAlexandre Perrin 1365f1e34d9SAlexandre PerrinMANDIR Base path for manual installation. [/usr/share/man/cat] 1375f1e34d9SAlexandre Perrin 1385f1e34d9SAlexandre PerrinMANGRP Manual group. [bin] 1395f1e34d9SAlexandre Perrin 1405f1e34d9SAlexandre PerrinMANOWN Manual owner. [bin] 1415f1e34d9SAlexandre Perrin 1425f1e34d9SAlexandre PerrinMANMODE Manual mode. [${NONBINMODE}] 1435f1e34d9SAlexandre Perrin 1445f1e34d9SAlexandre PerrinLIBDIR Base path for library installation. [/usr/lib] 1455f1e34d9SAlexandre Perrin 1465f1e34d9SAlexandre PerrinLINTLIBDIR Base path for lint(1) library installation. [/usr/libdata/lint] 1475f1e34d9SAlexandre Perrin 1485f1e34d9SAlexandre PerrinLIBGRP Library group. [${BINGRP}] 1495f1e34d9SAlexandre Perrin 1505f1e34d9SAlexandre PerrinLIBOWN Library owner. [${BINOWN}] 1515f1e34d9SAlexandre Perrin 1525f1e34d9SAlexandre PerrinLIBMODE Library mode. [${NONBINMODE}] 1535f1e34d9SAlexandre Perrin 1545f1e34d9SAlexandre PerrinDOCDIR Base path for system documentation (e.g. PSD, USD, etc.) 1555f1e34d9SAlexandre Perrin installation. [/usr/share/doc] 1565f1e34d9SAlexandre Perrin 1575f1e34d9SAlexandre PerrinDOCGRP Documentation group. [bin] 1585f1e34d9SAlexandre Perrin 1595f1e34d9SAlexandre PerrinDOCOWN Documentation owner. [bin] 1605f1e34d9SAlexandre Perrin 1615f1e34d9SAlexandre PerrinDOCMODE Documentation mode. [${NONBINMODE}] 1625f1e34d9SAlexandre Perrin 1635f1e34d9SAlexandre PerrinNLSDIR Base path for National Language Support files installation. 1645f1e34d9SAlexandre Perrin [/usr/share/nls] 1655f1e34d9SAlexandre Perrin 1665f1e34d9SAlexandre PerrinNLSGRP National Language Support files group. [bin] 1675f1e34d9SAlexandre Perrin 1685f1e34d9SAlexandre PerrinNLSOWN National Language Support files owner. [bin] 1695f1e34d9SAlexandre Perrin 1705f1e34d9SAlexandre PerrinNLSMODE National Language Support files mode. [${NONBINMODE}] 1715f1e34d9SAlexandre Perrin 1725f1e34d9SAlexandre PerrinSTRIP The flag passed to the install program to cause the binary 1735f1e34d9SAlexandre Perrin to be stripped. This is to be used when building your 1745f1e34d9SAlexandre Perrin own install script so that the entire system can be made 1755f1e34d9SAlexandre Perrin stripped/not-stripped using a single knob. [-s] 1765f1e34d9SAlexandre Perrin 1775f1e34d9SAlexandre PerrinCOPY The flag passed to the install program to cause the binary 1785f1e34d9SAlexandre Perrin to be copied rather than moved. This is to be used when 1795f1e34d9SAlexandre Perrin building our own install script so that the entire system 1805f1e34d9SAlexandre Perrin can either be installed with copies, or with moves using 1815f1e34d9SAlexandre Perrin a single knob. [-c] 1825f1e34d9SAlexandre Perrin 1835f1e34d9SAlexandre PerrinAdditionally, the following variables may be set by bsd.own.mk or in a 1845f1e34d9SAlexandre Perrinmake configuration file to modify the behaviour of the system build 1855f1e34d9SAlexandre Perrinprocess (default values are in brackets along with comments, if set by 1865f1e34d9SAlexandre Perrinbsd.own.mk): 1875f1e34d9SAlexandre Perrin 1885f1e34d9SAlexandre PerrinEXPORTABLE_SYSTEM 1895f1e34d9SAlexandre Perrin Do not build /usr/src/domestic, even if it is present. 1905f1e34d9SAlexandre Perrin 1915f1e34d9SAlexandre PerrinSKEY Compile in support for S/key authentication. [yes, set 1925f1e34d9SAlexandre Perrin unconditionally] 1935f1e34d9SAlexandre Perrin 1945f1e34d9SAlexandre PerrinKERBEROS Compile in support for Kerberos 4 authentication. 1955f1e34d9SAlexandre Perrin 1965f1e34d9SAlexandre PerrinKERBEROS5 Compile in support for Kerberos 5 authentication. 1975f1e34d9SAlexandre Perrin 1985f1e34d9SAlexandre PerrinMANZ Compress manual pages at installation time. 1995f1e34d9SAlexandre Perrin 2005f1e34d9SAlexandre PerrinSYS_INCLUDE Copy or symlink kernel include files into /usr/include. 2015f1e34d9SAlexandre Perrin Possible values are "symlinks" or "copies" (which is 2025f1e34d9SAlexandre Perrin the same as the variable being unset). 2035f1e34d9SAlexandre Perrin 2045f1e34d9SAlexandre PerrinNOPROFILE Do not build profiled versions of system libraries 2055f1e34d9SAlexandre Perrin 2065f1e34d9SAlexandre PerrinNOPIC Do not build PIC versions of system libraries, and 2075f1e34d9SAlexandre Perrin do not build shared libraries. [set if ${MACHINE_ARCH} 2085f1e34d9SAlexandre Perrin is "mips", "vax", "alpha" or "arm32", unset otherwise.] 2095f1e34d9SAlexandre Perrin 2105f1e34d9SAlexandre PerrinNOLINT Do not build lint libraries. [set, set unconditionally] 2115f1e34d9SAlexandre Perrin 2125f1e34d9SAlexandre Perrinbsd.own.mk is generally useful when building your own Makefiles so that 2135f1e34d9SAlexandre Perrinthey use the same default owners etc. as the rest of the tree. 2145f1e34d9SAlexandre Perrin 2155f1e34d9SAlexandre Perrin=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 2165f1e34d9SAlexandre Perrin 2175f1e34d9SAlexandre PerrinThe include file <bsd.prog.mk> handles building programs from one or 2185f1e34d9SAlexandre Perrinmore source files, along with their manual pages. It has a limited number 2195f1e34d9SAlexandre Perrinof suffixes, consistent with the current needs of the BSD tree. 2205f1e34d9SAlexandre Perrin 2215f1e34d9SAlexandre PerrinIt has eight targets: 2225f1e34d9SAlexandre Perrin 2235f1e34d9SAlexandre Perrin all: 2245f1e34d9SAlexandre Perrin build the program and its manual page 2255f1e34d9SAlexandre Perrin clean: 2265f1e34d9SAlexandre Perrin remove the program, any object files and the files a.out, 2275f1e34d9SAlexandre Perrin Errs, errs, mklog, and core. 2285f1e34d9SAlexandre Perrin cleandir: 2295f1e34d9SAlexandre Perrin remove all of the files removed by the target clean, as 2305f1e34d9SAlexandre Perrin well as .depend, tags, and any manual pages. 2315f1e34d9SAlexandre Perrin depend: 2325f1e34d9SAlexandre Perrin make the dependencies for the source files, and store 2335f1e34d9SAlexandre Perrin them in the file .depend. 2345f1e34d9SAlexandre Perrin includes: 2355f1e34d9SAlexandre Perrin install any header files. 2365f1e34d9SAlexandre Perrin install: 2375f1e34d9SAlexandre Perrin install the program and its manual pages; if the Makefile 2385f1e34d9SAlexandre Perrin does not itself define the target install, the targets 2395f1e34d9SAlexandre Perrin beforeinstall and afterinstall may also be used to cause 2405f1e34d9SAlexandre Perrin actions immediately before and after the install target 2415f1e34d9SAlexandre Perrin is executed. 2425f1e34d9SAlexandre Perrin lint: 2435f1e34d9SAlexandre Perrin run lint on the source files 2445f1e34d9SAlexandre Perrin tags: 2455f1e34d9SAlexandre Perrin create a tags file for the source files. 2465f1e34d9SAlexandre Perrin 2475f1e34d9SAlexandre PerrinIt sets/uses the following variables: 2485f1e34d9SAlexandre Perrin 2495f1e34d9SAlexandre PerrinBINGRP Binary group. 2505f1e34d9SAlexandre Perrin 2515f1e34d9SAlexandre PerrinBINOWN Binary owner. 2525f1e34d9SAlexandre Perrin 2535f1e34d9SAlexandre PerrinBINMODE Binary mode. 2545f1e34d9SAlexandre Perrin 2555f1e34d9SAlexandre PerrinCLEANFILES Additional files to remove for the clean and cleandir targets. 2565f1e34d9SAlexandre Perrin 2575f1e34d9SAlexandre PerrinCOPTS Additional flags to the compiler when creating C objects. 2585f1e34d9SAlexandre Perrin 2595f1e34d9SAlexandre PerrinHIDEGAME If HIDEGAME is defined, the binary is installed in 2605f1e34d9SAlexandre Perrin /usr/games/hide, and a symbolic link is created to 2615f1e34d9SAlexandre Perrin /usr/games/dm. 2625f1e34d9SAlexandre Perrin 2635f1e34d9SAlexandre PerrinLDADD Additional loader objects. Usually used for libraries. 2645f1e34d9SAlexandre Perrin For example, to load with the compatibility and utility 2655f1e34d9SAlexandre Perrin libraries, use: 2665f1e34d9SAlexandre Perrin 2675f1e34d9SAlexandre Perrin LDADD+=-lutil -lcompat 2685f1e34d9SAlexandre Perrin 2695f1e34d9SAlexandre PerrinLDFLAGS Additional loader flags. 2705f1e34d9SAlexandre Perrin 2715f1e34d9SAlexandre PerrinLINKS The list of binary links; should be full pathnames, the 2725f1e34d9SAlexandre Perrin linked-to file coming first, followed by the linked 2735f1e34d9SAlexandre Perrin file. The files are hard-linked. For example, to link 2745f1e34d9SAlexandre Perrin /bin/test and /bin/[, use: 2755f1e34d9SAlexandre Perrin 2765f1e34d9SAlexandre Perrin LINKS= ${DESTDIR}/bin/test ${DESTDIR}/bin/[ 2775f1e34d9SAlexandre Perrin 2785f1e34d9SAlexandre PerrinMAN Manual pages (should end in .1 - .9). If no MAN variable is 2795f1e34d9SAlexandre Perrin defined, "MAN=${PROG}.1" is assumed. 2805f1e34d9SAlexandre Perrin 2815f1e34d9SAlexandre PerrinPROG The name of the program to build. If not supplied, nothing 2825f1e34d9SAlexandre Perrin is built. 2835f1e34d9SAlexandre Perrin 2845f1e34d9SAlexandre PerrinSRCS List of source files to build the program. If PROG is not 2855f1e34d9SAlexandre Perrin defined, it's assumed to be ${PROG}.c. 2865f1e34d9SAlexandre Perrin 2875f1e34d9SAlexandre PerrinDPADD Additional dependencies for the program. Usually used for 2885f1e34d9SAlexandre Perrin libraries. For example, to depend on the compatibility and 2895f1e34d9SAlexandre Perrin utility libraries use: 2905f1e34d9SAlexandre Perrin 2915f1e34d9SAlexandre Perrin DPADD+=${LIBCOMPAT} ${LIBUTIL} 2925f1e34d9SAlexandre Perrin 2935f1e34d9SAlexandre Perrin The following libraries are predefined for DPADD: 2945f1e34d9SAlexandre Perrin 2955f1e34d9SAlexandre Perrin LIBC /lib/libc.a 2965f1e34d9SAlexandre Perrin LIBCOMPAT /usr/lib/libcompat.a 2975f1e34d9SAlexandre Perrin LIBCRYPT /usr/lib/libcrypt.a 2985f1e34d9SAlexandre Perrin LIBCURSES /usr/lib/libcurses.a 2995f1e34d9SAlexandre Perrin LIBDBM /usr/lib/libdbm.a 3005f1e34d9SAlexandre Perrin LIBDES /usr/lib/libdes.a 3015f1e34d9SAlexandre Perrin LIBL /usr/lib/libl.a 3025f1e34d9SAlexandre Perrin LIBKDB /usr/lib/libkdb.a 3035f1e34d9SAlexandre Perrin LIBKRB /usr/lib/libkrb.a 3045f1e34d9SAlexandre Perrin LIBKVM /usr/lib/libkvm.a 3055f1e34d9SAlexandre Perrin LIBM /usr/lib/libm.a 3065f1e34d9SAlexandre Perrin LIBMP /usr/lib/libmp.a 3075f1e34d9SAlexandre Perrin LIBPC /usr/lib/libpc.a 3085f1e34d9SAlexandre Perrin LIBPLOT /usr/lib/libplot.a 3095f1e34d9SAlexandre Perrin LIBRPC /usr/lib/sunrpc.a 3105f1e34d9SAlexandre Perrin LIBTERM /usr/lib/libterm.a 3115f1e34d9SAlexandre Perrin LIBUTIL /usr/lib/libutil.a 3125f1e34d9SAlexandre Perrin 3135f1e34d9SAlexandre PerrinSHAREDSTRINGS If defined, a new .c.o rule is used that results in shared 3145f1e34d9SAlexandre Perrin strings, using xstr(1). Note that this will not work with 3155f1e34d9SAlexandre Perrin parallel makes. 3165f1e34d9SAlexandre Perrin 3175f1e34d9SAlexandre PerrinSTRIP The flag passed to the install program to cause the binary 3185f1e34d9SAlexandre Perrin to be stripped. 3195f1e34d9SAlexandre Perrin 3205f1e34d9SAlexandre PerrinSUBDIR A list of subdirectories that should be built as well. 3215f1e34d9SAlexandre Perrin Each of the targets will execute the same target in the 3225f1e34d9SAlexandre Perrin subdirectories. 3235f1e34d9SAlexandre Perrin 3245f1e34d9SAlexandre PerrinThe include file <bsd.prog.mk> includes the file named "../Makefile.inc" 3255f1e34d9SAlexandre Perrinif it exists, as well as the include file <bsd.man.mk>. 3265f1e34d9SAlexandre Perrin 3275f1e34d9SAlexandre PerrinSome simple examples: 3285f1e34d9SAlexandre Perrin 3295f1e34d9SAlexandre PerrinTo build foo from foo.c with a manual page foo.1, use: 3305f1e34d9SAlexandre Perrin 3315f1e34d9SAlexandre Perrin PROG= foo 3325f1e34d9SAlexandre Perrin 3335f1e34d9SAlexandre Perrin .include <bsd.prog.mk> 3345f1e34d9SAlexandre Perrin 3355f1e34d9SAlexandre PerrinTo build foo from foo.c with a manual page foo.2, add the line: 3365f1e34d9SAlexandre Perrin 3375f1e34d9SAlexandre Perrin MAN= foo.2 3385f1e34d9SAlexandre Perrin 3395f1e34d9SAlexandre PerrinIf foo does not have a manual page at all, add the line: 3405f1e34d9SAlexandre Perrin 3415f1e34d9SAlexandre Perrin NOMAN= noman 3425f1e34d9SAlexandre Perrin 3435f1e34d9SAlexandre PerrinIf foo has multiple source files, add the line: 3445f1e34d9SAlexandre Perrin 3455f1e34d9SAlexandre Perrin SRCS= a.c b.c c.c d.c 3465f1e34d9SAlexandre Perrin 3475f1e34d9SAlexandre Perrin=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 3485f1e34d9SAlexandre Perrin 3495f1e34d9SAlexandre PerrinThe include file <bsd.subdir.mk> contains the default targets for building 3505f1e34d9SAlexandre Perrinsubdirectories. It has the same eight targets as <bsd.prog.mk>: all, 3515f1e34d9SAlexandre Perrinclean, cleandir, depend, includes, install, lint, and tags. For all of 3525f1e34d9SAlexandre Perrinthe directories listed in the variable SUBDIRS, the specified directory 3535f1e34d9SAlexandre Perrinwill be visited and the target made. There is also a default target which 3545f1e34d9SAlexandre Perrinallows the command "make subdir" where subdir is any directory listed in 3555f1e34d9SAlexandre Perrinthe variable SUBDIRS. 3565f1e34d9SAlexandre Perrin 3575f1e34d9SAlexandre Perrin=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 3585f1e34d9SAlexandre Perrin 3595f1e34d9SAlexandre PerrinThe include file <bsd.sys.mk> is used by <bsd.prog.mk> and 3605f1e34d9SAlexandre Perrin<bsd.lib.mk>. It contains overrides that are used when building 3615f1e34d9SAlexandre Perrinthe NetBSD source tree. For instance, if "PARALLEL" is defined by 3625f1e34d9SAlexandre Perrinthe program/library Makefile, it includes a set of rules for lex and 3635f1e34d9SAlexandre Perrinyacc that allow multiple lex and yacc targets to be built in parallel. 3645f1e34d9SAlexandre Perrin 3655f1e34d9SAlexandre Perrin=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 3665f1e34d9SAlexandre Perrin 3675f1e34d9SAlexandre PerrinThe include file <bsd.lib.mk> has support for building libraries. It has 3685f1e34d9SAlexandre Perrinthe same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend, 3695f1e34d9SAlexandre Perrinincludes, install, lint, and tags. It has a limited number of suffixes, 3705f1e34d9SAlexandre Perrinconsistent with the current needs of the BSD tree. 3715f1e34d9SAlexandre Perrin 3725f1e34d9SAlexandre PerrinIt sets/uses the following variables: 3735f1e34d9SAlexandre Perrin 3745f1e34d9SAlexandre PerrinLIB The name of the library to build. 3755f1e34d9SAlexandre Perrin 3765f1e34d9SAlexandre PerrinLIBDIR Target directory for libraries. 3775f1e34d9SAlexandre Perrin 3785f1e34d9SAlexandre PerrinLINTLIBDIR Target directory for lint libraries. 3795f1e34d9SAlexandre Perrin 3805f1e34d9SAlexandre PerrinLIBGRP Library group. 3815f1e34d9SAlexandre Perrin 3825f1e34d9SAlexandre PerrinLIBOWN Library owner. 3835f1e34d9SAlexandre Perrin 3845f1e34d9SAlexandre PerrinLIBMODE Library mode. 3855f1e34d9SAlexandre Perrin 3865f1e34d9SAlexandre PerrinLDADD Additional loader objects. 3875f1e34d9SAlexandre Perrin 3885f1e34d9SAlexandre PerrinMAN The manual pages to be installed (use a .1 - .9 suffix). 3895f1e34d9SAlexandre Perrin 3905f1e34d9SAlexandre PerrinSRCS List of source files to build the library. Suffix types 3915f1e34d9SAlexandre Perrin .s, .c, and .f are supported. Note, .s files are preferred 3925f1e34d9SAlexandre Perrin to .c files of the same name. (This is not the default for 3935f1e34d9SAlexandre Perrin versions of make.) 3945f1e34d9SAlexandre Perrin 3955f1e34d9SAlexandre PerrinThe include file <bsd.lib.mk> includes the file named "../Makefile.inc" 3965f1e34d9SAlexandre Perrinif it exists, as well as the include file <bsd.man.mk>. 3975f1e34d9SAlexandre Perrin 3985f1e34d9SAlexandre PerrinIt has rules for building profiled objects; profiled libraries are 3995f1e34d9SAlexandre Perrinbuilt by default. 4005f1e34d9SAlexandre Perrin 4015f1e34d9SAlexandre PerrinLibraries are ranlib'd when made. 402