Removed a disgusting wart that attempts to verify that the data in the
[unix-history] / Makefile
CommitLineData
15637ed4
RG
1# @(#)Makefile 5.1.1.2 (Berkeley) 5/9/91
2#
d744c517 3# $Id: Makefile,v 1.43 1994/03/04 20:43:15 ache Exp $
15637ed4
RG
4#
5
f3babd4b
RG
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
017f3f1a
GW
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
f3babd4b
RG
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
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)
51SUBDIR+= local
52.endif
53.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
54SUBDIR+= 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)
65CLEANDIR=
66.else
67CLEANDIR= 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)
72CCDIR= ${.CURDIR}/gnu/usr.bin/cc
73#CCDIR= ${.CURDIR}/gnu/usr.bin/cc25
74
b0f33593 75world: 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
RG
83directories:
84 cd ${.CURDIR}/etc; make distrib-dirs
85
297c7883
RG
86cleandist:
87.if !defined(NOCLEANDIR)
88 @echo "--------------------------------------------------------------"
89 @echo " Cleaning up the source tree, and rebuilding the obj tree"
90 @echo "--------------------------------------------------------------"
91 @echo
b4e56ca8 92 here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
433e5f2d
RG
93 if test -d /usr/obj -a ! -d $$dest; then \
94 mkdir -p $$dest; \
95 else \
96 true; \
fe98695b 97 fi; \
6929557a 98 cd $$dest; rm -rf ${SUBDIR}
297c7883 99 find . -name obj | xargs -n30 rm -rf
e7301710
RG
100.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
101 # The cd is done as local may well be a symbolic link
102 -cd local ; find . -name obj | xargs -n30 rm -rf
103.endif
104.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
105 # The cd is done as local may well be a symbolic link
106 -cd ports ; find . -name obj | xargs -n30 rm -rf
107.endif
297c7883
RG
108 make cleandir
109 make obj
110.endif
111
112mk:
113 @echo "--------------------------------------------------------------"
114 @echo " Rebuilding ${DESTDIR}/usr/share/mk"
115 @echo "--------------------------------------------------------------"
b0f33593 116.if defined(CLOBBER)
297c7883
RG
117 # DONT DO THIS!! rm -rf ${DESTDIR}/usr/share/mk
118 # DONT DO THIS!! mkdir ${DESTDIR}/usr/share/mk
b0f33593
RG
119 # DONT DO THIS!! chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/share/mk
120 # DONT DO THIS!! chmod 755 ${DESTDIR}/usr/share/mk
121.endif
07962aad 122 cd ${.CURDIR}/share/mk; make install;
297c7883
RG
123
124includes:
297c7883
RG
125 @echo "--------------------------------------------------------------"
126 @echo " Rebuilding ${DESTDIR}/usr/include"
127 @echo "--------------------------------------------------------------"
128 @echo
7b26216f 129.if defined(CLOBBER)
297c7883
RG
130 rm -rf ${DESTDIR}/usr/include
131 mkdir ${DESTDIR}/usr/include
132 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include
133 chmod 755 ${DESTDIR}/usr/include
5262d901 134.endif
07962aad 135 cd ${.CURDIR}/include; make install
cf58d770 136 cd ${CCDIR}/libobjc; make beforeinstall
ea6ba301 137 cd ${.CURDIR}/gnu/lib/libg++; make beforeinstall
07962aad 138 cd ${.CURDIR}/lib/libcurses; make beforeinstall
2e609b9d 139 cd ${.CURDIR}/lib/libc; make beforeinstall
017f3f1a
GW
140.if !defined(NOCRYPT) && exists(${.CURDIR}/kerberosIV)
141 cd ${.CURDIR}/kerberosIV/include; make install
142.endif
297c7883 143
b0f33593
RG
144# You MUST run this the first time you get the new sources to boot strap
145# the shared library tools onto you system. This target should only
146# need to be run once on a system.
ce6b8665 147
b0f33593 148bootstrapld: directories cleandist mk includes
ce6b8665
PR
149 @echo "--------------------------------------------------------------"
150 @echo " Building new shlib compiler tools"
151 @echo "--------------------------------------------------------------"
8f2552dc
NW
152 # These tools need to be built very early due to a.out.h changes:
153 # It is possible that ar is needed
b0f33593
RG
154 cd ${.CURDIR}/usr.bin/mkdep; make -DNOPIC depend all install ${CLEANDIR} obj
155 cd ${.CURDIR}/usr.bin/nm; make -DNOPIC depend all install ${CLEANDIR} obj
156 cd ${.CURDIR}/usr.bin/ranlib; make -DNOPIC depend all install ${CLEANDIR} obj
157 cd ${.CURDIR}/usr.bin/strip; make -DNOPIC depend all install ${CLEANDIR} obj
1997d48b
RG
158 cd ${.CURDIR}/gnu/usr.bin/ld; make -DNOPIC depend all install ${CLEANDIR} obj
159 cd ${.CURDIR}/gnu/usr.bin/as; make depend all install ${CLEANDIR} obj
cf58d770
PHK
160 cd ${CCDIR}; make -DNOPIC depend all install ${CLEANDIR} obj
161 cd ${CCDIR}/libgcc; make all install ${CLEANDIR} obj
b0f33593
RG
162 cd ${.CURDIR}/lib/csu.i386; make depend all install ${CLEANDIR} obj
163 cd ${.CURDIR}/lib/libc; make depend all install ${CLEANDIR} obj
1997d48b 164 cd ${.CURDIR}/gnu/usr.bin/ld/rtld; make depend all install ${CLEANDIR} obj
ce6b8665 165
5b55ca67
AC
166# You MUST run this the first time you get the new sources to boot strap
167# the *pwd.db databases onto you system. This target should only
168# need to be run once on a system.
169
170bootstrappwd:
171 cd ${.CURDIR}/lib/libc; make all
172 cd ${.CURDIR}/usr.sbin/pwd_mkdb; make all install ${CLEANDIR}
173 cp /etc/master.passwd /etc/mp.t; pwd_mkdb /etc/mp.t
174 cp ${.CURDIR}/lib/libc/obj/libc* /usr/lib
d744c517 175 cd ${.CURDIR}/lib/libc; make install ${CLEANDIR}
5b55ca67
AC
176 cd ${.CURDIR}/usr.bin/passwd; make all install ${CLEANDIR}
177 cd ${.CURDIR}/bin; make all install ${CLEANDIR}
178 cd ${.CURDIR}/sbin; make all install ${CLEANDIR}
179 @echo "--------------------------------------------------------------"
180 @echo " Do reboot now because all daemons needs restart"
181 @echo "--------------------------------------------------------------"
182
297c7883 183libraries:
042909b6 184 # setenv NOPROFILE if you do not want profiled libraries
297c7883
RG
185 @echo "--------------------------------------------------------------"
186 @echo " Rebuilding ${DESTDIR}/usr/lib"
187 @echo "--------------------------------------------------------------"
188 @echo
7b26216f 189.if defined(CLOBBER)
9f3e1e65 190 find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | xargs -n30 rm -rf
5262d901 191.endif
1997d48b 192 cd ${.CURDIR}/lib; make depend all install ${CLEANDIR} obj
cf58d770 193 cd ${CCDIR}/libgcc; make depend all install ${CLEANDIR} obj
1997d48b
RG
194 cd ${.CURDIR}/gnu/lib/libg++; make depend all install ${CLEANDIR} obj
195 cd ${.CURDIR}/gnu/lib/libregex; make depend all install ${CLEANDIR} obj
196 cd ${.CURDIR}/gnu/lib/libmalloc; make depend all install ${CLEANDIR} obj
fb69d766 197 cd ${.CURDIR}/usr.bin/lex; make depend all install ${CLEANDIR} obj
017f3f1a
GW
198.if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT)
199 cd ${.CURDIR}/kerberosIV/des; make depend all install ${CLEANDIR} obj
200 cd ${.CURDIR}/kerberosIV/krb; make depend all install ${CLEANDIR} obj
cf58d770 201 cd ${.CURDIR}/kerberosIV/kdb; make depend all install ${CLEANDIR} obj
017f3f1a 202.endif
297c7883
RG
203
204tools:
205 @echo "--------------------------------------------------------------"
206 @echo " Rebuilding ${DESTDIR} Compiler and Make"
207 @echo "--------------------------------------------------------------"
208 @echo
cf58d770 209 cd ${CCDIR}; make depend all install ${CLEANDIR} obj
b0f33593 210 cd ${.CURDIR}/usr.bin/make; make depend all install ${CLEANDIR} obj
297c7883
RG
211
212mdec:
213 @echo "--------------------------------------------------------------"
214 @echo " Rebuilding ${DESTDIR}/usr/mdec"
215 @echo "--------------------------------------------------------------"
216 @echo
217.if ${MACHINE} == "i386"
07962aad 218 cd ${.CURDIR}/sys/i386/boot; make depend all install ${CLEANDIR}
297c7883
RG
219.if defined (DESTDIR)
220 cd /usr/mdec; find . | cpio -pdamuv ${DESTDIR}/usr/mdec
221.endif
222.endif
223
15637ed4 224.include <bsd.subdir.mk>