2 # $Id: Makefile,v 1.88 1996/06/28 05:36:00 phk 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 .if !target(pre-world)
110 world: pre-world hierarchy mk $(WORLD_CLEANDIST) bootstrap include-tools includes lib-tools libraries build-tools
111 @echo "--------------------------------------------------------------"
112 @echo " Rebuilding ${DESTDIR} The whole thing"
113 @echo "--------------------------------------------------------------"
115 cd ${.CURDIR} && ${MAKE} depend all install
116 cd ${.CURDIR}/share/man && ${MAKE} makedb
117 .if target(post-world)
118 cd ${.CURDIR} && ${MAKE} post-world
120 @echo "make world completed on `date`"
123 cd ${.CURDIR}/usr.bin/make && ${MAKE} ${MK_FLAGS} all install
124 cd ${.CURDIR}/usr.bin/xlint && ${MAKE} ${MK_FLAGS} lint1 lint2 xlint
125 cd ${.CURDIR}/usr.bin/xlint/lint1 && ${MAKE} ${MK_FLAGS} install
126 cd ${.CURDIR}/usr.bin/xlint/lint2 && ${MAKE} ${MK_FLAGS} install
127 cd ${.CURDIR}/usr.bin/xlint/xlint && ${MAKE} ${MK_FLAGS} install
128 cd ${.CURDIR}/usr.bin/lex && ${MAKE} ${MK_FLAGS} bootstrap && \
129 ${MAKE} ${MK_FLAGS} all install
131 reinstall: hierarchy mk includes
132 @echo "--------------------------------------------------------------"
133 @echo " Reinstall ${DESTDIR} The whole thing"
134 @echo "--------------------------------------------------------------"
136 cd ${.CURDIR} && ${MAKE} install
137 cd ${.CURDIR}/share/man && ${MAKE} makedb
140 @echo "--------------------------------------------------------------"
141 @echo " Making hierarchy"
142 @echo "--------------------------------------------------------------"
143 cd ${.CURDIR}/etc && ${MAKE} distrib-dirs
146 .if defined(SUP_UPDATE)
147 @echo "--------------------------------------------------------------"
149 @echo "--------------------------------------------------------------"
151 .if defined(SUPFILE1)
154 .if defined(SUPFILE2)
158 .if defined(CVS_UPDATE)
159 @echo "--------------------------------------------------------------"
160 @echo "Updating /usr/src from cvs repository" ${CVSROOT}
161 @echo "--------------------------------------------------------------"
162 cd ${.CURDIR} && cvs -q update -P -d
166 .if !defined(NOCLEANDIR)
167 @echo "--------------------------------------------------------------"
168 @echo " Cleaning up the source tree, and rebuilding the obj tree"
169 @echo "--------------------------------------------------------------"
170 cd ${.CURDIR} && ${MAKE} cleandir
171 cd ${.CURDIR} && ${MAKE} obj
175 @echo "--------------------------------------------------------------"
176 @echo " Installing programs only"
177 @echo "--------------------------------------------------------------"
178 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} install
179 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} install
180 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} install
181 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} install
182 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
183 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} install
184 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} install
185 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
186 #.if defined(MAKE_EBONES) && !defined(NOCRYPT)
187 # cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} installmost
189 #.if !defined(NOSECURE) && !defined(NOCRYPT)
190 # cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} installmost
194 @echo "--------------------------------------------------------------"
195 @echo " Building programs only"
196 @echo "--------------------------------------------------------------"
197 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} all
198 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} all
199 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} all
200 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} all
201 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
202 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} all
203 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} all
204 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
205 #.if defined(MAKE_EBONES) && !defined(NOCRYPT)
206 # cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} most
208 #.if !defined(NOSECURE) && !defined(NOCRYPT)
209 # cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} most
213 @echo "--------------------------------------------------------------"
214 @echo " Rebuilding ${DESTDIR}/usr/share/mk"
215 @echo "--------------------------------------------------------------"
216 cd ${.CURDIR}/share/mk && ${MAKE} install
219 @echo "--------------------------------------------------------------"
220 @echo " Rebuilding ${DESTDIR}/usr/include"
221 @echo "--------------------------------------------------------------"
224 rm -rf ${DESTDIR}/usr/include/*
225 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
226 -p ${DESTDIR}/usr/include
228 cd ${.CURDIR}/include && ${MAKE} install
229 cd ${.CURDIR}/gnu/include && ${MAKE} install
230 cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
231 cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall
232 cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
233 cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
234 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
235 cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall
236 cd ${.CURDIR}/eBones/lib/libkrb && ${MAKE} beforeinstall
237 cd ${.CURDIR}/eBones/lib/libkadm && ${MAKE} beforeinstall
239 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
240 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
241 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
242 cd ${.CURDIR}/lib/libftpio && ${MAKE} beforeinstall
243 cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall
244 cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall
245 cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall
246 .if !defined(WANT_CSRG_LIBM)
247 cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall
249 cd ${.CURDIR}/lib/libpcap && ${MAKE} beforeinstall
250 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
251 cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall
252 cd ${.CURDIR}/lib/libtcl && ${MAKE} beforeinstall
253 cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall
254 cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall
255 cd ${.CURDIR}/lib/libss && ${MAKE} beforeinstall
256 cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall
257 cd ${.CURDIR}/lib/libutil && ${MAKE} beforeinstall
260 @echo "--------------------------------------------------------------"
261 @echo " Rebuilding tools needed to build the libraries"
262 @echo "--------------------------------------------------------------"
264 cd ${.CURDIR}/usr.bin/xinstall && \
265 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
266 cd ${.CURDIR}/gnu/usr.bin/ld && \
267 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
268 cd ${.CURDIR}/usr.bin/ar && \
269 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
270 cd ${.CURDIR}/usr.bin/ranlib && \
271 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
272 cd ${.CURDIR}/usr.bin/nm && \
273 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
274 cd ${.CURDIR}/usr.bin/lex/lib && \
275 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
276 cd ${.CURDIR}/usr.bin/compile_et && \
277 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR} && \
278 rm -f /usr/sbin/compile_et
279 cd ${.CURDIR}/usr.bin/mk_cmds && \
280 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
283 @echo "--------------------------------------------------------------"
284 @echo " Rebuilding ${DESTDIR}/usr/lib"
285 @echo "--------------------------------------------------------------"
287 .if exists(lib/libcompat)
288 cd ${.CURDIR}/lib/libcompat && \
289 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
291 .if exists(lib/libncurses)
292 cd ${.CURDIR}/lib/libncurses && \
293 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
295 .if exists(lib/libtermcap)
296 cd ${.CURDIR}/lib/libtermcap && \
297 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
300 cd ${.CURDIR}/gnu/lib && \
301 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
302 cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
303 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
305 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
306 cd ${.CURDIR}/secure/lib && \
307 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
310 cd ${.CURDIR}/lib/csu/i386 && \
311 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
312 cd ${.CURDIR}/lib && \
313 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
315 .if exists(usr.sbin/lex/lib)
316 cd ${.CURDIR}/usr.bin/lex/lib && \
317 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
319 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
320 cd ${.CURDIR}/eBones/lib && \
321 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
323 .if exists(usr.sbin/pcvt/keycap)
324 cd ${.CURDIR}/usr.sbin/pcvt/keycap && \
325 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
329 @echo "--------------------------------------------------------------"
330 @echo " Rebuild tools necessary to build the include files"
331 @echo "--------------------------------------------------------------"
333 cd ${.CURDIR}/usr.bin/xinstall && \
334 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
335 cd ${.CURDIR}/usr.bin/rpcgen && \
336 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
339 @echo "--------------------------------------------------------------"
340 @echo " Rebuilding ${DESTDIR} C compiler, make, symorder, sgmlfmt and zic(8)"
341 @echo "--------------------------------------------------------------"
343 cd ${.CURDIR}/gnu/usr.bin/cc && \
344 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
345 cd ${.CURDIR}/usr.bin/make && \
346 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
347 cd ${.CURDIR}/usr.bin/symorder && \
348 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
349 cd ${.CURDIR}/usr.bin/sgmlfmt && \
350 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
351 cd ${.CURDIR}/share/sgml && \
352 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
353 cd ${.CURDIR}/usr.sbin/zic && \
354 ${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
356 .include <bsd.subdir.mk>