added depend label
[unix-history] / usr / src / Makefile
... / ...
CommitLineData
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#
6# @(#)Makefile 4.15 (Berkeley) %G%
7#
8# This makefile is designed to be run in one of three ways:
9#
10# make build
11# make installsrc
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
14# then install the remaining binaries.
15#
16# make libthenall
17# make installsrc
18# The `make libthenall' will compile and install the libraries, compile
19# and install the compiler and then compile everything else. Note,
20# however, that the libraries will have been built with the old compiler.
21# The `make installsrc' will then install the remaining binaries.
22#
23# make all
24# make install
25# The `make all' (the default) will compile everything, and install
26# nothing. The `make install' will then install everything.
27#
28# C library options: passed to libc makefile.
29# See lib/libc/Makefile for explanation.
30# HOSTLOOKUP must be either named or hosttable.
31# DFLMON must be either mon.o or gmon.o.
32# DEFS may include -DLIBC_SCCS, -DSYSLIBC_SCCS, both, or neither.
33#
34HOSTLOOKUP=named
35DFLMON=mon.o
36DEFS= -DLIBC_SCCS
37MACHINE=tahoe
38LIBCDEFS= MACHINE=${MACHINE} HOSTLOOKUP=${HOSTLOOKUP} DFLMON=${DFLMON} DEFS="${DEFS}"
39
40# global flags
41# SRC_MFLAGS are used on makes in command source directories,
42# but not in library or compiler directories that will be installed
43# for use in compiling everything else.
44#
45DESTDIR=
46CFLAGS= -O
47SRC_MFLAGS = -k
48
49# Programs that live in subdirectories, and have makefiles of their own.
50#
51LIBDIR= lib usr.lib
52SRCDIR= bin usr.bin etc ucb new games local old
53
54all: ${LIBDIR} ${SRCDIR}
55
56libthenall: buildlib1 buildlib3 ${SRCDIR}
57
58build: buildlib1 buildlib2 buildlib3 ${SRCDIR}
59
60lib: FRC
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
67buildlib1: FRC
68 @echo installing /usr/include
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
82 @echo
83
84buildlib2: FRC
85 cd lib; make ${MFLAGS} clean
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
98
99buildlib3: FRC
100 @echo compiling usr.lib
101 cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS}
102 @echo installing /usr/lib
103 cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install
104 @echo
105
106FRC:
107
108install:
109 -for i in ${LIBDIR} ${SRCDIR}; do \
110 (cd $$i; \
111 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
112 done
113
114installsrc:
115 -for i in ${SRCDIR}; do \
116 (cd $$i; \
117 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
118 done
119
120tags:
121 for i in include lib usr.lib; do \
122 (cd $$i; make ${MFLAGS} TAGSFILE=../tags tags); \
123 done
124 sort -u +0 -1 -o tags tags
125
126clean:
127 rm -f a.out core *.s *.o
128 for i in ${LIBDIR} ${SRCDIR}; do (cd $$i; make -k ${MFLAGS} clean); done