Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | # @(#)Makefile 5.1.1.2 (Berkeley) 5/9/91 |
2 | # | |
9d92c587 | 3 | # $Id: Makefile,v 1.48 1994/05/10 23:12:33 jkh Exp $ |
15637ed4 RG |
4 | # |
5 | ||
f3babd4b RG |
6 | SUBDIR= |
7 | .if exists(bin) | |
8 | SUBDIR+= bin | |
9 | .endif | |
10 | .if exists(contrib) | |
11 | SUBDIR+= contrib | |
12 | .endif | |
13 | .if exists(games) | |
14 | SUBDIR+= games | |
15 | .endif | |
16 | .if exists(gnu) | |
17 | SUBDIR+= gnu | |
18 | .endif | |
19 | .if exists(include) | |
20 | SUBDIR+= include | |
21 | .endif | |
22 | .if exists(lib) | |
23 | SUBDIR+= lib | |
24 | .endif | |
017f3f1a GW |
25 | |
26 | # This contains both libraries and includes, which stuff below depends | |
27 | # upon. | |
28 | .if exists(kerberosIV) && !defined(NOCRYPT) | |
29 | SUBDIR+= kerberosIV | |
30 | .endif | |
31 | ||
f3babd4b RG |
32 | .if exists(libexec) |
33 | SUBDIR+= libexec | |
34 | .endif | |
35 | .if exists(sbin) | |
36 | SUBDIR+= sbin | |
37 | .endif | |
38 | .if exists(share) | |
39 | SUBDIR+= share | |
40 | .endif | |
41 | .if exists(usr.bin) | |
42 | SUBDIR+= usr.bin | |
43 | .endif | |
44 | .if exists(usr.sbin) | |
45 | SUBDIR+= usr.sbin | |
46 | .endif | |
15637ed4 | 47 | |
b761caf7 RG |
48 | # This is for people who want to have src/ports, src/local built |
49 | # automatically. | |
50 | .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) | |
51 | SUBDIR+= local | |
52 | .endif | |
53 | .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) | |
54 | SUBDIR+= ports | |
55 | .endif | |
56 | ||
57 | ||
5db24604 | 58 | # Special cases: etc sys |
2a351537 | 59 | # Not ported: kerberosIV |
15637ed4 | 60 | |
297c7883 RG |
61 | # |
62 | # setenv NOCLEANDIR will prevent make cleandirs from being run | |
63 | # | |
64 | .if defined(NOCLEANDIR) | |
65 | CLEANDIR= | |
66 | .else | |
67 | CLEANDIR= cleandir | |
68 | .endif | |
69 | ||
cf58d770 PHK |
70 | # Where is the c-compier source. Change this, and gnu/usr.bin/Makefile if you |
71 | # want to use another cc (gcc-2.5.8 for instance) | |
72 | CCDIR= ${.CURDIR}/gnu/usr.bin/cc | |
73 | #CCDIR= ${.CURDIR}/gnu/usr.bin/cc25 | |
74 | ||
b0f33593 | 75 | world: directories cleandist mk includes libraries tools mdec |
297c7883 RG |
76 | @echo "--------------------------------------------------------------" |
77 | @echo " Rebuilding ${DESTDIR} The whole thing" | |
78 | @echo "--------------------------------------------------------------" | |
79 | @echo | |
80 | make depend all install | |
986c93cf | 81 | cd ${.CURDIR}/share/man; make makedb |
297c7883 | 82 | |
d18e4498 | 83 | directories: |
e81816d6 JH |
84 | @echo "--------------------------------------------------------------" |
85 | @echo " Making directories" | |
86 | @echo "--------------------------------------------------------------" | |
d18e4498 RG |
87 | cd ${.CURDIR}/etc; make distrib-dirs |
88 | ||
297c7883 RG |
89 | cleandist: |
90 | .if !defined(NOCLEANDIR) | |
91 | @echo "--------------------------------------------------------------" | |
92 | @echo " Cleaning up the source tree, and rebuilding the obj tree" | |
93 | @echo "--------------------------------------------------------------" | |
94 | @echo | |
b4e56ca8 | 95 | here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ |
433e5f2d RG |
96 | if test -d /usr/obj -a ! -d $$dest; then \ |
97 | mkdir -p $$dest; \ | |
98 | else \ | |
99 | true; \ | |
fe98695b | 100 | fi; \ |
6929557a | 101 | cd $$dest; rm -rf ${SUBDIR} |
297c7883 | 102 | find . -name obj | xargs -n30 rm -rf |
e7301710 RG |
103 | .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) |
104 | # The cd is done as local may well be a symbolic link | |
105 | -cd local ; find . -name obj | xargs -n30 rm -rf | |
106 | .endif | |
107 | .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) | |
108 | # The cd is done as local may well be a symbolic link | |
109 | -cd ports ; find . -name obj | xargs -n30 rm -rf | |
110 | .endif | |
297c7883 RG |
111 | make cleandir |
112 | make obj | |
113 | .endif | |
114 | ||
115 | mk: | |
116 | @echo "--------------------------------------------------------------" | |
117 | @echo " Rebuilding ${DESTDIR}/usr/share/mk" | |
118 | @echo "--------------------------------------------------------------" | |
b0f33593 | 119 | .if defined(CLOBBER) |
297c7883 RG |
120 | # DONT DO THIS!! rm -rf ${DESTDIR}/usr/share/mk |
121 | # DONT DO THIS!! mkdir ${DESTDIR}/usr/share/mk | |
b0f33593 RG |
122 | # DONT DO THIS!! chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/share/mk |
123 | # DONT DO THIS!! chmod 755 ${DESTDIR}/usr/share/mk | |
124 | .endif | |
07962aad | 125 | cd ${.CURDIR}/share/mk; make install; |
297c7883 RG |
126 | |
127 | includes: | |
297c7883 RG |
128 | @echo "--------------------------------------------------------------" |
129 | @echo " Rebuilding ${DESTDIR}/usr/include" | |
130 | @echo "--------------------------------------------------------------" | |
131 | @echo | |
7b26216f | 132 | .if defined(CLOBBER) |
297c7883 RG |
133 | rm -rf ${DESTDIR}/usr/include |
134 | mkdir ${DESTDIR}/usr/include | |
135 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include | |
136 | chmod 755 ${DESTDIR}/usr/include | |
5262d901 | 137 | .endif |
07962aad | 138 | cd ${.CURDIR}/include; make install |
cf58d770 | 139 | cd ${CCDIR}/libobjc; make beforeinstall |
ea6ba301 | 140 | cd ${.CURDIR}/gnu/lib/libg++; make beforeinstall |
07962aad | 141 | cd ${.CURDIR}/lib/libcurses; make beforeinstall |
2e609b9d | 142 | cd ${.CURDIR}/lib/libc; make beforeinstall |
017f3f1a GW |
143 | .if !defined(NOCRYPT) && exists(${.CURDIR}/kerberosIV) |
144 | cd ${.CURDIR}/kerberosIV/include; make install | |
145 | .endif | |
297c7883 | 146 | |
b0f33593 RG |
147 | # You MUST run this the first time you get the new sources to boot strap |
148 | # the shared library tools onto you system. This target should only | |
149 | # need to be run once on a system. | |
ce6b8665 | 150 | |
b0f33593 | 151 | bootstrapld: directories cleandist mk includes |
ce6b8665 PR |
152 | @echo "--------------------------------------------------------------" |
153 | @echo " Building new shlib compiler tools" | |
154 | @echo "--------------------------------------------------------------" | |
8f2552dc NW |
155 | # These tools need to be built very early due to a.out.h changes: |
156 | # It is possible that ar is needed | |
b0f33593 RG |
157 | cd ${.CURDIR}/usr.bin/mkdep; make -DNOPIC depend all install ${CLEANDIR} obj |
158 | cd ${.CURDIR}/usr.bin/nm; make -DNOPIC depend all install ${CLEANDIR} obj | |
159 | cd ${.CURDIR}/usr.bin/ranlib; make -DNOPIC depend all install ${CLEANDIR} obj | |
160 | cd ${.CURDIR}/usr.bin/strip; make -DNOPIC depend all install ${CLEANDIR} obj | |
1997d48b RG |
161 | cd ${.CURDIR}/gnu/usr.bin/ld; make -DNOPIC depend all install ${CLEANDIR} obj |
162 | cd ${.CURDIR}/gnu/usr.bin/as; make depend all install ${CLEANDIR} obj | |
cf58d770 PHK |
163 | cd ${CCDIR}; make -DNOPIC depend all install ${CLEANDIR} obj |
164 | cd ${CCDIR}/libgcc; make all install ${CLEANDIR} obj | |
b0f33593 RG |
165 | cd ${.CURDIR}/lib/csu.i386; make depend all install ${CLEANDIR} obj |
166 | cd ${.CURDIR}/lib/libc; make depend all install ${CLEANDIR} obj | |
1997d48b | 167 | cd ${.CURDIR}/gnu/usr.bin/ld/rtld; make depend all install ${CLEANDIR} obj |
ce6b8665 | 168 | |
2fa008e0 AC |
169 | # Standard database make routines are slow especially for |
170 | # big passwd files. You can have much faster routines, but | |
171 | # loose binary compatibility with previous versions and with | |
172 | # other BSD-like systems. If you want to setup much faster | |
173 | # routines, define PW_COMPACT envirnoment variable (f.e. | |
174 | # 'setenv PW_COMPACT' in csh) and use bootstrappwd target | |
175 | # into /usr/src/Makefile. If you will want to return this | |
176 | # changes back, use the same target without defining | |
177 | # PW_COMPACT. | |
5b55ca67 | 178 | |
9d92c587 | 179 | bootstrappwd: #directories |
2fa008e0 | 180 | -rm -f ${.CURDIR}/lib/libc/obj/getpwent.o ${.CURDIR}/lib/libc/getpwent.o |
5b55ca67 | 181 | cd ${.CURDIR}/lib/libc; make all |
2fa008e0 | 182 | -rm -f ${.CURDIR}/usr.sbin/pwd_mkdb/obj/pwd_mkdb.o ${.CURDIR}/usr.sbin/pwd_mkdb/pwd_mkdb.o |
5b55ca67 AC |
183 | cd ${.CURDIR}/usr.sbin/pwd_mkdb; make all install ${CLEANDIR} |
184 | cp /etc/master.passwd /etc/mp.t; pwd_mkdb /etc/mp.t | |
9d92c587 AC |
185 | SLIB=`basename ${.CURDIR}/lib/libc/obj/libc.so.*`; \ |
186 | cp ${.CURDIR}/lib/libc/obj/$$SLIB /usr/lib/$$SLIB.tmp; \ | |
187 | mv /usr/lib/$$SLIB.tmp /usr/lib/$$SLIB | |
d744c517 | 188 | cd ${.CURDIR}/lib/libc; make install ${CLEANDIR} |
9d92c587 AC |
189 | cd ${.CURDIR}/usr.bin/passwd; make clean all install ${CLEANDIR} |
190 | cd ${.CURDIR}/usr.bin/chpass; make clean all install ${CLEANDIR} | |
2fa008e0 AC |
191 | cd ${.CURDIR}/bin; make clean all install ${CLEANDIR} |
192 | cd ${.CURDIR}/sbin; make clean all install ${CLEANDIR} | |
5b55ca67 | 193 | @echo "--------------------------------------------------------------" |
4a85eb03 | 194 | @echo " Do a reboot now because all daemons need restarting" |
5b55ca67 AC |
195 | @echo "--------------------------------------------------------------" |
196 | ||
297c7883 | 197 | libraries: |
042909b6 | 198 | # setenv NOPROFILE if you do not want profiled libraries |
297c7883 RG |
199 | @echo "--------------------------------------------------------------" |
200 | @echo " Rebuilding ${DESTDIR}/usr/lib" | |
201 | @echo "--------------------------------------------------------------" | |
202 | @echo | |
7b26216f | 203 | .if defined(CLOBBER) |
9f3e1e65 | 204 | find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | xargs -n30 rm -rf |
5262d901 | 205 | .endif |
1997d48b | 206 | cd ${.CURDIR}/lib; make depend all install ${CLEANDIR} obj |
cf58d770 | 207 | cd ${CCDIR}/libgcc; make depend all install ${CLEANDIR} obj |
1997d48b RG |
208 | cd ${.CURDIR}/gnu/lib/libg++; make depend all install ${CLEANDIR} obj |
209 | cd ${.CURDIR}/gnu/lib/libregex; make depend all install ${CLEANDIR} obj | |
210 | cd ${.CURDIR}/gnu/lib/libmalloc; make depend all install ${CLEANDIR} obj | |
42bd4104 | 211 | cd ${.CURDIR}/gnu/lib/libreadline; make depend all install ${CLEANDIR} obj |
fb69d766 | 212 | cd ${.CURDIR}/usr.bin/lex; make depend all install ${CLEANDIR} obj |
017f3f1a GW |
213 | .if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) |
214 | cd ${.CURDIR}/kerberosIV/des; make depend all install ${CLEANDIR} obj | |
215 | cd ${.CURDIR}/kerberosIV/krb; make depend all install ${CLEANDIR} obj | |
cf58d770 | 216 | cd ${.CURDIR}/kerberosIV/kdb; make depend all install ${CLEANDIR} obj |
017f3f1a | 217 | .endif |
297c7883 RG |
218 | |
219 | tools: | |
220 | @echo "--------------------------------------------------------------" | |
221 | @echo " Rebuilding ${DESTDIR} Compiler and Make" | |
222 | @echo "--------------------------------------------------------------" | |
223 | @echo | |
cf58d770 | 224 | cd ${CCDIR}; make depend all install ${CLEANDIR} obj |
b0f33593 | 225 | cd ${.CURDIR}/usr.bin/make; make depend all install ${CLEANDIR} obj |
297c7883 RG |
226 | |
227 | mdec: | |
228 | @echo "--------------------------------------------------------------" | |
229 | @echo " Rebuilding ${DESTDIR}/usr/mdec" | |
230 | @echo "--------------------------------------------------------------" | |
231 | @echo | |
232 | .if ${MACHINE} == "i386" | |
07962aad | 233 | cd ${.CURDIR}/sys/i386/boot; make depend all install ${CLEANDIR} |
297c7883 RG |
234 | .if defined (DESTDIR) |
235 | cd /usr/mdec; find . | cpio -pdamuv ${DESTDIR}/usr/mdec | |
236 | .endif | |
237 | .endif | |
238 | ||
15637ed4 | 239 | .include <bsd.subdir.mk> |