2 # $Id: Makefile,v 1.26 1994/10/11 23:33:00 ache 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 " Installing programs only"
158 @echo "--------------------------------------------------------------"
159 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} install
160 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} install
161 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} install
162 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} install
163 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
164 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} install
165 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} install
166 #.if defined(MAKE_EBONES) && !defined(NOCRYPT)
167 # cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} installmost
169 #.if !defined(NOSECURE) && !defined(NOCRYPT)
170 # cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} installmost
174 @echo "--------------------------------------------------------------"
175 @echo " Building programs only"
176 @echo "--------------------------------------------------------------"
177 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} all
178 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} all
179 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} all
180 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} all
181 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
182 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} all
183 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} all
184 #.if defined(MAKE_EBONES) && !defined(NOCRYPT)
185 # cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} most
187 #.if !defined(NOSECURE) && !defined(NOCRYPT)
188 # cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} most
192 @echo "--------------------------------------------------------------"
193 @echo " Rebuilding ${DESTDIR}/usr/share/mk"
194 @echo "--------------------------------------------------------------"
195 cd ${.CURDIR}/share/mk && ${MAKE} install
198 @echo "--------------------------------------------------------------"
199 @echo " Rebuilding ${DESTDIR}/usr/include"
200 @echo "--------------------------------------------------------------"
203 rm -rf ${DESTDIR}/usr/include
204 mkdir ${DESTDIR}/usr/include
205 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include
206 chmod 755 ${DESTDIR}/usr/include
208 cd ${.CURDIR}/include && ${MAKE} install
209 cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
210 cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
211 cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
212 .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
213 cd ${.CURDIR}/kerberosIV/include && ${MAKE} install
215 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
216 cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall
218 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
219 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
220 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
221 cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall
222 cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall
223 cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall
224 .if defined(WANT_MSUN)
225 cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall
227 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
228 cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall
231 @echo "--------------------------------------------------------------"
232 @echo " Rebuilding ${DESTDIR}/usr/lib"
233 @echo "--------------------------------------------------------------"
236 find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \
239 cd ${.CURDIR}/gnu/lib && \
240 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
241 cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
242 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
243 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
244 cd ${.CURDIR}/secure/lib && \
245 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
248 cd ${.CURDIR}/lib && \
249 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
251 cd ${.CURDIR}/usr.bin/lex/lib && \
252 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
253 .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
254 cd ${.CURDIR}/kerberosIV/acl && \
255 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
256 cd ${.CURDIR}/kerberosIV/des && \
257 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
258 cd ${.CURDIR}/kerberosIV/kdb && \
259 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
260 cd ${.CURDIR}/kerberosIV/krb && \
261 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
263 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
264 cd ${.CURDIR}/eBones/des && \
265 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
266 cd ${.CURDIR}/eBones/acl && \
267 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
268 cd ${.CURDIR}/eBones/kdb && \
269 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
270 cd ${.CURDIR}/eBones/krb && \
271 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
275 @echo "--------------------------------------------------------------"
276 @echo " Rebuilding ${DESTDIR} Compiler and Make"
277 @echo "--------------------------------------------------------------"
279 cd ${.CURDIR}/gnu/usr.bin/cc && \
280 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
281 cd ${.CURDIR}/usr.bin/make && \
282 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
284 .include <bsd.subdir.mk>