use NULLVP
[unix-history] / usr / src / Makefile
CommitLineData
4653d32f 1#
badb5799
KB
2# Copyright (c) 1986, 1988 Regents of the University of California.
3# All rights reserved.
4653d32f 4#
badb5799
KB
5# Redistribution and use in source and binary forms are permitted
6# provided that the above copyright notice and this paragraph are
7# duplicated in all such forms and that any documentation,
8# advertising materials, and other materials related to such
9# distribution and use acknowledge that the software was developed
10# by the University of California, Berkeley. The name of the
11# University may not be used to endorse or promote products derived
12# from this software without specific prior written permission.
13# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16#
e8c48044 17# @(#)Makefile 4.19 (Berkeley) %G%
a54c9390 18#
e8c48044 19# This makefile is designed to be run in one of two ways:
4653d32f 20#
4653d32f
MK
21# make build
22# make installsrc
e8c48044
KB
23# This is the most rigorous way to rebuild the source tree. `make build'
24# will clean the source tree, install the include files, remake the
25# dependencies, and then compile and install the libraries and the compiler
26# twice before building the rest of the sources. The `make installsrc'
27# will then install the remaining binaries.
a54c9390
KB
28#
29# make all
4653d32f 30# make install
a54c9390
KB
31# The `make all' (the default) will compile everything, and install
32# nothing. The `make install' will then install everything.
4653d32f
MK
33#
34# C library options: passed to libc makefile.
e8c48044 35# See usr.lib/libc/Makefile for explanation.
6588680f 36#
4653d32f
MK
37# HOSTLOOKUP must be either named or hosttable.
38# DFLMON must be either mon.o or gmon.o.
39# DEFS may include -DLIBC_SCCS, -DSYSLIBC_SCCS, both, or neither.
40#
6588680f
KB
41DEFS= -DLIBC_SCCS
42DFLMON= mon.o
e8c48044 43LIBCDEFS= DFLMON=${DFLMON} DEFS="${DEFS}"
4653d32f
MK
44
45# global flags
46# SRC_MFLAGS are used on makes in command source directories,
47# but not in library or compiler directories that will be installed
48# for use in compiling everything else.
9c1744c1
KM
49#
50DESTDIR=
6588680f
KB
51CFLAGS= -O
52SRC_MFLAGS= -k
9c1744c1 53
e8c48044
KB
54SRCLIB= lib
55# order is important, old must be first, man must be last; contrib is
56# too big for the current file system
57# bin
58SRC= old games libexec pgrm sbin share usr.bin usr.sbin local man
59ALL= ${SRCLIB} ${SRC}
a54c9390 60
e8c48044 61all: ${ALL}
d99a42dc 62
e8c48044 63build: cleandir build1 ${SRC}
9c1744c1 64
e8c48044
KB
65${ALL}: FRC
66 @echo; echo +++ compiling $@
67 cd $@; make ${MFLAGS}
4653d32f 68
e8c48044
KB
69build1:
70 @echo +++ installing includes
4653d32f
MK
71 cd include; make ${MFLAGS} DESTDIR=${DESTDIR} install
72 @echo
e8c48044
KB
73 @echo +++ building dependencies
74 @for i in ${ALL}; do \
75 echo; echo +++ dependencies for $$i; \
76 (cd $$i; make ${MFLAGS} depend); \
77 done
78 @echo +++ compiling C compiler
79 cd usr.bin/cpp; make ${MFLAGS}
80 cd usr.libexec/c2; make ${MFLAGS}
81 cd usr.libexec/pcc; make ${MFLAGS}
4653d32f 82 @echo
e8c48044
KB
83 @echo +++ installing C compiler
84 cd usr.bin/cpp; make ${MFLAGS} install
85 cd usr.libexec/c2; make ${MFLAGS} install
86 cd usr.libexec/pcc; make ${MFLAGS} install
d99a42dc 87 @echo
e8c48044
KB
88 @echo +++ compiling C library
89 cd usr.lib/libc; make ${MFLAGS} ${LIBCDEFS}
4653d32f 90 @echo
e8c48044
KB
91 @echo +++ installing C library
92 cd usr.lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install
4653d32f 93 @echo
e8c48044
KB
94 @echo +++ cleaning C compiler
95 cd usr.bin/cpp; make ${MFLAGS} clean
96 cd usr.libexec/c2; make ${MFLAGS} clean
97 cd usr.libexec/pcc; make ${MFLAGS} clean
4653d32f 98 @echo
e8c48044
KB
99 @echo +++ re-compiling C compiler
100 cd usr.bin/cpp; make ${MFLAGS}
101 cd usr.libexec/c2; make ${MFLAGS}
102 cd usr.libexec/pcc; make ${MFLAGS}
103 @echo
104 @echo +++ re-installing C compiler
105 cd usr.bin/cpp; make ${MFLAGS} install
106 cd usr.libexec/c2; make ${MFLAGS} install
107 cd usr.libexec/pcc; make ${MFLAGS} install
108 @echo
109 @echo +++ cleaning C library
110 cd usr.lib/libc; make ${MFLAGS} clean
111 @echo
112 @echo +++ compiling all libraries
113 cd usr.lib; make ${MFLAGS} ${LIBCDEFS}
114 @echo
115 @echo +++ installing all libraries
116 cd usr.lib; make ${MFLAGS} DESTDIR=${DESTDIR} install
117 @echo
118 @echo +++ libraries done
a54c9390 119 @echo
63d11f9b 120
e8c48044
KB
121installsrc: FRC
122 @for i in ${SRC}; do \
d99a42dc 123 echo; \
e8c48044 124 echo +++ installing $$i; \
01de33b5 125 (cd $$i; \
e8c48044 126 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
4653d32f 127 done
9c1744c1 128
e8c48044
KB
129clean: FRC
130 @for i in ${ALL}; do \
d99a42dc 131 echo; \
e8c48044
KB
132 echo +++ cleaning $$i; \
133 (cd $$i; make ${SRC_MFLAGS} clean); \
134 done
135
136cleandir: FRC
137 @for i in include ${ALL}; do \
138 echo; echo '+++ cleaning (cleandir)' $$i; \
139 (cd $$i; make ${SRC_MFLAGS} cleandir); \
4653d32f 140 done
f9091df4 141
6588680f 142depend: FRC
e8c48044 143 @for i in ${ALL}; do \
d99a42dc 144 echo; \
e8c48044
KB
145 echo +++ doing dependencies for $$i; \
146 (cd $$i; make ${SRC_MFLAGS} depend); \
6588680f
KB
147 done
148
e8c48044
KB
149install: FRC
150 @for i in ${ALL}; do \
d99a42dc 151 echo; \
e8c48044
KB
152 echo +++ installing $$i; \
153 (cd $$i; \
154 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
74d5a2b2 155 done
74d5a2b2 156
e8c48044
KB
157tags: FRC
158 @for i in include lib usr.lib; do \
d99a42dc 159 echo; \
e8c48044
KB
160 echo +++ making tags for $$i; \
161 (cd $$i; make ${SRC_MFLAGS} TAGSFILE=../tags tags); \
6588680f 162 done
e8c48044 163 sort -u +0 -1 -o tags tags
6588680f
KB
164
165FRC: