Initial versions of kernel Makefile stuff
[unix-history] / Makefile
CommitLineData
15637ed4
RG
1# @(#)Makefile 5.1.1.2 (Berkeley) 5/9/91
2#
b761caf7 3# $Id: Makefile,v 1.31 1994/01/05 20:11:49 nate 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
25.if exists(libexec)
26SUBDIR+= libexec
27.endif
28.if exists(sbin)
29SUBDIR+= sbin
30.endif
31.if exists(share)
32SUBDIR+= share
33.endif
34.if exists(usr.bin)
35SUBDIR+= usr.bin
36.endif
37.if exists(usr.sbin)
38SUBDIR+= 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)
44SUBDIR+= local
45.endif
46.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
47SUBDIR+= 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)
58CLEANDIR=
59.else
60CLEANDIR= cleandir
61.endif
62
b0f33593 63world: 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
07962aad 69 cd ${.CURDIR}/usr.sbin/sendmail/src; make install
986c93cf 70 cd ${.CURDIR}/share/man; make makedb
297c7883 71
d18e4498
RG
72directories:
73 cd ${.CURDIR}/etc; make distrib-dirs
74
297c7883
RG
75cleandist:
76.if !defined(NOCLEANDIR)
77 @echo "--------------------------------------------------------------"
78 @echo " Cleaning up the source tree, and rebuilding the obj tree"
79 @echo "--------------------------------------------------------------"
80 @echo
6929557a
RG
81 here=`pwd`; dest=/usr/obj/`echo $$here | sed 's,/usr/src,,'`; \
82 cd $$dest; rm -rf ${SUBDIR}
297c7883
RG
83 find . -name obj | xargs -n30 rm -rf
84 make cleandir
85 make obj
86.endif
87
88mk:
89 @echo "--------------------------------------------------------------"
90 @echo " Rebuilding ${DESTDIR}/usr/share/mk"
91 @echo "--------------------------------------------------------------"
b0f33593 92.if defined(CLOBBER)
297c7883
RG
93 # DONT DO THIS!! rm -rf ${DESTDIR}/usr/share/mk
94 # DONT DO THIS!! mkdir ${DESTDIR}/usr/share/mk
b0f33593
RG
95 # DONT DO THIS!! chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/share/mk
96 # DONT DO THIS!! chmod 755 ${DESTDIR}/usr/share/mk
97.endif
07962aad 98 cd ${.CURDIR}/share/mk; make install;
297c7883
RG
99
100includes:
297c7883
RG
101 @echo "--------------------------------------------------------------"
102 @echo " Rebuilding ${DESTDIR}/usr/include"
103 @echo "--------------------------------------------------------------"
104 @echo
7b26216f 105.if defined(CLOBBER)
297c7883
RG
106 rm -rf ${DESTDIR}/usr/include
107 mkdir ${DESTDIR}/usr/include
108 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include
109 chmod 755 ${DESTDIR}/usr/include
5262d901 110.endif
07962aad 111 cd ${.CURDIR}/include; make install
173943a0 112 cd ${.CURDIR}/gnu/gcc2/libobjc; make beforeinstall
07962aad 113 cd ${.CURDIR}/gnu/libg++; make beforeinstall
0691ff99 114 cd ${.CURDIR}/gnu/libregex; make beforeinstall
07962aad 115 cd ${.CURDIR}/lib/libcurses; make beforeinstall
2e609b9d 116 cd ${.CURDIR}/lib/libc; make beforeinstall
297c7883 117
b0f33593
RG
118# You MUST run this the first time you get the new sources to boot strap
119# the shared library tools onto you system. This target should only
120# need to be run once on a system.
ce6b8665 121
b0f33593 122bootstrapld: directories cleandist mk includes
ce6b8665
PR
123 @echo "--------------------------------------------------------------"
124 @echo " Building new shlib compiler tools"
125 @echo "--------------------------------------------------------------"
8f2552dc
NW
126 # These tools need to be built very early due to a.out.h changes:
127 # It is possible that ar is needed
b0f33593
RG
128 cd ${.CURDIR}/usr.bin/mkdep; make -DNOPIC depend all install ${CLEANDIR} obj
129 cd ${.CURDIR}/usr.bin/nm; make -DNOPIC depend all install ${CLEANDIR} obj
130 cd ${.CURDIR}/usr.bin/ranlib; make -DNOPIC depend all install ${CLEANDIR} obj
131 cd ${.CURDIR}/usr.bin/strip; make -DNOPIC depend all install ${CLEANDIR} obj
132 cd ${.CURDIR}/gnu/ld; make -DNOPIC depend all install ${CLEANDIR} obj
133 cd ${.CURDIR}/gnu/gas; make depend all install ${CLEANDIR} obj
134 cd ${.CURDIR}/gnu/gcc2; make -DNOPIC depend all install ${CLEANDIR} obj
135 cd ${.CURDIR}/gnu/gcc2/libgcc; make all install ${CLEANDIR} obj
136 cd ${.CURDIR}/lib/csu.i386; make depend all install ${CLEANDIR} obj
137 cd ${.CURDIR}/lib/libc; make depend all install ${CLEANDIR} obj
138 cd ${.CURDIR}/gnu/ld/rtld; make depend all install ${CLEANDIR} obj
ce6b8665 139
297c7883 140libraries:
042909b6 141 # setenv NOPROFILE if you do not want profiled libraries
297c7883
RG
142 @echo "--------------------------------------------------------------"
143 @echo " Rebuilding ${DESTDIR}/usr/lib"
144 @echo "--------------------------------------------------------------"
145 @echo
7b26216f 146.if defined(CLOBBER)
9f3e1e65 147 find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | xargs -n30 rm -rf
5262d901 148.endif
5f4aac33
RG
149 cd ${.CURDIR}/lib; make depend all install ${CLEANDIR} obj
150 cd ${.CURDIR}/gnu/gcc2/libgcc; make depend all install ${CLEANDIR} obj
fb69d766 151 cd ${.CURDIR}/gnu/libg++; make depend all install ${CLEANDIR} obj
5f4aac33
RG
152 cd ${.CURDIR}/gnu/libregex; make depend all install ${CLEANDIR} obj
153 cd ${.CURDIR}/gnu/libmalloc; make depend all install ${CLEANDIR} obj
fb69d766 154 cd ${.CURDIR}/usr.bin/lex; make depend all install ${CLEANDIR} obj
297c7883
RG
155
156tools:
157 @echo "--------------------------------------------------------------"
158 @echo " Rebuilding ${DESTDIR} Compiler and Make"
159 @echo "--------------------------------------------------------------"
160 @echo
b0f33593
RG
161 cd ${.CURDIR}/gnu/gcc2; make depend all install ${CLEANDIR} obj
162 cd ${.CURDIR}/usr.bin/make; make depend all install ${CLEANDIR} obj
297c7883
RG
163
164mdec:
165 @echo "--------------------------------------------------------------"
166 @echo " Rebuilding ${DESTDIR}/usr/mdec"
167 @echo "--------------------------------------------------------------"
168 @echo
169.if ${MACHINE} == "i386"
07962aad 170 cd ${.CURDIR}/sys/i386/boot; make depend all install ${CLEANDIR}
297c7883
RG
171.if defined (DESTDIR)
172 cd /usr/mdec; find . | cpio -pdamuv ${DESTDIR}/usr/mdec
173.endif
174.endif
175
15637ed4 176.include <bsd.subdir.mk>