2 # $Id: Makefile,v 1.78 1996/03/24 13:16:45 paul Exp $
4 # Make command line options:
5 # -DCLOBBER will remove /usr/include
6 # -DMAKE_LOCAL to add ./local to the SUBDIR list
7 # -DMAKE_PORTS to add ./ports to the SUBDIR list
8 # -DMAKE_EBONES to build eBones (KerberosIV)
10 # -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
11 # -DNOCLEAN do not clean at all
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
18 # Put initial settings here.
21 # We must do include and lib first so that the perl *.ph generation
22 # works correctly as it uses the header files installed by this.
42 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
63 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
66 .if exists(lkm) && !defined(NOLKM)
70 # etc must be last for "distribute" to work
71 .if exists(etc) && make(distribute)
75 # These are last, since it is nice to at least get the base system
76 # rebuilt before you do them.
77 .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
80 .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
84 # Handle the -DNOOBJDIR and -DNOCLEANDIR
95 WORLD_CLEANDIST=cleandist
96 .if defined(NOCLEANDIR)
103 MK_FLAGS= -DNOMAN -DNOPROFILE
105 world: hierarchy mk $(WORLD_CLEANDIST) bootstrap include-tools includes lib-tools libraries build-tools
106 @echo "--------------------------------------------------------------"
107 @echo " Rebuilding ${DESTDIR} The whole thing"
108 @echo "--------------------------------------------------------------"
110 ${MAKE} depend all install
111 cd ${.CURDIR}/share/man && ${MAKE} makedb
112 @echo "make world completed on `date`"
115 cd ${.CURDIR}/usr.bin/xlint && ${MAKE} ${MK_FLAGS} lint1 lint2 xlint
116 cd ${.CURDIR}/usr.bin/xlint/lint1 && ${MAKE} ${MK_FLAGS} install
117 cd ${.CURDIR}/usr.bin/xlint/lint2 && ${MAKE} ${MK_FLAGS} install
118 cd ${.CURDIR}/usr.bin/xlint/xlint && ${MAKE} ${MK_FLAGS} install
120 reinstall: hierarchy mk includes
121 @echo "--------------------------------------------------------------"
122 @echo " Reinstall ${DESTDIR} The whole thing"
123 @echo "--------------------------------------------------------------"
126 cd ${.CURDIR}/share/man && ${MAKE} makedb
129 @echo "--------------------------------------------------------------"
130 @echo " Making hierarchy"
131 @echo "--------------------------------------------------------------"
132 cd ${.CURDIR}/etc && ${MAKE} distrib-dirs
135 .if defined(SUP_UPDATE)
136 @echo "--------------------------------------------------------------"
138 @echo "--------------------------------------------------------------"
140 .if defined(SUPFILE1)
143 .if defined(SUPFILE2)
147 .if defined(CVS_UPDATE)
148 @echo "--------------------------------------------------------------"
149 @echo "Updating /usr/src from cvs repository" ${CVSROOT}
150 @echo "--------------------------------------------------------------"
151 cd ${.CURDIR} && cvs update -P -d
155 .if !defined(NOCLEANDIR)
156 @echo "--------------------------------------------------------------"
157 @echo " Cleaning up the source tree, and rebuilding the obj tree"
158 @echo "--------------------------------------------------------------"
160 here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
161 if test -d /usr/obj -a ! -d $$dest; then \
166 cd $$dest && rm -rf ${SUBDIR}
167 find . -name obj | xargs rm -rf
168 .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
169 # The cd is done as local may well be a symbolic link
170 -cd local && find . -name obj | xargs rm -rf
172 .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
173 # The cd is done as local may well be a symbolic link
174 -cd ports && find . -name obj | xargs rm -rf
181 @echo "--------------------------------------------------------------"
182 @echo " Installing programs only"
183 @echo "--------------------------------------------------------------"
184 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} install
185 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} install
186 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} install
187 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} install
188 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
189 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} install
190 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} install
191 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
192 #.if defined(MAKE_EBONES) && !defined(NOCRYPT)
193 # cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} installmost
195 #.if !defined(NOSECURE) && !defined(NOCRYPT)
196 # cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} installmost
200 @echo "--------------------------------------------------------------"
201 @echo " Building programs only"
202 @echo "--------------------------------------------------------------"
203 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} all
204 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} all
205 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} all
206 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} all
207 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
208 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} all
209 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} all
210 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
211 #.if defined(MAKE_EBONES) && !defined(NOCRYPT)
212 # cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} most
214 #.if !defined(NOSECURE) && !defined(NOCRYPT)
215 # cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} most
219 @echo "--------------------------------------------------------------"
220 @echo " Rebuilding ${DESTDIR}/usr/share/mk"
221 @echo "--------------------------------------------------------------"
222 cd ${.CURDIR}/share/mk && ${MAKE} install
225 @echo "--------------------------------------------------------------"
226 @echo " Rebuilding ${DESTDIR}/usr/include"
227 @echo "--------------------------------------------------------------"
230 rm -rf ${DESTDIR}/usr/include/*
231 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
232 -p ${DESTDIR}/usr/include
234 cd ${.CURDIR}/include && ${MAKE} install
235 cd ${.CURDIR}/gnu/include && ${MAKE} install
236 cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
237 cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall
238 cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
239 cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
240 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
241 cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall
242 cd ${.CURDIR}/eBones/lib/libkrb && ${MAKE} beforeinstall
243 cd ${.CURDIR}/eBones/lib/libkadm && ${MAKE} beforeinstall
245 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
246 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
247 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
248 cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall
249 cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall
250 cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall
251 .if !defined(WANT_CSRG_LIBM)
252 cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall
254 cd ${.CURDIR}/lib/libpcap && ${MAKE} beforeinstall
255 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
256 cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall
257 cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall
258 cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall
259 cd ${.CURDIR}/lib/libss && ${MAKE} beforeinstall
260 cd ${.CURDIR}/lib/libforms && ${MAKE} beforeinstall
261 cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall
262 cd ${.CURDIR}/lib/libutil && ${MAKE} beforeinstall
265 @echo "--------------------------------------------------------------"
266 @echo " Rebuilding tools needed to build the libraries"
267 @echo "--------------------------------------------------------------"
269 cd ${.CURDIR}/usr.bin/xinstall && \
270 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
271 cd ${.CURDIR}/gnu/usr.bin/ld && \
272 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
273 cd ${.CURDIR}/usr.bin/ar && \
274 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
275 cd ${.CURDIR}/usr.bin/ranlib && \
276 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
277 cd ${.CURDIR}/usr.bin/nm && \
278 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
279 cd ${.CURDIR}/usr.bin/lex/lib && \
280 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
281 cd ${.CURDIR}/usr.bin/compile_et && \
282 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR} && \
283 rm -f /usr/sbin/compile_et
284 cd ${.CURDIR}/usr.bin/mk_cmds && \
285 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
288 @echo "--------------------------------------------------------------"
289 @echo " Rebuilding ${DESTDIR}/usr/lib"
290 @echo "--------------------------------------------------------------"
292 .if exists(lib/libcompat)
293 cd ${.CURDIR}/lib/libcompat && \
294 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
296 .if exists(lib/libncurses)
297 cd ${.CURDIR}/lib/libncurses && \
298 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
300 .if exists(lib/libtermcap)
301 cd ${.CURDIR}/lib/libtermcap && \
302 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
305 cd ${.CURDIR}/gnu/lib && \
306 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
307 cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
308 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
310 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
311 cd ${.CURDIR}/secure/lib && \
312 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
315 cd ${.CURDIR}/lib/csu/i386 && \
316 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
317 cd ${.CURDIR}/lib && \
318 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
320 .if exists(usr.sbin/lex/lib)
321 cd ${.CURDIR}/usr.bin/lex/lib && \
322 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
324 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
325 cd ${.CURDIR}/eBones/lib && \
326 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
328 .if exists(usr.sbin/pcvt/keycap)
329 cd ${.CURDIR}/usr.sbin/pcvt/keycap && \
330 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
334 @echo "--------------------------------------------------------------"
335 @echo " Rebuild tools necessary to build the include files"
336 @echo "--------------------------------------------------------------"
338 cd ${.CURDIR}/usr.bin/xinstall && \
339 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
340 cd ${.CURDIR}/usr.bin/rpcgen && \
341 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
344 @echo "--------------------------------------------------------------"
345 @echo " Rebuilding ${DESTDIR} C compiler, make, symorder, sgmlfmt and zic(8)"
346 @echo "--------------------------------------------------------------"
348 cd ${.CURDIR}/gnu/usr.bin/cc && \
349 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
350 cd ${.CURDIR}/usr.bin/make && \
351 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
352 cd ${.CURDIR}/usr.bin/symorder && \
353 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
354 cd ${.CURDIR}/usr.bin/sgmlfmt && \
355 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
356 cd ${.CURDIR}/share/sgml && \
357 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
358 cd ${.CURDIR}/usr.sbin/zic && \
359 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
361 .include <bsd.subdir.mk>