Makefile revision 6722
1185729Speter# 2185729Speter# $Id: Makefile,v 1.40 1995/02/09 11:09:41 jkh Exp $ 3185729Speter# 4185729Speter# Make command line options: 5185729Speter# -DCLOBBER will remove /usr/include and MOST of /usr/lib 6185729Speter# -DMAKE_LOCAL to add ./local to the SUBDIR list 7185729Speter# -DMAKE_PORTS to add ./ports to the SUBDIR list 8185729Speter# -DMAKE_EBONES to build eBones (KerberosIV) 9185729Speter# 10185729Speter# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir 11185729Speter# -DNOCRYPT will prevent building of crypt versions 12185729Speter# -DNOLKM do not build loadable kernel modules 13185729Speter# -DNOOBJDIR do not run ``${MAKE} obj'' 14185729Speter# -DNOPROFILE do not build profiled libraries 15185729Speter# -DNOSECURE do not go into secure subdir 16185729Speter 17185729Speter# Put initial settings here. 18185729SpeterSUBDIR= 19185729Speter 20185729Speter.if exists(bin) 21185729SpeterSUBDIR+= bin 22185729Speter.endif 23185729Speter.if exists(contrib) 24185729SpeterSUBDIR+= contrib 25185729Speter.endif 26185729Speter.if exists(games) 27185729SpeterSUBDIR+= games 28185729Speter.endif 29206622Suqs.if exists(gnu) 30185729SpeterSUBDIR+= gnu 31185729Speter.endif 32185729Speter.if exists(include) 33185729SpeterSUBDIR+= include 34185729Speter.endif 35185729Speter.if exists(lib) 36185729SpeterSUBDIR+= lib 37185729Speter.endif 38185729Speter.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES) 39185729SpeterSUBDIR+= eBones 40185729Speter.endif 41185729Speter.if exists(libexec) 42185729SpeterSUBDIR+= libexec 43185729Speter.endif 44185729Speter.if exists(sbin) 45185729SpeterSUBDIR+= sbin 46185729Speter.endif 47185729Speter.if exists(share) 48210823SjoelSUBDIR+= share 49185729Speter.endif 50185729Speter.if exists(sys) 51185729SpeterSUBDIR+= sys 52185729Speter.endif 53185729Speter.if exists(usr.bin) 54185729SpeterSUBDIR+= usr.bin 55185729Speter.endif 56185729Speter.if exists(usr.sbin) 57185729SpeterSUBDIR+= usr.sbin 58185729Speter.endif 59185729Speter.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE) 60185729SpeterSUBDIR+= secure 61194071Sjhb.endif 62185729Speter.if exists(lkm) && !defined(NOLKM) 63185729SpeterSUBDIR+= lkm 64185729Speter.endif 65194240Sjhb 66194240Sjhb# etc must be last for "distribute" to work 67185729Speter.if exists(etc) && make(distribute) 68185729SpeterSUBDIR+= etc 69185729Speter.endif 70185729Speter 71194071Sjhb# These are last, since it is nice to at least get the base system 72194071Sjhb# rebuilt before you do them. 73194071Sjhb.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) 74194071SjhbSUBDIR+= local 75185729Speter.endif 76185729Speter.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) 77185729SpeterSUBDIR+= ports 78185729Speter.endif 79185729Speter 80# Handle the -DNOOBJDIR and -DNOCLEANDIR 81.if defined(NOOBJDIR) 82OBJDIR= 83.else 84OBJDIR= obj 85.endif 86.if defined(NOCLEANDIR) 87CLEANDIR= clean 88.else 89CLEANDIR= cleandir 90.endif 91 92world: hierarchy mk cleandist includes lib-tools libraries tools 93 @echo "--------------------------------------------------------------" 94 @echo " Rebuilding ${DESTDIR} The whole thing" 95 @echo "--------------------------------------------------------------" 96 @echo 97 ${MAKE} depend all install 98 cd ${.CURDIR}/share/man && ${MAKE} makedb 99 100hierarchy: 101 @echo "--------------------------------------------------------------" 102 @echo " Making hierarchy" 103 @echo "--------------------------------------------------------------" 104 cd ${.CURDIR}/etc && ${MAKE} distrib-dirs 105 106update: 107.if defined(SUP_UPDATE) 108 @echo "--------------------------------------------------------------" 109 @echo "Running sup" 110 @echo "--------------------------------------------------------------" 111 @sup -v ${SUPFILE} 112.endif 113.if defined(CVS_UPDATE) 114 @echo "--------------------------------------------------------------" 115 @echo "Updating /usr/src from cvs repository" ${CVSROOT} 116 @echo "--------------------------------------------------------------" 117 cd ${.CURDIR} && cvs update -P -d 118.endif 119 120cleandist: 121.if !defined(NOCLEANDIR) 122 @echo "--------------------------------------------------------------" 123 @echo " Cleaning up the source tree, and rebuilding the obj tree" 124 @echo "--------------------------------------------------------------" 125 @echo 126 here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ 127 if test -d /usr/obj -a ! -d $$dest; then \ 128 mkdir -p $$dest; \ 129 else \ 130 true; \ 131 fi; \ 132 cd $$dest && rm -rf ${SUBDIR} 133 find . -name obj | xargs rm -rf 134.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) 135 # The cd is done as local may well be a symbolic link 136 -cd local && find . -name obj | xargs rm -rf 137.endif 138.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) 139 # The cd is done as local may well be a symbolic link 140 -cd ports && find . -name obj | xargs rm -rf 141.endif 142 ${MAKE} cleandir 143 ${MAKE} obj 144.endif 145 146installmost: 147 @echo "--------------------------------------------------------------" 148 @echo " Installing programs only" 149 @echo "--------------------------------------------------------------" 150 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} install 151 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} install 152 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} install 153 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} install 154 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} install 155 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} install 156 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} install 157#.if defined(MAKE_EBONES) && !defined(NOCRYPT) 158# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} installmost 159#.endif 160#.if !defined(NOSECURE) && !defined(NOCRYPT) 161# cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} installmost 162#.endif 163 164most: 165 @echo "--------------------------------------------------------------" 166 @echo " Building programs only" 167 @echo "--------------------------------------------------------------" 168 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} all 169 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} all 170 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} all 171 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} all 172 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} all 173 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} all 174 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} all 175#.if defined(MAKE_EBONES) && !defined(NOCRYPT) 176# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} most 177#.endif 178#.if !defined(NOSECURE) && !defined(NOCRYPT) 179# cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} most 180#.endif 181 182mk: 183 @echo "--------------------------------------------------------------" 184 @echo " Rebuilding ${DESTDIR}/usr/share/mk" 185 @echo "--------------------------------------------------------------" 186 cd ${.CURDIR}/share/mk && ${MAKE} install 187 188includes: 189 @echo "--------------------------------------------------------------" 190 @echo " Rebuilding ${DESTDIR}/usr/include" 191 @echo "--------------------------------------------------------------" 192 @echo 193.if defined(CLOBBER) 194 rm -rf ${DESTDIR}/usr/include 195 mkdir ${DESTDIR}/usr/include 196 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include 197 chmod 755 ${DESTDIR}/usr/include 198.endif 199 cd ${.CURDIR}/include && ${MAKE} install 200 cd ${.CURDIR}/gnu/include && ${MAKE} install 201 cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall 202 cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall 203 cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall 204.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES) 205 cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall 206.endif 207 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall 208 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall 209 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall 210 cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall 211 cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall 212 cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall 213.if defined(WANT_MSUN) 214 cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall 215.endif 216 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall 217 cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall 218 cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall 219 cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall 220 cd ${.CURDIR}/lib/libss && ${MAKE} beforeinstall 221 cd ${.CURDIR}/lib/libforms && ${MAKE} beforeinstall 222 cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall 223 224lib-tools: 225 @echo "--------------------------------------------------------------" 226 @echo " Rebuilding tools needed to build the libraries 227 @echo "--------------------------------------------------------------" 228 @echo 229 cd ${.CURDIR}/usr.bin/ar && \ 230 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 231 cd ${.CURDIR}/usr.bin/ranlib && \ 232 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 233 cd ${.CURDIR}/usr.bin/nm && \ 234 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 235 cd ${.CURDIR}/usr.bin/lex/lib && \ 236 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 237 cd ${.CURDIR}/usr.bin/compile_et && \ 238 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} && \ 239 rm -f /usr/sbin/compile_et 240 cd ${.CURDIR}/usr.bin/mk_cmds && \ 241 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 242 243libraries: 244 @echo "--------------------------------------------------------------" 245 @echo " Rebuilding ${DESTDIR}/usr/lib" 246 @echo "--------------------------------------------------------------" 247 @echo 248.if defined(CLOBBER) 249 find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \ 250 xargs rm -rf 251.endif 252 cd ${.CURDIR}/gnu/lib && \ 253 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 254 cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \ 255 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 256.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE) 257 cd ${.CURDIR}/secure/lib && \ 258 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 259.endif 260.if exists(lib) 261 cd ${.CURDIR}/lib/csu/i386 && \ 262 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 263 cd ${.CURDIR}/lib && \ 264 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 265.endif 266 cd ${.CURDIR}/usr.bin/lex/lib && \ 267 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 268.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES) 269 cd ${.CURDIR}/eBones/des && \ 270 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 271 cd ${.CURDIR}/eBones/acl && \ 272 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 273 cd ${.CURDIR}/eBones/kdb && \ 274 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 275 cd ${.CURDIR}/eBones/krb && \ 276 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 277.endif 278 279tools: 280 @echo "--------------------------------------------------------------" 281 @echo " Rebuilding ${DESTDIR} Compiler and Make" 282 @echo "--------------------------------------------------------------" 283 @echo 284 cd ${.CURDIR}/gnu/usr.bin/cc && \ 285 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 286 cd ${.CURDIR}/usr.bin/make && \ 287 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} 288 289.include <bsd.subdir.mk> 290