Makefile revision 2279
12061Sjkh#
22279Spaul#	$Id: Makefile,v 1.11 1994/08/25 10:47:30 paul 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
82061Sjkh#	-DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
92160Scsgr#	-DNOCRYPT will prevent building of crypt versions
102160Scsgr# XXX2	-DNOKERBEROS do not build Kerberos
112061Sjkh#	-DNOOBJDIR do not run ``${MAKE} obj''
122061Sjkh#	-DNOPROFILE do not build profiled libraries
132160Scsgr#	-DNOSECURE do not go into secure subdir
142061Sjkh#
152160Scsgr# XXX2	Mandatory, and Kerberos will not build sucessfully yet
161594Srgrimes
172061Sjkh# Put initial settings here.
182160ScsgrNOKERBEROS=	yes
192061SjkhSUBDIR=
201594Srgrimes
212061Sjkh.if exists(bin)
222061SjkhSUBDIR+= bin
232061Sjkh.endif
242061Sjkh.if exists(contrib)
252061SjkhSUBDIR+= contrib
262061Sjkh.endif
272061Sjkh.if exists(etc)
282061SjkhSUBDIR+= etc
292061Sjkh.endif
302061Sjkh.if exists(games)
312061SjkhSUBDIR+= games
322061Sjkh.endif
332061Sjkh.if exists(gnu)
342061SjkhSUBDIR+= gnu
352061Sjkh.endif
362061Sjkh.if exists(include)
372061SjkhSUBDIR+= include
382061Sjkh.endif
392061Sjkh.if exists(lib)
402061SjkhSUBDIR+= lib
412061Sjkh.endif
422160Scsgr.if exists(kerberosIV) && !defined(NOCRYPT) && !defined(NOKERBEROS)
432061SjkhSUBDIR+= kerberosIV
442061Sjkh.endif
452061Sjkh.if exists(libexec)
462061SjkhSUBDIR+= libexec
472061Sjkh.endif
482061Sjkh.if exists(sbin)
492061SjkhSUBDIR+= sbin
502061Sjkh.endif
512160Scsgr.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
522160ScsgrSUBDIR+= secure
532160Scsgr.endif
542061Sjkh.if exists(share)
552061SjkhSUBDIR+= share
562061Sjkh.endif
572061Sjkh.if exists(sys)
582061SjkhSUBDIR+= sys
592061Sjkh.endif
602061Sjkh.if exists(usr.bin)
612061SjkhSUBDIR+= usr.bin
622061Sjkh.endif
632061Sjkh.if exists(usr.sbin)
642061SjkhSUBDIR+= usr.sbin
652061Sjkh.endif
661594Srgrimes
672061Sjkh# These are last, since it is nice to at least get the base system
682061Sjkh# rebuilt before you do them.
692061Sjkh.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
702061SjkhSUBDIR+= local
712061Sjkh.endif
722061Sjkh.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
732061SjkhSUBDIR+= ports
742061Sjkh.endif
752061Sjkh
762061Sjkh# Handle the -DNOOBJDIR and -DNOCLEANDIR
772061Sjkh.if defined(NOOBJDIR)
782061SjkhOBJDIR=
792061Sjkh.else
802061SjkhOBJDIR=		obj
812061Sjkh.endif
822061Sjkh.if defined(NOCLEANDIR)
832061SjkhCLEANDIR=	clean
842061Sjkh.else 
852061SjkhCLEANDIR=	cleandir
862061Sjkh.endif
872061Sjkh
882279Spaulworld:	directories cleandist mk includes libraries tools
892061Sjkh	@echo "--------------------------------------------------------------"
902061Sjkh	@echo " Rebuilding ${DESTDIR} The whole thing"
912061Sjkh	@echo "--------------------------------------------------------------"
922061Sjkh	@echo
932061Sjkh	${MAKE} depend all install
942061Sjkh	cd ${.CURDIR}/share/man &&		${MAKE} makedb
952061Sjkh
962061Sjkhdirectories:
972061Sjkh	@echo "--------------------------------------------------------------"
982061Sjkh	@echo " Making directories"
992061Sjkh	@echo "--------------------------------------------------------------"
1002061Sjkh	@echo " XXX Not yet ready in 2.0.0"
1012061Sjkh# XXX	cd ${.CURDIR}/etc &&			${MAKE} distrib-dirs
1022061Sjkh
1032061Sjkhcleandist:
1042061Sjkh.if !defined(NOCLEANDIR)
1052061Sjkh	@echo "--------------------------------------------------------------"
1062061Sjkh	@echo " Cleaning up the source tree, and rebuilding the obj tree"
1072061Sjkh	@echo "--------------------------------------------------------------"
1082061Sjkh	@echo
1092061Sjkh	here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
1102061Sjkh	if test -d /usr/obj -a ! -d $$dest; then \
1112061Sjkh		mkdir -p $$dest; \
1122061Sjkh	else \
1132061Sjkh		true; \
1142061Sjkh	fi; \
1152061Sjkh	cd $$dest && rm -rf ${SUBDIR}
1162061Sjkh	find . -name obj | xargs rm -rf
1172061Sjkh.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
1182061Sjkh	# The cd is done as local may well be a symbolic link
1192061Sjkh	-cd local && find . -name obj | xargs rm -rf
1202061Sjkh.endif
1212061Sjkh.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
1222061Sjkh	# The cd is done as local may well be a symbolic link
1232061Sjkh	-cd ports && find . -name obj | xargs rm -rf
1242061Sjkh.endif
1252061Sjkh	${MAKE} cleandir
1262061Sjkh	${MAKE} obj
1272061Sjkh.endif
1282061Sjkh
1292061Sjkhmk:
1302061Sjkh	@echo "--------------------------------------------------------------"
1312061Sjkh	@echo " Rebuilding ${DESTDIR}/usr/share/mk"
1322061Sjkh	@echo "--------------------------------------------------------------"
1332061Sjkh	cd ${.CURDIR}/share/mk &&		${MAKE} install
1342061Sjkh
1352061Sjkhincludes:
1362061Sjkh	@echo "--------------------------------------------------------------"
1372061Sjkh	@echo " Rebuilding ${DESTDIR}/usr/include"
1382061Sjkh	@echo "--------------------------------------------------------------"
1392061Sjkh	@echo
1402061Sjkh.if defined(CLOBBER)
1412061Sjkh	rm -rf ${DESTDIR}/usr/include
1422061Sjkh	mkdir ${DESTDIR}/usr/include
1432061Sjkh	chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include
1442061Sjkh	chmod 755 ${DESTDIR}/usr/include
1452061Sjkh.endif
1462061Sjkh	cd ${.CURDIR}/include &&		${MAKE} install
1472068Sjkh#XXX	cd ${.CURDIR}/gnu/lib/libg++ &&		${MAKE} beforeinstall
1482273Spaul#XXX	cd ${.CURDIR}/gnu/usr.bin/cc/libobjc &&	${MAKE} beforeinstall
1492160Scsgr.if !defined(NOCRYPT) && !defined(NOKERBEROS)
1502061Sjkh	cd ${.CURDIR}/kerberosIV/include &&	${MAKE} install
1512061Sjkh.endif
1522061Sjkh	cd ${.CURDIR}/lib/libc &&		${MAKE} beforeinstall
1532061Sjkh	cd ${.CURDIR}/lib/libcurses &&		${MAKE} beforeinstall
1542061Sjkh	cd ${.CURDIR}/lib/libedit &&		${MAKE} beforeinstall
1552061Sjkh	cd ${.CURDIR}/lib/librpcsvc &&		${MAKE} beforeinstall
1562061Sjkh
1572061Sjkhlibraries:
1582061Sjkh	@echo "--------------------------------------------------------------"
1592061Sjkh	@echo " Rebuilding ${DESTDIR}/usr/lib"
1602061Sjkh	@echo "--------------------------------------------------------------"
1612061Sjkh	@echo
1622061Sjkh.if defined(CLOBBER)
1632061Sjkh	find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \
1642061Sjkh		xargs rm -rf
1652061Sjkh.endif
1662061Sjkh	# XXX The whole GNU block should be doable in one command, as soon		# as libg++ works on FreeBSD 2.0 I will try that out
1672061Sjkh#XXX	cd ${.CURDIR}/gnu/lib/libg++ && \
1682061Sjkh#XXX		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
1692061Sjkh	cd ${.CURDIR}/gnu/lib/libmalloc && \
1702061Sjkh		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
1712061Sjkh	cd ${.CURDIR}/gnu/lib/libreadline && \
1722061Sjkh		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
1732061Sjkh	cd ${.CURDIR}/gnu/lib/libregex && \
1742061Sjkh		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
1752273Spaul	cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
1762061Sjkh		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
1772160Scsgr.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
1782160Scsgr	cd ${.CURDIR}/secure/lib && \
1792160Scsgr		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
1802160Scsgr.endif
1812279Spaul.if exists(sys)
1822279Spaul	cd ${.CURDIR}/sys/libkern && \
1832279Spaul		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
1842279Spaul.endif
1852279Spaul.if exists(lib)
1862061Sjkh	cd ${.CURDIR}/lib && \
1872061Sjkh		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
1882279Spaul.endif
1892061Sjkh	# You need the lex lib before you can build kerberosIV
1902061Sjkh#XXX	# We don't have lex in the 2.0 tree yet!
1912061Sjkh#XXX	cd ${.CURDIR}/usr.bin/lex/lib && \
1922061Sjkh#XXX		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
1932160Scsgr.if !defined(NOCRYPT) && !defined(NOKERBEROS)
1942061Sjkh	cd ${.CURDIR}/kerberosIV/acl && \
1952061Sjkh		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
1962061Sjkh	cd ${.CURDIR}/kerberosIV/des && \
1972061Sjkh		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
1982061Sjkh	cd ${.CURDIR}/kerberosIV/kdb && \
1992061Sjkh		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
2002061Sjkh	cd ${.CURDIR}/kerberosIV/krb && \
2012061Sjkh		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
2022061Sjkh.endif
2032061Sjkh
2042061Sjkhtools:
2052061Sjkh	@echo "--------------------------------------------------------------"
2062061Sjkh	@echo " Rebuilding ${DESTDIR} Compiler and Make"
2072061Sjkh	@echo "--------------------------------------------------------------"
2082061Sjkh	@echo
2092273Spaul	cd ${.CURDIR}/gnu/usr.bin/cc && \
2102061Sjkh		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
2112061Sjkh	cd ${.CURDIR}/usr.bin/make && \
2122061Sjkh		${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
2132061Sjkh
2141594Srgrimes.include <bsd.subdir.mk>
215