Makefile revision 12166
12061Sjkh# 212166Sjkh# $Id: Makefile,v 1.66 1995/11/05 18:42:23 jfieber Exp $ 32061Sjkh# 42061Sjkh# Make command line options: 58854Srgrimes# -DCLOBBER will remove /usr/include and MOST of /usr/lib 62061Sjkh# -DMAKE_LOCAL to add ./local to the SUBDIR list 72061Sjkh# -DMAKE_PORTS to add ./ports to the SUBDIR list 83197Scsgr# -DMAKE_EBONES to build eBones (KerberosIV) 93197Scsgr# 102061Sjkh# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir 112160Scsgr# -DNOCRYPT will prevent building of crypt versions 122834Swollman# -DNOLKM do not build loadable kernel modules 132061Sjkh# -DNOOBJDIR do not run ``${MAKE} obj'' 142061Sjkh# -DNOPROFILE do not build profiled libraries 152160Scsgr# -DNOSECURE do not go into secure subdir 161594Srgrimes 172061Sjkh# Put initial settings here. 182061SjkhSUBDIR= 191594Srgrimes 207407Srgrimes# We must do include and lib first so that the perl *.ph generation 217407Srgrimes# works correctly as it uses the header files installed by this. 227108Sphk.if exists(include) 237108SphkSUBDIR+= include 247108Sphk.endif 257407Srgrimes.if exists(lib) 267407SrgrimesSUBDIR+= lib 277407Srgrimes.endif 287108Sphk 292061Sjkh.if exists(bin) 302061SjkhSUBDIR+= bin 312061Sjkh.endif 322061Sjkh.if exists(contrib) 332061SjkhSUBDIR+= contrib 342061Sjkh.endif 352061Sjkh.if exists(games) 362061SjkhSUBDIR+= games 372061Sjkh.endif 382061Sjkh.if exists(gnu) 392061SjkhSUBDIR+= gnu 402061Sjkh.endif 413197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES) 422626ScsgrSUBDIR+= eBones 432626Scsgr.endif 442061Sjkh.if exists(libexec) 452061SjkhSUBDIR+= libexec 462061Sjkh.endif 472061Sjkh.if exists(sbin) 482061SjkhSUBDIR+= sbin 492061Sjkh.endif 502061Sjkh.if exists(share) 512061SjkhSUBDIR+= share 522061Sjkh.endif 532061Sjkh.if exists(sys) 542061SjkhSUBDIR+= sys 552061Sjkh.endif 562061Sjkh.if exists(usr.bin) 572061SjkhSUBDIR+= usr.bin 582061Sjkh.endif 592061Sjkh.if exists(usr.sbin) 602061SjkhSUBDIR+= usr.sbin 612061Sjkh.endif 622834Swollman.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE) 632834SwollmanSUBDIR+= secure 642834Swollman.endif 652834Swollman.if exists(lkm) && !defined(NOLKM) 662834SwollmanSUBDIR+= lkm 672834Swollman.endif 681594Srgrimes 694486Sphk# etc must be last for "distribute" to work 704486Sphk.if exists(etc) && make(distribute) 714486SphkSUBDIR+= etc 724486Sphk.endif 734486Sphk 742061Sjkh# These are last, since it is nice to at least get the base system 752061Sjkh# rebuilt before you do them. 762061Sjkh.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) 772061SjkhSUBDIR+= local 782061Sjkh.endif 792061Sjkh.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) 802061SjkhSUBDIR+= ports 812061Sjkh.endif 822061Sjkh 832061Sjkh# Handle the -DNOOBJDIR and -DNOCLEANDIR 842061Sjkh.if defined(NOOBJDIR) 852061SjkhOBJDIR= 862061Sjkh.else 872061SjkhOBJDIR= obj 882061Sjkh.endif 892061Sjkh.if defined(NOCLEANDIR) 902061SjkhCLEANDIR= clean 918854Srgrimes.else 922061SjkhCLEANDIR= cleandir 932061Sjkh.endif 942061Sjkh 9511806Sphkworld: hierarchy mk cleandist includes lib-tools libraries build-tools 962061Sjkh @echo "--------------------------------------------------------------" 972061Sjkh @echo " Rebuilding ${DESTDIR} The whole thing" 982061Sjkh @echo "--------------------------------------------------------------" 992061Sjkh @echo 1002061Sjkh ${MAKE} depend all install 1012061Sjkh cd ${.CURDIR}/share/man && ${MAKE} makedb 1022061Sjkh 1033030Srgrimeshierarchy: 1042061Sjkh @echo "--------------------------------------------------------------" 1053030Srgrimes @echo " Making hierarchy" 1062061Sjkh @echo "--------------------------------------------------------------" 1076722Sphk cd ${.CURDIR}/etc && ${MAKE} distrib-dirs 1082061Sjkh 1092302Spaulupdate: 1102302Spaul.if defined(SUP_UPDATE) 1112302Spaul @echo "--------------------------------------------------------------" 1122302Spaul @echo "Running sup" 1132302Spaul @echo "--------------------------------------------------------------" 1142302Spaul @sup -v ${SUPFILE} 11510760Sache.if defined(SUPFILE1) 11610760Sache @sup -v ${SUPFILE1} 1172302Spaul.endif 11810760Sache.if defined(SUPFILE2) 11910760Sache @sup -v ${SUPFILE2} 12010760Sache.endif 12110760Sache.endif 1222302Spaul.if defined(CVS_UPDATE) 1232302Spaul @echo "--------------------------------------------------------------" 1242302Spaul @echo "Updating /usr/src from cvs repository" ${CVSROOT} 1252302Spaul @echo "--------------------------------------------------------------" 1262302Spaul cd ${.CURDIR} && cvs update -P -d 1272302Spaul.endif 1282302Spaul 1292061Sjkhcleandist: 1302061Sjkh.if !defined(NOCLEANDIR) 1312061Sjkh @echo "--------------------------------------------------------------" 1322061Sjkh @echo " Cleaning up the source tree, and rebuilding the obj tree" 1332061Sjkh @echo "--------------------------------------------------------------" 1342061Sjkh @echo 1352061Sjkh here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ 1362061Sjkh if test -d /usr/obj -a ! -d $$dest; then \ 1372061Sjkh mkdir -p $$dest; \ 1382061Sjkh else \ 1392061Sjkh true; \ 1402061Sjkh fi; \ 1412061Sjkh cd $$dest && rm -rf ${SUBDIR} 1422061Sjkh find . -name obj | xargs rm -rf 1432061Sjkh.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) 1442061Sjkh # The cd is done as local may well be a symbolic link 1452061Sjkh -cd local && find . -name obj | xargs rm -rf 1462061Sjkh.endif 1472061Sjkh.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) 1482061Sjkh # The cd is done as local may well be a symbolic link 1492061Sjkh -cd ports && find . -name obj | xargs rm -rf 1502061Sjkh.endif 1512061Sjkh ${MAKE} cleandir 1522061Sjkh ${MAKE} obj 1532061Sjkh.endif 1542061Sjkh 1553626Swollmaninstallmost: 1563626Swollman @echo "--------------------------------------------------------------" 1573626Swollman @echo " Installing programs only" 1583626Swollman @echo "--------------------------------------------------------------" 1593626Swollman cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} install 1603626Swollman cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} install 1613626Swollman cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} install 1623626Swollman cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} install 1633626Swollman cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} install 1643626Swollman cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} install 1653626Swollman cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} install 1667059Sroberto cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} install 1673626Swollman#.if defined(MAKE_EBONES) && !defined(NOCRYPT) 1683626Swollman# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} installmost 1693626Swollman#.endif 1703626Swollman#.if !defined(NOSECURE) && !defined(NOCRYPT) 1713626Swollman# cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} installmost 1723626Swollman#.endif 1733626Swollman 1743626Swollmanmost: 1753626Swollman @echo "--------------------------------------------------------------" 1763626Swollman @echo " Building programs only" 1773626Swollman @echo "--------------------------------------------------------------" 1783626Swollman cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} all 1793626Swollman cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} all 1803626Swollman cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} all 1813626Swollman cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} all 1823626Swollman cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} all 1833626Swollman cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} all 1843626Swollman cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} all 1857446Ssos cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} all 1863626Swollman#.if defined(MAKE_EBONES) && !defined(NOCRYPT) 1873626Swollman# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} most 1883626Swollman#.endif 1893626Swollman#.if !defined(NOSECURE) && !defined(NOCRYPT) 1903626Swollman# cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} most 1913626Swollman#.endif 1923626Swollman 1932061Sjkhmk: 1942061Sjkh @echo "--------------------------------------------------------------" 1952061Sjkh @echo " Rebuilding ${DESTDIR}/usr/share/mk" 1962061Sjkh @echo "--------------------------------------------------------------" 1972061Sjkh cd ${.CURDIR}/share/mk && ${MAKE} install 1982061Sjkh 1992061Sjkhincludes: 2002061Sjkh @echo "--------------------------------------------------------------" 2012061Sjkh @echo " Rebuilding ${DESTDIR}/usr/include" 2022061Sjkh @echo "--------------------------------------------------------------" 2032061Sjkh @echo 2042061Sjkh.if defined(CLOBBER) 2057130Srgrimes rm -rf ${DESTDIR}/usr/include/* 2067130Srgrimes mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 2077130Srgrimes -p ${DESTDIR}/usr/include 2082061Sjkh.endif 2092061Sjkh cd ${.CURDIR}/include && ${MAKE} install 2104249Sache cd ${.CURDIR}/gnu/include && ${MAKE} install 2112685Srgrimes cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall 2126927Snate cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall 2132685Srgrimes cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall 2143518Sache cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall 2153197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES) 2163197Scsgr cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall 21712166Sjkh cd ${.CURDIR}/eBones/lib/libkrb && ${MAKE} beforeinstall 2183197Scsgr.endif 2192061Sjkh cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall 2202061Sjkh cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall 2212061Sjkh cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall 2222883Sphk cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall 2233429Sache cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall 2243429Sache cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall 2257281Srgrimes.if !defined(WANT_CSRG_LIBM) 2263242Spaul cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall 2273242Spaul.endif 2287171Sats cd ${.CURDIR}/lib/libpcap && ${MAKE} beforeinstall 2292061Sjkh cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall 2303213Spst cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall 2314942Sache cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall 2325749Swollman cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall 2335772Swollman cd ${.CURDIR}/lib/libss && ${MAKE} beforeinstall 2345865Sache cd ${.CURDIR}/lib/libforms && ${MAKE} beforeinstall 2355866Sache cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall 2362061Sjkh 2375366Snatelib-tools: 2385366Snate @echo "--------------------------------------------------------------" 2396934Sse @echo " Rebuilding tools needed to build the libraries" 2405366Snate @echo "--------------------------------------------------------------" 2415366Snate @echo 2427292Srgrimes cd ${.CURDIR}/gnu/usr.bin/ld && \ 2437292Srgrimes ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2445366Snate cd ${.CURDIR}/usr.bin/ar && \ 2455366Snate ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2465366Snate cd ${.CURDIR}/usr.bin/ranlib && \ 2475366Snate ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2485366Snate cd ${.CURDIR}/usr.bin/nm && \ 2495366Snate ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2505772Swollman cd ${.CURDIR}/usr.bin/lex/lib && \ 2515772Swollman ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2525728Swollman cd ${.CURDIR}/usr.bin/compile_et && \ 2535728Swollman ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} && \ 2545728Swollman rm -f /usr/sbin/compile_et 2555728Swollman cd ${.CURDIR}/usr.bin/mk_cmds && \ 2565728Swollman ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2575366Snate 2582061Sjkhlibraries: 2592061Sjkh @echo "--------------------------------------------------------------" 2602061Sjkh @echo " Rebuilding ${DESTDIR}/usr/lib" 2612061Sjkh @echo "--------------------------------------------------------------" 2622061Sjkh @echo 2632061Sjkh.if defined(CLOBBER) 2642061Sjkh find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \ 2652061Sjkh xargs rm -rf 2662061Sjkh.endif 2678295Srgrimes.if exists(lib/libcompat) 2688295Srgrimes cd ${.CURDIR}/lib/libcompat && \ 26911772Snate ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2708295Srgrimes.endif 2718489Srgrimes.if exists(lib/libncurses) 2728489Srgrimes cd ${.CURDIR}/lib/libncurses && \ 27311772Snate ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2748489Srgrimes.endif 2758489Srgrimes.if exists(lib/libtermcap) 2768489Srgrimes cd ${.CURDIR}/lib/libtermcap && \ 27711772Snate ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2788489Srgrimes.endif 2798295Srgrimes.if exists(gnu) 2802468Spaul cd ${.CURDIR}/gnu/lib && \ 2812061Sjkh ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2822273Spaul cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \ 2832061Sjkh ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2848295Srgrimes.endif 2852160Scsgr.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE) 2862160Scsgr cd ${.CURDIR}/secure/lib && \ 2872160Scsgr ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2882160Scsgr.endif 2892279Spaul.if exists(lib) 2904054Spst cd ${.CURDIR}/lib/csu/i386 && \ 2914054Spst ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2922061Sjkh cd ${.CURDIR}/lib && \ 2932061Sjkh ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2942279Spaul.endif 29511772Snate.if exists(usr.sbin/lex/lib) 2962468Spaul cd ${.CURDIR}/usr.bin/lex/lib && \ 2972468Spaul ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 29811772Snate.endif 2993197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES) 3002626Scsgr cd ${.CURDIR}/eBones/des && \ 3012626Scsgr ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 30210838Sjkh cd ${.CURDIR}/eBones/lib && \ 3032626Scsgr ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 3042626Scsgr.endif 3058304Srgrimes.if exists(usr.sbin/pcvt/keycap) 3068304Srgrimes cd ${.CURDIR}/usr.sbin/pcvt/keycap && \ 30711772Snate ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 3088304Srgrimes.endif 3092061Sjkh 31011806Sphkbuild-tools: 3112061Sjkh @echo "--------------------------------------------------------------" 31212106Sjfieber @echo " Rebuilding ${DESTDIR} C compiler, make, symorder, sgmlfmt and zic(8)" 3132061Sjkh @echo "--------------------------------------------------------------" 3142061Sjkh @echo 3152273Spaul cd ${.CURDIR}/gnu/usr.bin/cc && \ 3162061Sjkh ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 3172061Sjkh cd ${.CURDIR}/usr.bin/make && \ 3182061Sjkh ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 31911769Sphk cd ${.CURDIR}/usr.bin/symorder && \ 32011769Sphk ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 32112106Sjfieber cd ${.CURDIR}/usr.bin/sgmlfmt && \ 32212106Sjfieber ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 32312106Sjfieber cd ${.CURDIR}/share/sgml && \ 32412106Sjfieber ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 32510479Sdg cd ${.CURDIR}/usr.sbin/zic && \ 32610479Sdg ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 3272061Sjkh 3281594Srgrimes.include <bsd.subdir.mk> 329