2 # $Id: Makefile,v 1.51 1995/03/27 01:31:09 rgrimes 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 # -DMAKE_EBONES to build eBones (KerberosIV)
10 # -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
11 # -DNOCRYPT will prevent building of crypt versions
12 # -DNOLKM do not build loadable kernel modules
13 # -DNOOBJDIR do not run ``${MAKE} obj''
14 # -DNOPROFILE do not build profiled libraries
15 # -DNOSECURE do not go into secure subdir
17 # Put initial settings here.
20 # We must do include and lib first so that the perl *.ph generation
21 # works correctly as it uses the header files installed by this.
41 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
62 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
65 .if exists(lkm) && !defined(NOLKM)
69 # etc must be last for "distribute" to work
70 .if exists(etc) && make(distribute)
74 # These are last, since it is nice to at least get the base system
75 # rebuilt before you do them.
76 .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
79 .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
83 # Handle the -DNOOBJDIR and -DNOCLEANDIR
89 .if defined(NOCLEANDIR)
95 world: hierarchy mk cleandist includes lib-tools libraries tools
96 @echo "--------------------------------------------------------------"
97 @echo " Rebuilding ${DESTDIR} The whole thing"
98 @echo "--------------------------------------------------------------"
100 ${MAKE} depend all install
101 cd ${.CURDIR}/share/man && ${MAKE} makedb
104 @echo "--------------------------------------------------------------"
105 @echo " Making hierarchy"
106 @echo "--------------------------------------------------------------"
107 cd ${.CURDIR}/etc && ${MAKE} distrib-dirs
110 .if defined(SUP_UPDATE)
111 @echo "--------------------------------------------------------------"
113 @echo "--------------------------------------------------------------"
116 .if defined(CVS_UPDATE)
117 @echo "--------------------------------------------------------------"
118 @echo "Updating /usr/src from cvs repository" ${CVSROOT}
119 @echo "--------------------------------------------------------------"
120 cd ${.CURDIR} && cvs update -P -d
124 .if !defined(NOCLEANDIR)
125 @echo "--------------------------------------------------------------"
126 @echo " Cleaning up the source tree, and rebuilding the obj tree"
127 @echo "--------------------------------------------------------------"
129 here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
130 if test -d /usr/obj -a ! -d $$dest; then \
135 cd $$dest && rm -rf ${SUBDIR}
136 find . -name obj | xargs rm -rf
137 .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
138 # The cd is done as local may well be a symbolic link
139 -cd local && find . -name obj | xargs rm -rf
141 .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
142 # The cd is done as local may well be a symbolic link
143 -cd ports && find . -name obj | xargs rm -rf
150 @echo "--------------------------------------------------------------"
151 @echo " Installing programs only"
152 @echo "--------------------------------------------------------------"
153 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} install
154 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} install
155 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} install
156 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} install
157 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
158 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} install
159 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} install
160 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
161 #.if defined(MAKE_EBONES) && !defined(NOCRYPT)
162 # cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} installmost
164 #.if !defined(NOSECURE) && !defined(NOCRYPT)
165 # cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} installmost
169 @echo "--------------------------------------------------------------"
170 @echo " Building programs only"
171 @echo "--------------------------------------------------------------"
172 cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} all
173 cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} all
174 cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} all
175 cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} all
176 cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
177 cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} all
178 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} all
179 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
180 #.if defined(MAKE_EBONES) && !defined(NOCRYPT)
181 # cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} most
183 #.if !defined(NOSECURE) && !defined(NOCRYPT)
184 # cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} most
188 @echo "--------------------------------------------------------------"
189 @echo " Rebuilding ${DESTDIR}/usr/share/mk"
190 @echo "--------------------------------------------------------------"
191 cd ${.CURDIR}/share/mk && ${MAKE} install
194 @echo "--------------------------------------------------------------"
195 @echo " Rebuilding ${DESTDIR}/usr/include"
196 @echo "--------------------------------------------------------------"
199 rm -rf ${DESTDIR}/usr/include/*
200 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
201 -p ${DESTDIR}/usr/include
203 cd ${.CURDIR}/include && ${MAKE} install
204 cd ${.CURDIR}/gnu/include && ${MAKE} install
205 cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
206 cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall
207 cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
208 cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
209 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
210 cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall
212 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
213 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
214 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
215 cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall
216 cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall
217 cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall
218 .if !defined(WANT_CSRG_LIBM)
219 cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall
221 cd ${.CURDIR}/lib/libpcap && ${MAKE} beforeinstall
222 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
223 cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall
224 cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall
225 cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall
226 cd ${.CURDIR}/lib/libss && ${MAKE} beforeinstall
227 cd ${.CURDIR}/lib/libforms && ${MAKE} beforeinstall
228 cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall
231 @echo "--------------------------------------------------------------"
232 @echo " Rebuilding tools needed to build the libraries"
233 @echo "--------------------------------------------------------------"
235 cd ${.CURDIR}/gnu/usr.bin/ld && \
236 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
237 cd ${.CURDIR}/usr.bin/ar && \
238 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
239 cd ${.CURDIR}/usr.bin/ranlib && \
240 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
241 cd ${.CURDIR}/usr.bin/nm && \
242 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
243 cd ${.CURDIR}/usr.bin/lex/lib && \
244 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
245 cd ${.CURDIR}/usr.bin/compile_et && \
246 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR} && \
247 rm -f /usr/sbin/compile_et
248 cd ${.CURDIR}/usr.bin/mk_cmds && \
249 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
252 @echo "--------------------------------------------------------------"
253 @echo " Rebuilding ${DESTDIR}/usr/lib"
254 @echo "--------------------------------------------------------------"
257 find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \
260 cd ${.CURDIR}/gnu/lib && \
261 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
262 cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
263 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
264 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
265 cd ${.CURDIR}/secure/lib && \
266 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
269 cd ${.CURDIR}/lib/csu/i386 && \
270 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
271 cd ${.CURDIR}/lib && \
272 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
274 cd ${.CURDIR}/usr.bin/lex/lib && \
275 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
276 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
277 cd ${.CURDIR}/eBones/des && \
278 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
279 cd ${.CURDIR}/eBones/acl && \
280 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
281 cd ${.CURDIR}/eBones/kdb && \
282 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
283 cd ${.CURDIR}/eBones/krb && \
284 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
288 @echo "--------------------------------------------------------------"
289 @echo " Rebuilding ${DESTDIR} Compiler and Make"
290 @echo "--------------------------------------------------------------"
292 cd ${.CURDIR}/gnu/usr.bin/cc && \
293 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
294 cd ${.CURDIR}/usr.bin/make && \
295 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
297 .include <bsd.subdir.mk>