Makefile revision 2834
1# 2# $Id: Makefile,v 1.17 1994/09/12 05:17:15 rgrimes Exp $ 3# 4# Make command line options: 5# -DCLOBBER will remove /usr/include and MOST of /usr/lib 6# -DMAKE_LOCAL to add ./local to the SUBDIR list 7# -DMAKE_PORTS to add ./ports to the SUBDIR list 8# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir 9# -DNOCRYPT will prevent building of crypt versions 10# XXX2 -DNOKERBEROS do not build Kerberos 11# -DNOLKM do not build loadable kernel modules 12# -DNOOBJDIR do not run ``${MAKE} obj'' 13# -DNOPROFILE do not build profiled libraries 14# -DNOSECURE do not go into secure subdir 15# -DNOEBONES do not make eBones (kerberosIV) 16# 17# XXX2 Mandatory, and Kerberos will not build sucessfully yet 18 19# Put initial settings here. 20NOKERBEROS= yes 21SUBDIR= 22 23.if exists(bin) 24SUBDIR+= bin 25.endif 26.if exists(contrib) 27SUBDIR+= contrib 28.endif 29.if exists(etc) 30SUBDIR+= etc 31.endif 32.if exists(games) 33SUBDIR+= games 34.endif 35.if exists(gnu) 36SUBDIR+= gnu 37.endif 38.if exists(include) 39SUBDIR+= include 40.endif 41.if exists(lib) 42SUBDIR+= lib 43.endif 44.if exists(kerberosIV) && !defined(NOCRYPT) && !defined(NOKERBEROS) 45SUBDIR+= kerberosIV 46.endif 47.if exists(eBones) && !defined(NOCRYPT) && defined(NOKERBEROS) \ 48 && !defined(NOEBONES) 49SUBDIR+= eBones 50.endif 51.if exists(libexec) 52SUBDIR+= libexec 53.endif 54.if exists(sbin) 55SUBDIR+= sbin 56.endif 57.if exists(share) 58SUBDIR+= share 59.endif 60.if exists(sys) 61SUBDIR+= sys 62.endif 63.if exists(usr.bin) 64SUBDIR+= usr.bin 65.endif 66.if exists(usr.sbin) 67SUBDIR+= usr.sbin 68.endif 69.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE) 70SUBDIR+= secure 71.endif 72.if exists(lkm) && !defined(NOLKM) 73SUBDIR+= lkm 74.endif 75 76# These are last, since it is nice to at least get the base system 77# rebuilt before you do them. 78.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) 79SUBDIR+= local 80.endif 81.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) 82SUBDIR+= ports 83.endif 84 85# Handle the -DNOOBJDIR and -DNOCLEANDIR 86.if defined(NOOBJDIR) 87OBJDIR= 88.else 89OBJDIR= obj 90.endif 91.if defined(NOCLEANDIR) 92CLEANDIR= clean 93.else 94CLEANDIR= cleandir 95.endif 96 97world: directories cleandist mk includes libraries tools 98 @echo "--------------------------------------------------------------" 99 @echo " Rebuilding ${DESTDIR} The whole thing" 100 @echo "--------------------------------------------------------------" 101 @echo 102 ${MAKE} depend all install 103 cd ${.CURDIR}/share/man && ${MAKE} makedb 104 105 106directories: 107 @echo "--------------------------------------------------------------" 108 @echo " Making directories" 109 @echo "--------------------------------------------------------------" 110 cd ${.CURDIR}/etc && ${MAKE} distrib-dirs 111 112update: 113.if defined(SUP_UPDATE) 114 @echo "--------------------------------------------------------------" 115 @echo "Running sup" 116 @echo "--------------------------------------------------------------" 117 @sup -v ${SUPFILE} 118.endif 119.if defined(CVS_UPDATE) 120 @echo "--------------------------------------------------------------" 121 @echo "Updating /usr/src from cvs repository" ${CVSROOT} 122 @echo "--------------------------------------------------------------" 123 cd ${.CURDIR} && cvs update -P -d 124.endif 125 126cleandist: 127.if !defined(NOCLEANDIR) 128 @echo "--------------------------------------------------------------" 129 @echo " Cleaning up the source tree, and rebuilding the obj tree" 130 @echo "--------------------------------------------------------------" 131 @echo 132 here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ 133 if test -d /usr/obj -a ! -d $$dest; then \ 134 mkdir -p $$dest; \ 135 else \ 136 true; \ 137 fi; \ 138 cd $$dest && rm -rf ${SUBDIR} 139 find . -name obj | xargs rm -rf 140.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) 141 # The cd is done as local may well be a symbolic link 142 -cd local && find . -name obj | xargs rm -rf 143.endif 144.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) 145 # The cd is done as local may well be a symbolic link 146 -cd ports && find . -name obj | xargs rm -rf 147.endif 148 ${MAKE} cleandir 149 ${MAKE} obj 150.endif 151 152mk: 153 @echo "--------------------------------------------------------------" 154 @echo " Rebuilding ${DESTDIR}/usr/share/mk" 155 @echo "--------------------------------------------------------------" 156 cd ${.CURDIR}/share/mk && ${MAKE} install 157 158includes: 159 @echo "--------------------------------------------------------------" 160 @echo " Rebuilding ${DESTDIR}/usr/include" 161 @echo "--------------------------------------------------------------" 162 @echo 163.if defined(CLOBBER) 164 rm -rf ${DESTDIR}/usr/include 165 mkdir ${DESTDIR}/usr/include 166 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include 167 chmod 755 ${DESTDIR}/usr/include 168.endif 169 cd ${.CURDIR}/include && ${MAKE} install 170 cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall 171 cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall 172.if exists(kerberosIV) && !defined(NOCRYPT) && !defined(NOKERBEROS) 173 cd ${.CURDIR}/kerberosIV/include && ${MAKE} install 174.endif 175 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall 176 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall 177 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall 178 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall 179.if exists(eBones) && !defined(NOCRYPT) && defined(NOKERBEROS) && \ 180 !defined(NOEBONES) 181 cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall 182.endif 183 184libraries: 185 @echo "--------------------------------------------------------------" 186 @echo " Rebuilding ${DESTDIR}/usr/lib" 187 @echo "--------------------------------------------------------------" 188 @echo 189.if defined(CLOBBER) 190 find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \ 191 xargs rm -rf 192.endif 193 cd ${.CURDIR}/gnu/lib && \ 194 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 195 cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \ 196 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 197.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE) 198 cd ${.CURDIR}/secure/lib && \ 199 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 200.endif 201.if exists(lib) 202 cd ${.CURDIR}/lib && \ 203 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 204.endif 205 cd ${.CURDIR}/usr.bin/lex/lib && \ 206 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 207.if exists(kerberosIV) && !defined(NOCRYPT) && !defined(NOKERBEROS) 208 cd ${.CURDIR}/kerberosIV/acl && \ 209 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 210 cd ${.CURDIR}/kerberosIV/des && \ 211 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 212 cd ${.CURDIR}/kerberosIV/kdb && \ 213 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 214 cd ${.CURDIR}/kerberosIV/krb && \ 215 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 216.endif 217.if exists(eBones) && !defined(NOCRYPT) && defined(NOKERBEROS) && \ 218 !defined(NOEBONES) 219 cd ${.CURDIR}/eBones/des && \ 220 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 221 cd ${.CURDIR}/eBones/acl && \ 222 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 223 cd ${.CURDIR}/eBones/kdb && \ 224 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 225 cd ${.CURDIR}/eBones/krb && \ 226 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 227.endif 228 229tools: 230 @echo "--------------------------------------------------------------" 231 @echo " Rebuilding ${DESTDIR} Compiler and Make" 232 @echo "--------------------------------------------------------------" 233 @echo 234 cd ${.CURDIR}/gnu/usr.bin/cc && \ 235 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 236 cd ${.CURDIR}/usr.bin/make && \ 237 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 238 239.include <bsd.subdir.mk> 240