2 # $Id: Makefile,v 1.30 1994/11/14 20:52:54 phk 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
236 cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall
239 @echo "--------------------------------------------------------------"
240 @echo " Rebuilding ${DESTDIR}/usr/lib"
241 @echo "--------------------------------------------------------------"
244 find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \
247 cd ${.CURDIR}/gnu/lib && \
248 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
249 cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
250 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
251 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
252 cd ${.CURDIR}/secure/lib && \
253 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
256 cd ${.CURDIR}/lib/csu/i386 && \
257 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
258 cd ${.CURDIR}/lib && \
259 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
261 cd ${.CURDIR}/usr.bin/lex/lib && \
262 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
263 .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
264 cd ${.CURDIR}/kerberosIV/acl && \
265 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
266 cd ${.CURDIR}/kerberosIV/des && \
267 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
268 cd ${.CURDIR}/kerberosIV/kdb && \
269 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
270 cd ${.CURDIR}/kerberosIV/krb && \
271 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
273 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
274 cd ${.CURDIR}/eBones/des && \
275 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
276 cd ${.CURDIR}/eBones/acl && \
277 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
278 cd ${.CURDIR}/eBones/kdb && \
279 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
280 cd ${.CURDIR}/eBones/krb && \
281 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
285 @echo "--------------------------------------------------------------"
286 @echo " Rebuilding ${DESTDIR} Compiler and Make"
287 @echo "--------------------------------------------------------------"
289 cd ${.CURDIR}/gnu/usr.bin/cc && \
290 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
291 cd ${.CURDIR}/usr.bin/make && \
292 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
294 .include <bsd.subdir.mk>