1) 'msdos' -> 'MSDOS' 2) remove 'bzero' calls 3) add memset call.
[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#
a54c9390
KB
6# @(#)Makefile 4.14 (Berkeley) %G%
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
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
4653d32f 24# make install
a54c9390
KB
25# The `make all' (the default) will compile everything, and install
26# nothing. The `make install' will then install everything.
4653d32f
MK
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
37LIBCDEFS= HOSTLOOKUP=${HOSTLOOKUP} DFLMON=${DFLMON} DEFS="${DEFS}"
38
39# global flags
40# SRC_MFLAGS are used on makes in command source directories,
41# but not in library or compiler directories that will be installed
42# for use in compiling everything else.
9c1744c1
KM
43#
44DESTDIR=
45CFLAGS= -O
4653d32f 46SRC_MFLAGS = -k
9c1744c1
KM
47
48# Programs that live in subdirectories, and have makefiles of their own.
49#
63d11f9b 50LIBDIR= lib usr.lib
ea9dfc18 51SRCDIR= bin usr.bin etc ucb new games local old
9c1744c1 52
a54c9390
KB
53all: ${LIBDIR} ${SRCDIR}
54
55libthenall: buildlib1 buildlib3 ${SRCDIR}
56
57build: buildlib1 buildlib2 buildlib3 ${SRCDIR}
9c1744c1 58
4653d32f
MK
59lib: FRC
60 cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
61 cd lib; make ${MFLAGS} pcc cpp c2
62
63usr.lib ${SRCDIR}: FRC
64 cd $@; make ${MFLAGS} ${SRC_MFLAGS}
65
a54c9390 66buildlib1: FRC
d988052f 67 @echo installing /usr/include
4653d32f
MK
68 cd include; make ${MFLAGS} DESTDIR=${DESTDIR} install
69 @echo
70 @echo compiling libc.a
71 cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
72 @echo installing /lib/libc.a
73 cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install
74 @echo
75 @echo compiling C compiler
76 cd lib; make ${MFLAGS} pcc cpp c2
77 @echo installing C compiler
78 cd lib/pcc; make ${MFLAGS} DESTDIR=${DESTDIR} install
79 cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install
80 cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install
4653d32f 81 @echo
a54c9390
KB
82
83buildlib2: FRC
84 cd lib; make ${MFLAGS} clean
4653d32f
MK
85 @echo re-compiling libc.a
86 cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
87 @echo re-installing /lib/libc.a
88 cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install
89 @echo
90 @echo re-compiling C compiler
91 cd lib; make ${MFLAGS} pcc cpp c2
92 @echo re-installing C compiler
93 cd lib/pcc; make ${MFLAGS} DESTDIR=${DESTDIR} install
94 cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install
95 cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install
96 @echo
a54c9390
KB
97
98buildlib3: FRC
4653d32f
MK
99 @echo compiling usr.lib
100 cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS}
d988052f 101 @echo installing /usr/lib
4653d32f 102 cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install
a54c9390 103 @echo
63d11f9b 104
b9fe0661
SL
105FRC:
106
9c1744c1 107install:
d988052f 108 -for i in ${LIBDIR} ${SRCDIR}; do \
01de33b5 109 (cd $$i; \
4653d32f
MK
110 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
111 done
9c1744c1 112
f9091df4
KM
113installsrc:
114 -for i in ${SRCDIR}; do \
4653d32f
MK
115 (cd $$i; \
116 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
117 done
f9091df4 118
74d5a2b2
SL
119tags:
120 for i in include lib usr.lib; do \
121 (cd $$i; make ${MFLAGS} TAGSFILE=../tags tags); \
122 done
123 sort -u +0 -1 -o tags tags
124
9c1744c1
KM
125clean:
126 rm -f a.out core *.s *.o
4653d32f 127 for i in ${LIBDIR} ${SRCDIR}; do (cd $$i; make -k ${MFLAGS} clean); done