added md5
[unix-history] / Makefile
... / ...
CommitLineData
1# @(#)Makefile 5.1.1.2 (Berkeley) 5/9/91
2#
3# $Id: Makefile,v 1.44 1994/03/06 08:40:31 ache Exp $
4#
5
6SUBDIR=
7.if exists(bin)
8SUBDIR+= bin
9.endif
10.if exists(contrib)
11SUBDIR+= contrib
12.endif
13.if exists(games)
14SUBDIR+= games
15.endif
16.if exists(gnu)
17SUBDIR+= gnu
18.endif
19.if exists(include)
20SUBDIR+= include
21.endif
22.if exists(lib)
23SUBDIR+= lib
24.endif
25
26# This contains both libraries and includes, which stuff below depends
27# upon.
28.if exists(kerberosIV) && !defined(NOCRYPT)
29SUBDIR+= kerberosIV
30.endif
31
32.if exists(libexec)
33SUBDIR+= libexec
34.endif
35.if exists(sbin)
36SUBDIR+= sbin
37.endif
38.if exists(share)
39SUBDIR+= share
40.endif
41.if exists(usr.bin)
42SUBDIR+= usr.bin
43.endif
44.if exists(usr.sbin)
45SUBDIR+= usr.sbin
46.endif
47
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)
51SUBDIR+= local
52.endif
53.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
54SUBDIR+= ports
55.endif
56
57
58# Special cases: etc sys
59# Not ported: kerberosIV
60
61#
62# setenv NOCLEANDIR will prevent make cleandirs from being run
63#
64.if defined(NOCLEANDIR)
65CLEANDIR=
66.else
67CLEANDIR= cleandir
68.endif
69
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)
72CCDIR= ${.CURDIR}/gnu/usr.bin/cc
73#CCDIR= ${.CURDIR}/gnu/usr.bin/cc25
74
75world: directories cleandist mk includes libraries tools mdec
76 @echo "--------------------------------------------------------------"
77 @echo " Rebuilding ${DESTDIR} The whole thing"
78 @echo "--------------------------------------------------------------"
79 @echo
80 make depend all install
81 cd ${.CURDIR}/share/man; make makedb
82
83directories:
84 @echo "--------------------------------------------------------------"
85 @echo " Making directories"
86 @echo "--------------------------------------------------------------"
87 cd ${.CURDIR}/etc; make distrib-dirs
88
89cleandist:
90.if !defined(NOCLEANDIR)
91 @echo "--------------------------------------------------------------"
92 @echo " Cleaning up the source tree, and rebuilding the obj tree"
93 @echo "--------------------------------------------------------------"
94 @echo
95 here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
96 if test -d /usr/obj -a ! -d $$dest; then \
97 mkdir -p $$dest; \
98 else \
99 true; \
100 fi; \
101 cd $$dest; rm -rf ${SUBDIR}
102 find . -name obj | xargs -n30 rm -rf
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
111 make cleandir
112 make obj
113.endif
114
115mk:
116 @echo "--------------------------------------------------------------"
117 @echo " Rebuilding ${DESTDIR}/usr/share/mk"
118 @echo "--------------------------------------------------------------"
119.if defined(CLOBBER)
120 # DONT DO THIS!! rm -rf ${DESTDIR}/usr/share/mk
121 # DONT DO THIS!! mkdir ${DESTDIR}/usr/share/mk
122 # DONT DO THIS!! chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/share/mk
123 # DONT DO THIS!! chmod 755 ${DESTDIR}/usr/share/mk
124.endif
125 cd ${.CURDIR}/share/mk; make install;
126
127includes:
128 @echo "--------------------------------------------------------------"
129 @echo " Rebuilding ${DESTDIR}/usr/include"
130 @echo "--------------------------------------------------------------"
131 @echo
132.if defined(CLOBBER)
133 rm -rf ${DESTDIR}/usr/include
134 mkdir ${DESTDIR}/usr/include
135 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include
136 chmod 755 ${DESTDIR}/usr/include
137.endif
138 cd ${.CURDIR}/include; make install
139 cd ${CCDIR}/libobjc; make beforeinstall
140 cd ${.CURDIR}/gnu/lib/libg++; make beforeinstall
141 cd ${.CURDIR}/lib/libcurses; make beforeinstall
142 cd ${.CURDIR}/lib/libc; make beforeinstall
143.if !defined(NOCRYPT) && exists(${.CURDIR}/kerberosIV)
144 cd ${.CURDIR}/kerberosIV/include; make install
145.endif
146
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.
150
151bootstrapld: directories cleandist mk includes
152 @echo "--------------------------------------------------------------"
153 @echo " Building new shlib compiler tools"
154 @echo "--------------------------------------------------------------"
155 # These tools need to be built very early due to a.out.h changes:
156 # It is possible that ar is needed
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
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
163 cd ${CCDIR}; make -DNOPIC depend all install ${CLEANDIR} obj
164 cd ${CCDIR}/libgcc; make all install ${CLEANDIR} obj
165 cd ${.CURDIR}/lib/csu.i386; make depend all install ${CLEANDIR} obj
166 cd ${.CURDIR}/lib/libc; make depend all install ${CLEANDIR} obj
167 cd ${.CURDIR}/gnu/usr.bin/ld/rtld; make depend all install ${CLEANDIR} obj
168
169# You MUST run this the first time you get the new sources to boot strap
170# the *pwd.db databases onto you system. This target should only
171# need to be run once on a system.
172
173bootstrappwd:
174 cd ${.CURDIR}/lib/libc; make all
175 cd ${.CURDIR}/usr.sbin/pwd_mkdb; make all install ${CLEANDIR}
176 cp /etc/master.passwd /etc/mp.t; pwd_mkdb /etc/mp.t
177 cp ${.CURDIR}/lib/libc/obj/libc* /usr/lib
178 cd ${.CURDIR}/lib/libc; make install ${CLEANDIR}
179 cd ${.CURDIR}/usr.bin/passwd; make all install ${CLEANDIR}
180 cd ${.CURDIR}/bin; make all install ${CLEANDIR}
181 cd ${.CURDIR}/sbin; make all install ${CLEANDIR}
182 @echo "--------------------------------------------------------------"
183 @echo " Do reboot now because all daemons needs restart"
184 @echo "--------------------------------------------------------------"
185
186libraries:
187 # setenv NOPROFILE if you do not want profiled libraries
188 @echo "--------------------------------------------------------------"
189 @echo " Rebuilding ${DESTDIR}/usr/lib"
190 @echo "--------------------------------------------------------------"
191 @echo
192.if defined(CLOBBER)
193 find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | xargs -n30 rm -rf
194.endif
195 cd ${.CURDIR}/lib; make depend all install ${CLEANDIR} obj
196 cd ${CCDIR}/libgcc; make depend all install ${CLEANDIR} obj
197 cd ${.CURDIR}/gnu/lib/libg++; make depend all install ${CLEANDIR} obj
198 cd ${.CURDIR}/gnu/lib/libregex; make depend all install ${CLEANDIR} obj
199 cd ${.CURDIR}/gnu/lib/libmalloc; make depend all install ${CLEANDIR} obj
200 cd ${.CURDIR}/usr.bin/lex; make depend all install ${CLEANDIR} obj
201.if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT)
202 cd ${.CURDIR}/kerberosIV/des; make depend all install ${CLEANDIR} obj
203 cd ${.CURDIR}/kerberosIV/krb; make depend all install ${CLEANDIR} obj
204 cd ${.CURDIR}/kerberosIV/kdb; make depend all install ${CLEANDIR} obj
205.endif
206
207tools:
208 @echo "--------------------------------------------------------------"
209 @echo " Rebuilding ${DESTDIR} Compiler and Make"
210 @echo "--------------------------------------------------------------"
211 @echo
212 cd ${CCDIR}; make depend all install ${CLEANDIR} obj
213 cd ${.CURDIR}/usr.bin/make; make depend all install ${CLEANDIR} obj
214
215mdec:
216 @echo "--------------------------------------------------------------"
217 @echo " Rebuilding ${DESTDIR}/usr/mdec"
218 @echo "--------------------------------------------------------------"
219 @echo
220.if ${MACHINE} == "i386"
221 cd ${.CURDIR}/sys/i386/boot; make depend all install ${CLEANDIR}
222.if defined (DESTDIR)
223 cd /usr/mdec; find . | cpio -pdamuv ${DESTDIR}/usr/mdec
224.endif
225.endif
226
227.include <bsd.subdir.mk>