2 # $Id: Makefile,v 1.29 1994/11/08 00:55:08 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.
26 # Must be first for "distribute" to work
49 .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
52 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
73 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
76 .if exists(lkm) && !defined(NOLKM)
80 # etc must be last for "distribute" to work
81 .if exists(etc) && make(distribute)
85 # These are last, since it is nice to at least get the base system
86 # rebuilt before you do them.
87 .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
90 .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
94 # Handle the -DNOOBJDIR and -DNOCLEANDIR
100 .if defined(NOCLEANDIR)
106 world: hierarchy cleandist mk includes libraries tools
107 @echo "--------------------------------------------------------------"
108 @echo " Rebuilding ${DESTDIR} The whole thing"
109 @echo "--------------------------------------------------------------"
111 ${MAKE} depend all install
112 cd ${.CURDIR}/share/man && ${MAKE} makedb
116 @echo "--------------------------------------------------------------"
117 @echo " Making hierarchy"
118 @echo "--------------------------------------------------------------"
119 cd ${.CURDIR}/release && ${MAKE} hierarchy
122 .if defined(SUP_UPDATE)
123 @echo "--------------------------------------------------------------"
125 @echo "--------------------------------------------------------------"
128 .if defined(CVS_UPDATE)
129 @echo "--------------------------------------------------------------"
130 @echo "Updating /usr/src from cvs repository" ${CVSROOT}
131 @echo "--------------------------------------------------------------"
132 cd ${.CURDIR} && cvs update -P -d
136 .if !defined(NOCLEANDIR)
137 @echo "--------------------------------------------------------------"
138 @echo " Cleaning up the source tree, and rebuilding the obj tree"
139 @echo "--------------------------------------------------------------"
141 here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
142 if test -d /usr/obj -a ! -d $$dest; then \
147 cd $$dest && rm -rf ${SUBDIR}
148 find . -name obj | xargs rm -rf
149 .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
150 # The cd is done as local may well be a symbolic link
151 -cd local && find . -name obj | xargs rm -rf
153 .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
154 # The cd is done as local may well be a symbolic link
155 -cd ports && find . -name obj | xargs rm -rf
162 @echo "--------------------------------------------------------------"
163 @echo " Installing programs only"
164 @echo "--------------------------------------------------------------"
165 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} install
166 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} install
167 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} install
168 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} install
169 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
170 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} install
171 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} install
172 #.if defined(MAKE_EBONES) && !defined(NOCRYPT)
173 # cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} installmost
175 #.if !defined(NOSECURE) && !defined(NOCRYPT)
176 # cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} installmost
180 @echo "--------------------------------------------------------------"
181 @echo " Building programs only"
182 @echo "--------------------------------------------------------------"
183 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} all
184 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} all
185 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} all
186 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} all
187 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
188 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} all
189 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} all
190 #.if defined(MAKE_EBONES) && !defined(NOCRYPT)
191 # cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} most
193 #.if !defined(NOSECURE) && !defined(NOCRYPT)
194 # cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} most
198 @echo "--------------------------------------------------------------"
199 @echo " Rebuilding ${DESTDIR}/usr/share/mk"
200 @echo "--------------------------------------------------------------"
201 cd ${.CURDIR}/share/mk && ${MAKE} install
204 @echo "--------------------------------------------------------------"
205 @echo " Rebuilding ${DESTDIR}/usr/include"
206 @echo "--------------------------------------------------------------"
209 rm -rf ${DESTDIR}/usr/include
210 mkdir ${DESTDIR}/usr/include
211 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include
212 chmod 755 ${DESTDIR}/usr/include
214 cd ${.CURDIR}/include && ${MAKE} install
215 cd ${.CURDIR}/gnu/include && ${MAKE} install
216 cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
217 cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
218 cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
219 .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
220 cd ${.CURDIR}/kerberosIV/include && ${MAKE} install
222 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
223 cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall
225 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
226 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
227 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
228 cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall
229 cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall
230 cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall
231 .if defined(WANT_MSUN)
232 cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall
234 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
235 cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall
238 @echo "--------------------------------------------------------------"
239 @echo " Rebuilding ${DESTDIR}/usr/lib"
240 @echo "--------------------------------------------------------------"
243 find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \
246 cd ${.CURDIR}/gnu/lib && \
247 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
248 cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
249 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
250 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
251 cd ${.CURDIR}/secure/lib && \
252 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
255 cd ${.CURDIR}/lib/csu/i386 && \
256 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
257 cd ${.CURDIR}/lib && \
258 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
260 cd ${.CURDIR}/usr.bin/lex/lib && \
261 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
262 .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
263 cd ${.CURDIR}/kerberosIV/acl && \
264 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
265 cd ${.CURDIR}/kerberosIV/des && \
266 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
267 cd ${.CURDIR}/kerberosIV/kdb && \
268 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
269 cd ${.CURDIR}/kerberosIV/krb && \
270 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
272 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
273 cd ${.CURDIR}/eBones/des && \
274 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
275 cd ${.CURDIR}/eBones/acl && \
276 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
277 cd ${.CURDIR}/eBones/kdb && \
278 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
279 cd ${.CURDIR}/eBones/krb && \
280 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
284 @echo "--------------------------------------------------------------"
285 @echo " Rebuilding ${DESTDIR} Compiler and Make"
286 @echo "--------------------------------------------------------------"
288 cd ${.CURDIR}/gnu/usr.bin/cc && \
289 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
290 cd ${.CURDIR}/usr.bin/make && \
291 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
293 .include <bsd.subdir.mk>