Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | # @(#)Makefile 5.1.1.2 (Berkeley) 5/9/91 |
2 | # | |
433e5f2d | 3 | # $Id: Makefile,v 1.38 1994/02/04 21:38:47 rgrimes 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 | |
25 | .if exists(libexec) | |
26 | SUBDIR+= libexec | |
27 | .endif | |
28 | .if exists(sbin) | |
29 | SUBDIR+= sbin | |
30 | .endif | |
31 | .if exists(share) | |
32 | SUBDIR+= share | |
33 | .endif | |
34 | .if exists(usr.bin) | |
35 | SUBDIR+= usr.bin | |
36 | .endif | |
37 | .if exists(usr.sbin) | |
38 | SUBDIR+= usr.sbin | |
39 | .endif | |
15637ed4 | 40 | |
b761caf7 RG |
41 | # This is for people who want to have src/ports, src/local built |
42 | # automatically. | |
43 | .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) | |
44 | SUBDIR+= local | |
45 | .endif | |
46 | .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) | |
47 | SUBDIR+= ports | |
48 | .endif | |
49 | ||
50 | ||
5db24604 | 51 | # Special cases: etc sys |
2a351537 | 52 | # Not ported: kerberosIV |
15637ed4 | 53 | |
297c7883 RG |
54 | # |
55 | # setenv NOCLEANDIR will prevent make cleandirs from being run | |
56 | # | |
57 | .if defined(NOCLEANDIR) | |
58 | CLEANDIR= | |
59 | .else | |
60 | CLEANDIR= cleandir | |
61 | .endif | |
62 | ||
b0f33593 | 63 | world: directories cleandist mk includes libraries tools mdec |
297c7883 RG |
64 | @echo "--------------------------------------------------------------" |
65 | @echo " Rebuilding ${DESTDIR} The whole thing" | |
66 | @echo "--------------------------------------------------------------" | |
67 | @echo | |
68 | make depend all install | |
986c93cf | 69 | cd ${.CURDIR}/share/man; make makedb |
297c7883 | 70 | |
d18e4498 RG |
71 | directories: |
72 | cd ${.CURDIR}/etc; make distrib-dirs | |
73 | ||
297c7883 RG |
74 | cleandist: |
75 | .if !defined(NOCLEANDIR) | |
76 | @echo "--------------------------------------------------------------" | |
77 | @echo " Cleaning up the source tree, and rebuilding the obj tree" | |
78 | @echo "--------------------------------------------------------------" | |
79 | @echo | |
b4e56ca8 | 80 | here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ |
433e5f2d RG |
81 | if test -d /usr/obj -a ! -d $$dest; then \ |
82 | mkdir -p $$dest; \ | |
83 | else \ | |
84 | true; \ | |
85 | fi; | |
6929557a | 86 | cd $$dest; rm -rf ${SUBDIR} |
297c7883 | 87 | find . -name obj | xargs -n30 rm -rf |
e7301710 RG |
88 | .if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile) |
89 | # The cd is done as local may well be a symbolic link | |
90 | -cd local ; find . -name obj | xargs -n30 rm -rf | |
91 | .endif | |
92 | .if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile) | |
93 | # The cd is done as local may well be a symbolic link | |
94 | -cd ports ; find . -name obj | xargs -n30 rm -rf | |
95 | .endif | |
297c7883 RG |
96 | make cleandir |
97 | make obj | |
98 | .endif | |
99 | ||
100 | mk: | |
101 | @echo "--------------------------------------------------------------" | |
102 | @echo " Rebuilding ${DESTDIR}/usr/share/mk" | |
103 | @echo "--------------------------------------------------------------" | |
b0f33593 | 104 | .if defined(CLOBBER) |
297c7883 RG |
105 | # DONT DO THIS!! rm -rf ${DESTDIR}/usr/share/mk |
106 | # DONT DO THIS!! mkdir ${DESTDIR}/usr/share/mk | |
b0f33593 RG |
107 | # DONT DO THIS!! chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/share/mk |
108 | # DONT DO THIS!! chmod 755 ${DESTDIR}/usr/share/mk | |
109 | .endif | |
07962aad | 110 | cd ${.CURDIR}/share/mk; make install; |
297c7883 RG |
111 | |
112 | includes: | |
297c7883 RG |
113 | @echo "--------------------------------------------------------------" |
114 | @echo " Rebuilding ${DESTDIR}/usr/include" | |
115 | @echo "--------------------------------------------------------------" | |
116 | @echo | |
7b26216f | 117 | .if defined(CLOBBER) |
297c7883 RG |
118 | rm -rf ${DESTDIR}/usr/include |
119 | mkdir ${DESTDIR}/usr/include | |
120 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include | |
121 | chmod 755 ${DESTDIR}/usr/include | |
5262d901 | 122 | .endif |
07962aad | 123 | cd ${.CURDIR}/include; make install |
1997d48b | 124 | cd ${.CURDIR}/gnu/usr.bin/cc/libobjc; make beforeinstall |
ea6ba301 | 125 | cd ${.CURDIR}/gnu/lib/libg++; make beforeinstall |
07962aad | 126 | cd ${.CURDIR}/lib/libcurses; make beforeinstall |
2e609b9d | 127 | cd ${.CURDIR}/lib/libc; make beforeinstall |
297c7883 | 128 | |
b0f33593 RG |
129 | # You MUST run this the first time you get the new sources to boot strap |
130 | # the shared library tools onto you system. This target should only | |
131 | # need to be run once on a system. | |
ce6b8665 | 132 | |
b0f33593 | 133 | bootstrapld: directories cleandist mk includes |
ce6b8665 PR |
134 | @echo "--------------------------------------------------------------" |
135 | @echo " Building new shlib compiler tools" | |
136 | @echo "--------------------------------------------------------------" | |
8f2552dc NW |
137 | # These tools need to be built very early due to a.out.h changes: |
138 | # It is possible that ar is needed | |
b0f33593 RG |
139 | cd ${.CURDIR}/usr.bin/mkdep; make -DNOPIC depend all install ${CLEANDIR} obj |
140 | cd ${.CURDIR}/usr.bin/nm; make -DNOPIC depend all install ${CLEANDIR} obj | |
141 | cd ${.CURDIR}/usr.bin/ranlib; make -DNOPIC depend all install ${CLEANDIR} obj | |
142 | cd ${.CURDIR}/usr.bin/strip; make -DNOPIC depend all install ${CLEANDIR} obj | |
1997d48b RG |
143 | cd ${.CURDIR}/gnu/usr.bin/ld; make -DNOPIC depend all install ${CLEANDIR} obj |
144 | cd ${.CURDIR}/gnu/usr.bin/as; make depend all install ${CLEANDIR} obj | |
145 | cd ${.CURDIR}/gnu/usr.bin/cc; make -DNOPIC depend all install ${CLEANDIR} obj | |
146 | cd ${.CURDIR}/gnu/usr.bin/cc/libgcc; make all install ${CLEANDIR} obj | |
b0f33593 RG |
147 | cd ${.CURDIR}/lib/csu.i386; make depend all install ${CLEANDIR} obj |
148 | cd ${.CURDIR}/lib/libc; make depend all install ${CLEANDIR} obj | |
1997d48b | 149 | cd ${.CURDIR}/gnu/usr.bin/ld/rtld; make depend all install ${CLEANDIR} obj |
ce6b8665 | 150 | |
297c7883 | 151 | libraries: |
042909b6 | 152 | # setenv NOPROFILE if you do not want profiled libraries |
297c7883 RG |
153 | @echo "--------------------------------------------------------------" |
154 | @echo " Rebuilding ${DESTDIR}/usr/lib" | |
155 | @echo "--------------------------------------------------------------" | |
156 | @echo | |
7b26216f | 157 | .if defined(CLOBBER) |
9f3e1e65 | 158 | find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | xargs -n30 rm -rf |
5262d901 | 159 | .endif |
1997d48b RG |
160 | cd ${.CURDIR}/lib; make depend all install ${CLEANDIR} obj |
161 | cd ${.CURDIR}/gnu/usr.bin/cc/libgcc; make depend all install ${CLEANDIR} obj | |
162 | cd ${.CURDIR}/gnu/lib/libg++; make depend all install ${CLEANDIR} obj | |
163 | cd ${.CURDIR}/gnu/lib/libregex; make depend all install ${CLEANDIR} obj | |
164 | cd ${.CURDIR}/gnu/lib/libmalloc; make depend all install ${CLEANDIR} obj | |
fb69d766 | 165 | cd ${.CURDIR}/usr.bin/lex; make depend all install ${CLEANDIR} obj |
297c7883 RG |
166 | |
167 | tools: | |
168 | @echo "--------------------------------------------------------------" | |
169 | @echo " Rebuilding ${DESTDIR} Compiler and Make" | |
170 | @echo "--------------------------------------------------------------" | |
171 | @echo | |
1997d48b | 172 | cd ${.CURDIR}/gnu/usr.bin/cc; make depend all install ${CLEANDIR} obj |
b0f33593 | 173 | cd ${.CURDIR}/usr.bin/make; make depend all install ${CLEANDIR} obj |
297c7883 RG |
174 | |
175 | mdec: | |
176 | @echo "--------------------------------------------------------------" | |
177 | @echo " Rebuilding ${DESTDIR}/usr/mdec" | |
178 | @echo "--------------------------------------------------------------" | |
179 | @echo | |
180 | .if ${MACHINE} == "i386" | |
07962aad | 181 | cd ${.CURDIR}/sys/i386/boot; make depend all install ${CLEANDIR} |
297c7883 RG |
182 | .if defined (DESTDIR) |
183 | cd /usr/mdec; find . | cpio -pdamuv ${DESTDIR}/usr/mdec | |
184 | .endif | |
185 | .endif | |
186 | ||
15637ed4 | 187 | .include <bsd.subdir.mk> |