2 # $Id: Makefile,v 1.22 1994/09/29 13:06:46 csgr 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 # XXX1 -DMAKE_KERBEROS to build KerberosIV
9 # -DMAKE_EBONES to build eBones (KerberosIV)
11 # -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
12 # -DNOCRYPT will prevent building of crypt versions
13 # -DNOLKM do not build loadable kernel modules
14 # -DNOOBJDIR do not run ``${MAKE} obj''
15 # -DNOPROFILE do not build profiled libraries
16 # -DNOSECURE do not go into secure subdir
19 # XXX1 The kerberos IV off the 4.4-Lite tape (src/kerberosIV)
20 # will not build successfully yet. MAKE_KERBEROS should not be
23 # Put initial settings here.
33 # XXX until etc vs release conversion is done
48 .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
51 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
72 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
75 .if exists(lkm) && !defined(NOLKM)
79 # These are last, since it is nice to at least get the base system
80 # rebuilt before you do them.
81 .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
84 .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
88 # Handle the -DNOOBJDIR and -DNOCLEANDIR
94 .if defined(NOCLEANDIR)
100 world: hierarchy cleandist mk includes libraries tools
101 @echo "--------------------------------------------------------------"
102 @echo " Rebuilding ${DESTDIR} The whole thing"
103 @echo "--------------------------------------------------------------"
105 ${MAKE} depend all install
106 cd ${.CURDIR}/share/man && ${MAKE} makedb
110 @echo "--------------------------------------------------------------"
111 @echo " Making hierarchy"
112 @echo "--------------------------------------------------------------"
113 cd ${.CURDIR}/release && ${MAKE} hierarchy
116 .if defined(SUP_UPDATE)
117 @echo "--------------------------------------------------------------"
119 @echo "--------------------------------------------------------------"
122 .if defined(CVS_UPDATE)
123 @echo "--------------------------------------------------------------"
124 @echo "Updating /usr/src from cvs repository" ${CVSROOT}
125 @echo "--------------------------------------------------------------"
126 cd ${.CURDIR} && cvs update -P -d
130 .if !defined(NOCLEANDIR)
131 @echo "--------------------------------------------------------------"
132 @echo " Cleaning up the source tree, and rebuilding the obj tree"
133 @echo "--------------------------------------------------------------"
135 here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
136 if test -d /usr/obj -a ! -d $$dest; then \
141 cd $$dest && rm -rf ${SUBDIR}
142 find . -name obj | xargs rm -rf
143 .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
144 # The cd is done as local may well be a symbolic link
145 -cd local && find . -name obj | xargs rm -rf
147 .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
148 # The cd is done as local may well be a symbolic link
149 -cd ports && find . -name obj | xargs rm -rf
156 @echo "--------------------------------------------------------------"
157 @echo " Rebuilding ${DESTDIR}/usr/share/mk"
158 @echo "--------------------------------------------------------------"
159 cd ${.CURDIR}/share/mk && ${MAKE} install
162 @echo "--------------------------------------------------------------"
163 @echo " Rebuilding ${DESTDIR}/usr/include"
164 @echo "--------------------------------------------------------------"
167 rm -rf ${DESTDIR}/usr/include
168 mkdir ${DESTDIR}/usr/include
169 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include
170 chmod 755 ${DESTDIR}/usr/include
172 cd ${.CURDIR}/include && ${MAKE} install
173 cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
174 cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
175 .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
176 cd ${.CURDIR}/kerberosIV/include && ${MAKE} install
178 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
179 cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall
181 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
182 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
183 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
184 cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall
185 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
186 cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall
189 @echo "--------------------------------------------------------------"
190 @echo " Rebuilding ${DESTDIR}/usr/lib"
191 @echo "--------------------------------------------------------------"
194 find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \
197 cd ${.CURDIR}/gnu/lib && \
198 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
199 cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
200 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
201 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
202 cd ${.CURDIR}/secure/lib && \
203 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
206 cd ${.CURDIR}/lib && \
207 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
209 cd ${.CURDIR}/usr.bin/lex/lib && \
210 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
211 .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
212 cd ${.CURDIR}/kerberosIV/acl && \
213 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
214 cd ${.CURDIR}/kerberosIV/des && \
215 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
216 cd ${.CURDIR}/kerberosIV/kdb && \
217 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
218 cd ${.CURDIR}/kerberosIV/krb && \
219 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
221 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
222 cd ${.CURDIR}/eBones/des && \
223 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
224 cd ${.CURDIR}/eBones/acl && \
225 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
226 cd ${.CURDIR}/eBones/kdb && \
227 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
228 cd ${.CURDIR}/eBones/krb && \
229 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
233 @echo "--------------------------------------------------------------"
234 @echo " Rebuilding ${DESTDIR} Compiler and Make"
235 @echo "--------------------------------------------------------------"
237 cd ${.CURDIR}/gnu/usr.bin/cc && \
238 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
239 cd ${.CURDIR}/usr.bin/make && \
240 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
242 .include <bsd.subdir.mk>