2 # $Id: Makefile,v 1.14 1994/08/26 20:44:12 paul Exp $
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 # -DNOOBJDIR do not run ``${MAKE} obj''
12 # -DNOPROFILE do not build profiled libraries
13 # -DNOSECURE do not go into secure subdir
15 # XXX2 Mandatory, and Kerberos will not build sucessfully yet
17 # Put initial settings here.
42 .if exists(kerberosIV) && !defined(NOCRYPT) && !defined(NOKERBEROS)
51 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
67 # These are last, since it is nice to at least get the base system
68 # rebuilt before you do them.
69 .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
72 .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
76 # Handle the -DNOOBJDIR and -DNOCLEANDIR
82 .if defined(NOCLEANDIR)
88 world: directories cleandist mk includes libraries tools
89 @echo "--------------------------------------------------------------"
90 @echo " Rebuilding ${DESTDIR} The whole thing"
91 @echo "--------------------------------------------------------------"
93 ${MAKE} depend all install
94 cd ${.CURDIR}/share/man && ${MAKE} makedb
98 @echo "--------------------------------------------------------------"
99 @echo " Making directories"
100 @echo "--------------------------------------------------------------"
101 cd ${.CURDIR}/etc && ${MAKE} distrib-dirs
104 .if defined(SUP_UPDATE)
105 @echo "--------------------------------------------------------------"
107 @echo "--------------------------------------------------------------"
110 .if defined(CVS_UPDATE)
111 @echo "--------------------------------------------------------------"
112 @echo "Updating /usr/src from cvs repository" ${CVSROOT}
113 @echo "--------------------------------------------------------------"
114 cd ${.CURDIR} && cvs update -P -d
118 .if !defined(NOCLEANDIR)
119 @echo "--------------------------------------------------------------"
120 @echo " Cleaning up the source tree, and rebuilding the obj tree"
121 @echo "--------------------------------------------------------------"
123 here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
124 if test -d /usr/obj -a ! -d $$dest; then \
129 cd $$dest && rm -rf ${SUBDIR}
130 find . -name obj | xargs rm -rf
131 .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
132 # The cd is done as local may well be a symbolic link
133 -cd local && find . -name obj | xargs rm -rf
135 .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
136 # The cd is done as local may well be a symbolic link
137 -cd ports && find . -name obj | xargs rm -rf
144 @echo "--------------------------------------------------------------"
145 @echo " Rebuilding ${DESTDIR}/usr/share/mk"
146 @echo "--------------------------------------------------------------"
147 cd ${.CURDIR}/share/mk && ${MAKE} install
150 @echo "--------------------------------------------------------------"
151 @echo " Rebuilding ${DESTDIR}/usr/include"
152 @echo "--------------------------------------------------------------"
155 rm -rf ${DESTDIR}/usr/include
156 mkdir ${DESTDIR}/usr/include
157 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include
158 chmod 755 ${DESTDIR}/usr/include
160 cd ${.CURDIR}/include && ${MAKE} install
161 #XXX cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
162 #XXX cd ${.CURDIR}/gnu/usr.bin/cc/libobjc && ${MAKE} beforeinstall
163 .if !defined(NOCRYPT) && !defined(NOKERBEROS)
164 cd ${.CURDIR}/kerberosIV/include && ${MAKE} install
166 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
167 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
168 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
169 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
172 @echo "--------------------------------------------------------------"
173 @echo " Rebuilding ${DESTDIR}/usr/lib"
174 @echo "--------------------------------------------------------------"
177 find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \
180 cd ${.CURDIR}/gnu/lib && \
181 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
182 cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
183 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
184 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
185 cd ${.CURDIR}/secure/lib && \
186 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
189 cd ${.CURDIR}/lib && \
190 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
192 cd ${.CURDIR}/usr.bin/lex/lib && \
193 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
194 .if !defined(NOCRYPT) && !defined(NOKERBEROS)
195 cd ${.CURDIR}/kerberosIV/acl && \
196 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
197 cd ${.CURDIR}/kerberosIV/des && \
198 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
199 cd ${.CURDIR}/kerberosIV/kdb && \
200 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
201 cd ${.CURDIR}/kerberosIV/krb && \
202 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
206 @echo "--------------------------------------------------------------"
207 @echo " Rebuilding ${DESTDIR} Compiler and Make"
208 @echo "--------------------------------------------------------------"
210 cd ${.CURDIR}/gnu/usr.bin/cc && \
211 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
212 cd ${.CURDIR}/usr.bin/make && \
213 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
215 .include <bsd.subdir.mk>