Makefile revision 7059
12061Sjkh# 27059Sroberto# $Id: Makefile,v 1.43 1995/03/06 13:32:58 se Exp $ 32061Sjkh# 42061Sjkh# Make command line options: 52061Sjkh# -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 202061Sjkh.if exists(bin) 212061SjkhSUBDIR+= bin 222061Sjkh.endif 232061Sjkh.if exists(contrib) 242061SjkhSUBDIR+= contrib 252061Sjkh.endif 262061Sjkh.if exists(games) 272061SjkhSUBDIR+= games 282061Sjkh.endif 292061Sjkh.if exists(gnu) 302061SjkhSUBDIR+= gnu 312061Sjkh.endif 322061Sjkh.if exists(include) 332061SjkhSUBDIR+= include 342061Sjkh.endif 352061Sjkh.if exists(lib) 362061SjkhSUBDIR+= lib 372061Sjkh.endif 383197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES) 392626ScsgrSUBDIR+= eBones 402626Scsgr.endif 412061Sjkh.if exists(libexec) 422061SjkhSUBDIR+= libexec 432061Sjkh.endif 442061Sjkh.if exists(sbin) 452061SjkhSUBDIR+= sbin 462061Sjkh.endif 472061Sjkh.if exists(share) 482061SjkhSUBDIR+= share 492061Sjkh.endif 502061Sjkh.if exists(sys) 512061SjkhSUBDIR+= sys 522061Sjkh.endif 532061Sjkh.if exists(usr.bin) 542061SjkhSUBDIR+= usr.bin 552061Sjkh.endif 562061Sjkh.if exists(usr.sbin) 572061SjkhSUBDIR+= usr.sbin 582061Sjkh.endif 592834Swollman.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE) 602834SwollmanSUBDIR+= secure 612834Swollman.endif 622834Swollman.if exists(lkm) && !defined(NOLKM) 632834SwollmanSUBDIR+= lkm 642834Swollman.endif 651594Srgrimes 664486Sphk# etc must be last for "distribute" to work 674486Sphk.if exists(etc) && make(distribute) 684486SphkSUBDIR+= etc 694486Sphk.endif 704486Sphk 712061Sjkh# These are last, since it is nice to at least get the base system 722061Sjkh# rebuilt before you do them. 732061Sjkh.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) 742061SjkhSUBDIR+= local 752061Sjkh.endif 762061Sjkh.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) 772061SjkhSUBDIR+= ports 782061Sjkh.endif 792061Sjkh 802061Sjkh# Handle the -DNOOBJDIR and -DNOCLEANDIR 812061Sjkh.if defined(NOOBJDIR) 822061SjkhOBJDIR= 832061Sjkh.else 842061SjkhOBJDIR= obj 852061Sjkh.endif 862061Sjkh.if defined(NOCLEANDIR) 872061SjkhCLEANDIR= clean 882061Sjkh.else 892061SjkhCLEANDIR= cleandir 902061Sjkh.endif 912061Sjkh 925511Sjkhworld: hierarchy mk cleandist includes lib-tools libraries tools 932061Sjkh @echo "--------------------------------------------------------------" 942061Sjkh @echo " Rebuilding ${DESTDIR} The whole thing" 952061Sjkh @echo "--------------------------------------------------------------" 962061Sjkh @echo 972061Sjkh ${MAKE} depend all install 982061Sjkh cd ${.CURDIR}/share/man && ${MAKE} makedb 992061Sjkh 1003030Srgrimeshierarchy: 1012061Sjkh @echo "--------------------------------------------------------------" 1023030Srgrimes @echo " Making hierarchy" 1032061Sjkh @echo "--------------------------------------------------------------" 1046722Sphk cd ${.CURDIR}/etc && ${MAKE} distrib-dirs 1052061Sjkh 1062302Spaulupdate: 1072302Spaul.if defined(SUP_UPDATE) 1082302Spaul @echo "--------------------------------------------------------------" 1092302Spaul @echo "Running sup" 1102302Spaul @echo "--------------------------------------------------------------" 1112302Spaul @sup -v ${SUPFILE} 1122302Spaul.endif 1132302Spaul.if defined(CVS_UPDATE) 1142302Spaul @echo "--------------------------------------------------------------" 1152302Spaul @echo "Updating /usr/src from cvs repository" ${CVSROOT} 1162302Spaul @echo "--------------------------------------------------------------" 1172302Spaul cd ${.CURDIR} && cvs update -P -d 1182302Spaul.endif 1192302Spaul 1202061Sjkhcleandist: 1212061Sjkh.if !defined(NOCLEANDIR) 1222061Sjkh @echo "--------------------------------------------------------------" 1232061Sjkh @echo " Cleaning up the source tree, and rebuilding the obj tree" 1242061Sjkh @echo "--------------------------------------------------------------" 1252061Sjkh @echo 1262061Sjkh here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ 1272061Sjkh if test -d /usr/obj -a ! -d $$dest; then \ 1282061Sjkh mkdir -p $$dest; \ 1292061Sjkh else \ 1302061Sjkh true; \ 1312061Sjkh fi; \ 1322061Sjkh cd $$dest && rm -rf ${SUBDIR} 1332061Sjkh find . -name obj | xargs rm -rf 1342061Sjkh.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) 1352061Sjkh # The cd is done as local may well be a symbolic link 1362061Sjkh -cd local && find . -name obj | xargs rm -rf 1372061Sjkh.endif 1382061Sjkh.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) 1392061Sjkh # The cd is done as local may well be a symbolic link 1402061Sjkh -cd ports && find . -name obj | xargs rm -rf 1412061Sjkh.endif 1422061Sjkh ${MAKE} cleandir 1432061Sjkh ${MAKE} obj 1442061Sjkh.endif 1452061Sjkh 1463626Swollmaninstallmost: 1473626Swollman @echo "--------------------------------------------------------------" 1483626Swollman @echo " Installing programs only" 1493626Swollman @echo "--------------------------------------------------------------" 1503626Swollman cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} install 1513626Swollman cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} install 1523626Swollman cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} install 1533626Swollman cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} install 1543626Swollman cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} install 1553626Swollman cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} install 1563626Swollman cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} install 1577059Sroberto cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} install 1583626Swollman#.if defined(MAKE_EBONES) && !defined(NOCRYPT) 1593626Swollman# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} installmost 1603626Swollman#.endif 1613626Swollman#.if !defined(NOSECURE) && !defined(NOCRYPT) 1623626Swollman# cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} installmost 1633626Swollman#.endif 1643626Swollman 1653626Swollmanmost: 1663626Swollman @echo "--------------------------------------------------------------" 1673626Swollman @echo " Building programs only" 1683626Swollman @echo "--------------------------------------------------------------" 1693626Swollman cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} all 1703626Swollman cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} all 1713626Swollman cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} all 1723626Swollman cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} all 1733626Swollman cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} all 1743626Swollman cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} all 1753626Swollman cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} all 1767059Sroberto cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} install 1773626Swollman#.if defined(MAKE_EBONES) && !defined(NOCRYPT) 1783626Swollman# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} most 1793626Swollman#.endif 1803626Swollman#.if !defined(NOSECURE) && !defined(NOCRYPT) 1813626Swollman# cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} most 1823626Swollman#.endif 1833626Swollman 1842061Sjkhmk: 1852061Sjkh @echo "--------------------------------------------------------------" 1862061Sjkh @echo " Rebuilding ${DESTDIR}/usr/share/mk" 1872061Sjkh @echo "--------------------------------------------------------------" 1882061Sjkh cd ${.CURDIR}/share/mk && ${MAKE} install 1892061Sjkh 1902061Sjkhincludes: 1912061Sjkh @echo "--------------------------------------------------------------" 1922061Sjkh @echo " Rebuilding ${DESTDIR}/usr/include" 1932061Sjkh @echo "--------------------------------------------------------------" 1942061Sjkh @echo 1952061Sjkh.if defined(CLOBBER) 1962061Sjkh rm -rf ${DESTDIR}/usr/include 1972061Sjkh mkdir ${DESTDIR}/usr/include 1982061Sjkh chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include 1992061Sjkh chmod 755 ${DESTDIR}/usr/include 2002061Sjkh.endif 2012061Sjkh cd ${.CURDIR}/include && ${MAKE} install 2024249Sache cd ${.CURDIR}/gnu/include && ${MAKE} install 2032685Srgrimes cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall 2046927Snate cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall 2052685Srgrimes cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall 2063518Sache cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall 2073197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES) 2083197Scsgr cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall 2093197Scsgr.endif 2102061Sjkh cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall 2112061Sjkh cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall 2122061Sjkh cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall 2132883Sphk cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall 2143429Sache cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall 2153429Sache cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall 2163242Spaul.if defined(WANT_MSUN) 2173242Spaul cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall 2183242Spaul.endif 2192061Sjkh cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall 2203213Spst cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall 2214942Sache cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall 2225749Swollman cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall 2235772Swollman cd ${.CURDIR}/lib/libss && ${MAKE} beforeinstall 2245865Sache cd ${.CURDIR}/lib/libforms && ${MAKE} beforeinstall 2255866Sache cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall 2262061Sjkh 2275366Snatelib-tools: 2285366Snate @echo "--------------------------------------------------------------" 2296934Sse @echo " Rebuilding tools needed to build the libraries" 2305366Snate @echo "--------------------------------------------------------------" 2315366Snate @echo 2325366Snate cd ${.CURDIR}/usr.bin/ar && \ 2335366Snate ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2345366Snate cd ${.CURDIR}/usr.bin/ranlib && \ 2355366Snate ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2365366Snate cd ${.CURDIR}/usr.bin/nm && \ 2375366Snate ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2385772Swollman cd ${.CURDIR}/usr.bin/lex/lib && \ 2395772Swollman ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2405728Swollman cd ${.CURDIR}/usr.bin/compile_et && \ 2415728Swollman ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} && \ 2425728Swollman rm -f /usr/sbin/compile_et 2435728Swollman cd ${.CURDIR}/usr.bin/mk_cmds && \ 2445728Swollman ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2455366Snate 2462061Sjkhlibraries: 2472061Sjkh @echo "--------------------------------------------------------------" 2482061Sjkh @echo " Rebuilding ${DESTDIR}/usr/lib" 2492061Sjkh @echo "--------------------------------------------------------------" 2502061Sjkh @echo 2512061Sjkh.if defined(CLOBBER) 2522061Sjkh find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \ 2532061Sjkh xargs rm -rf 2542061Sjkh.endif 2552468Spaul cd ${.CURDIR}/gnu/lib && \ 2562061Sjkh ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2572273Spaul cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \ 2582061Sjkh ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2592160Scsgr.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE) 2602160Scsgr cd ${.CURDIR}/secure/lib && \ 2612160Scsgr ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2622160Scsgr.endif 2632279Spaul.if exists(lib) 2644054Spst cd ${.CURDIR}/lib/csu/i386 && \ 2654054Spst ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2662061Sjkh cd ${.CURDIR}/lib && \ 2672061Sjkh ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2682279Spaul.endif 2692468Spaul cd ${.CURDIR}/usr.bin/lex/lib && \ 2702468Spaul ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2713197Scsgr.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES) 2722626Scsgr cd ${.CURDIR}/eBones/des && \ 2732626Scsgr ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2742626Scsgr cd ${.CURDIR}/eBones/acl && \ 2752626Scsgr ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2762626Scsgr cd ${.CURDIR}/eBones/kdb && \ 2772626Scsgr ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2782626Scsgr cd ${.CURDIR}/eBones/krb && \ 2792626Scsgr ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2802626Scsgr.endif 2812061Sjkh 2822061Sjkhtools: 2832061Sjkh @echo "--------------------------------------------------------------" 2842061Sjkh @echo " Rebuilding ${DESTDIR} Compiler and Make" 2852061Sjkh @echo "--------------------------------------------------------------" 2862061Sjkh @echo 2872273Spaul cd ${.CURDIR}/gnu/usr.bin/cc && \ 2882061Sjkh ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2892061Sjkh cd ${.CURDIR}/usr.bin/make && \ 2902061Sjkh ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 2912061Sjkh 2921594Srgrimes.include <bsd.subdir.mk> 293