do tags on headers, too; don't remove tags
[unix-history] / usr / src / Makefile
CommitLineData
4653d32f
MK
1#
2# Copyright (c) 1986 Regents of the University of California.
3# All rights reserved. The Berkeley software License Agreement
4# specifies the terms and conditions for redistribution.
5#
474f2102 6# @(#)Makefile 4.16 (Berkeley) %G%
a54c9390
KB
7#
8# This makefile is designed to be run in one of three ways:
4653d32f 9#
4653d32f
MK
10# make build
11# make installsrc
a54c9390
KB
12# The `make build' will compile and install the libraries and the compiler
13# twice before building the rest of the sources. The `make installsrc' will
6588680f
KB
14# then install the remaining binaries. Only `make build' will clean out
15# the source tree as well as remake the dependencies.
a54c9390
KB
16#
17# make libthenall
18# make installsrc
19# The `make libthenall' will compile and install the libraries, compile
20# and install the compiler and then compile everything else. Note,
21# however, that the libraries will have been built with the old compiler.
22# The `make installsrc' will then install the remaining binaries.
23#
24# make all
4653d32f 25# make install
a54c9390
KB
26# The `make all' (the default) will compile everything, and install
27# nothing. The `make install' will then install everything.
4653d32f
MK
28#
29# C library options: passed to libc makefile.
30# See lib/libc/Makefile for explanation.
6588680f 31#
4653d32f
MK
32# HOSTLOOKUP must be either named or hosttable.
33# DFLMON must be either mon.o or gmon.o.
34# DEFS may include -DLIBC_SCCS, -DSYSLIBC_SCCS, both, or neither.
35#
6588680f
KB
36DEFS= -DLIBC_SCCS
37DFLMON= mon.o
38HOSTLOOKUP= named
39LIBCDEFS= HOSTLOOKUP=${HOSTLOOKUP} DFLMON=${DFLMON} DEFS="${DEFS}"
4653d32f
MK
40
41# global flags
42# SRC_MFLAGS are used on makes in command source directories,
43# but not in library or compiler directories that will be installed
44# for use in compiling everything else.
9c1744c1
KM
45#
46DESTDIR=
6588680f
KB
47CFLAGS= -O
48SRC_MFLAGS= -k
9c1744c1 49
6588680f
KB
50LIBDIR= lib usr.lib
51# order is important, old and man must be #1 and #2
52SRCDIR= old man bin etc games local new ucb usr.bin
9c1744c1 53
a54c9390
KB
54all: ${LIBDIR} ${SRCDIR}
55
56libthenall: buildlib1 buildlib3 ${SRCDIR}
57
6588680f 58build: clean depend buildlib1 buildlib2 buildlib3 ${SRCDIR}
9c1744c1 59
6588680f 60lib: FRC
4653d32f
MK
61 cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
62 cd lib; make ${MFLAGS} pcc cpp c2
63
64usr.lib ${SRCDIR}: FRC
65 cd $@; make ${MFLAGS} ${SRC_MFLAGS}
66
a54c9390 67buildlib1: FRC
d988052f 68 @echo installing /usr/include
4653d32f
MK
69 cd include; make ${MFLAGS} DESTDIR=${DESTDIR} install
70 @echo
71 @echo compiling libc.a
72 cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
73 @echo installing /lib/libc.a
74 cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install
75 @echo
76 @echo compiling C compiler
77 cd lib; make ${MFLAGS} pcc cpp c2
78 @echo installing C compiler
79 cd lib/pcc; make ${MFLAGS} DESTDIR=${DESTDIR} install
80 cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install
81 cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install
4653d32f 82 @echo
a54c9390
KB
83
84buildlib2: FRC
85 cd lib; make ${MFLAGS} clean
4653d32f
MK
86 @echo re-compiling libc.a
87 cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
88 @echo re-installing /lib/libc.a
89 cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install
90 @echo
91 @echo re-compiling C compiler
92 cd lib; make ${MFLAGS} pcc cpp c2
93 @echo re-installing C compiler
94 cd lib/pcc; make ${MFLAGS} DESTDIR=${DESTDIR} install
95 cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install
96 cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install
97 @echo
a54c9390
KB
98
99buildlib3: FRC
4653d32f
MK
100 @echo compiling usr.lib
101 cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS}
d988052f 102 @echo installing /usr/lib
4653d32f 103 cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install
a54c9390 104 @echo
63d11f9b 105
6588680f 106install: FRC
d988052f 107 -for i in ${LIBDIR} ${SRCDIR}; do \
01de33b5 108 (cd $$i; \
4653d32f
MK
109 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
110 done
9c1744c1 111
6588680f 112installsrc: FRC
f9091df4 113 -for i in ${SRCDIR}; do \
4653d32f
MK
114 (cd $$i; \
115 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
116 done
f9091df4 117
6588680f
KB
118depend: FRC
119 for i in ${LIBDIR} ${SRCDIR}; do \
120 (cd $$i; make ${MFLAGS} depend); \
121 done
122
123tags: FRC
74d5a2b2
SL
124 for i in include lib usr.lib; do \
125 (cd $$i; make ${MFLAGS} TAGSFILE=../tags tags); \
126 done
127 sort -u +0 -1 -o tags tags
128
6588680f
KB
129clean: FRC
130 for i in ${LIBDIR} ${SRCDIR}; do \
131 (cd $$i; make -k ${MFLAGS} clean); \
132 done
133
134FRC: