]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - Makefile
Obtained from: my old fix for 1.1.5
[FreeBSD/FreeBSD.git] / Makefile
1 #
2 #       $Id: Makefile,v 1.30 1994/11/14 20:52:54 phk Exp $
3 #
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)
10 #
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
17 #
18 #
19 # XXX1  The kerberos IV off the 4.4-Lite tape (src/kerberosIV)
20 #       will not build successfully yet.  MAKE_KERBEROS should not be
21 #       defined.
22
23 # Put initial settings here.
24 SUBDIR=
25
26 # Must be first for "distribute" to work
27 .if exists(release)
28 SUBDIR+= release
29 .endif
30
31 .if exists(bin)
32 SUBDIR+= bin
33 .endif
34 .if exists(contrib)
35 SUBDIR+= contrib
36 .endif
37 .if exists(games)
38 SUBDIR+= games
39 .endif
40 .if exists(gnu)
41 SUBDIR+= gnu
42 .endif
43 .if exists(include)
44 SUBDIR+= include
45 .endif
46 .if exists(lib)
47 SUBDIR+= lib
48 .endif
49 .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
50 SUBDIR+= kerberosIV
51 .endif
52 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
53 SUBDIR+= eBones
54 .endif
55 .if exists(libexec)
56 SUBDIR+= libexec
57 .endif
58 .if exists(sbin)
59 SUBDIR+= sbin
60 .endif
61 .if exists(share)
62 SUBDIR+= share
63 .endif
64 .if exists(sys)
65 SUBDIR+= sys
66 .endif
67 .if exists(usr.bin)
68 SUBDIR+= usr.bin
69 .endif
70 .if exists(usr.sbin)
71 SUBDIR+= usr.sbin
72 .endif
73 .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
74 SUBDIR+= secure
75 .endif
76 .if exists(lkm) && !defined(NOLKM)
77 SUBDIR+= lkm
78 .endif
79
80 # etc must be last for "distribute" to work
81 .if exists(etc) && make(distribute)
82 SUBDIR+= etc
83 .endif
84
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)
88 SUBDIR+= local
89 .endif
90 .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
91 SUBDIR+= ports
92 .endif
93
94 # Handle the -DNOOBJDIR and -DNOCLEANDIR
95 .if defined(NOOBJDIR)
96 OBJDIR=
97 .else
98 OBJDIR=         obj
99 .endif
100 .if defined(NOCLEANDIR)
101 CLEANDIR=       clean
102 .else 
103 CLEANDIR=       cleandir
104 .endif
105
106 world:  hierarchy cleandist mk includes libraries tools
107         @echo "--------------------------------------------------------------"
108         @echo " Rebuilding ${DESTDIR} The whole thing"
109         @echo "--------------------------------------------------------------"
110         @echo
111         ${MAKE} depend all install
112         cd ${.CURDIR}/share/man &&              ${MAKE} makedb
113
114
115 hierarchy:
116         @echo "--------------------------------------------------------------"
117         @echo " Making hierarchy"
118         @echo "--------------------------------------------------------------"
119         cd ${.CURDIR}/release &&                ${MAKE} hierarchy
120
121 update:
122 .if defined(SUP_UPDATE)
123         @echo "--------------------------------------------------------------"
124         @echo "Running sup"
125         @echo "--------------------------------------------------------------"
126         @sup -v ${SUPFILE}
127 .endif
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
133 .endif
134
135 cleandist:
136 .if !defined(NOCLEANDIR)
137         @echo "--------------------------------------------------------------"
138         @echo " Cleaning up the source tree, and rebuilding the obj tree"
139         @echo "--------------------------------------------------------------"
140         @echo
141         here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
142         if test -d /usr/obj -a ! -d $$dest; then \
143                 mkdir -p $$dest; \
144         else \
145                 true; \
146         fi; \
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
152 .endif
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
156 .endif
157         ${MAKE} cleandir
158         ${MAKE} obj
159 .endif
160
161 installmost:
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
174 #.endif
175 #.if !defined(NOSECURE) && !defined(NOCRYPT)
176 #       cd ${.CURDIR}/secure    &&      ${MAKE} ${.MAKEFLAGS} installmost
177 #.endif
178
179 most:
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
192 #.endif
193 #.if !defined(NOSECURE) && !defined(NOCRYPT)
194 #       cd ${.CURDIR}/secure    &&      ${MAKE} ${.MAKEFLAGS} most
195 #.endif
196
197 mk:
198         @echo "--------------------------------------------------------------"
199         @echo " Rebuilding ${DESTDIR}/usr/share/mk"
200         @echo "--------------------------------------------------------------"
201         cd ${.CURDIR}/share/mk &&               ${MAKE} install
202
203 includes:
204         @echo "--------------------------------------------------------------"
205         @echo " Rebuilding ${DESTDIR}/usr/include"
206         @echo "--------------------------------------------------------------"
207         @echo
208 .if defined(CLOBBER)
209         rm -rf ${DESTDIR}/usr/include
210         mkdir ${DESTDIR}/usr/include
211         chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include
212         chmod 755 ${DESTDIR}/usr/include
213 .endif
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
221 .endif
222 .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
223         cd ${.CURDIR}/eBones/include &&         ${MAKE} beforeinstall
224 .endif
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
233 .endif
234         cd ${.CURDIR}/lib/librpcsvc &&          ${MAKE} beforeinstall
235         cd ${.CURDIR}/lib/libskey &&            ${MAKE} beforeinstall
236         cd ${.CURDIR}/lib/libtermcap &&         ${MAKE} beforeinstall
237
238 libraries:
239         @echo "--------------------------------------------------------------"
240         @echo " Rebuilding ${DESTDIR}/usr/lib"
241         @echo "--------------------------------------------------------------"
242         @echo
243 .if defined(CLOBBER)
244         find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \
245                 xargs rm -rf
246 .endif
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}
254 .endif
255 .if exists(lib)
256         cd ${.CURDIR}/lib/csu/i386 && \
257                 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
258         cd ${.CURDIR}/lib && \
259                 ${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
260 .endif
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}
272 .endif
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}
282 .endif
283
284 tools:
285         @echo "--------------------------------------------------------------"
286         @echo " Rebuilding ${DESTDIR} Compiler and Make"
287         @echo "--------------------------------------------------------------"
288         @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}
293
294 .include <bsd.subdir.mk>