Commit | Line | Data |
---|---|---|
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 | # | |
ea9dfc18 | 6 | # @(#)Makefile 4.13 (Berkeley) %G% |
4653d32f MK |
7 | # |
8 | # This makefile is designed to be run as: | |
9 | # make build | |
10 | # make installsrc | |
11 | # The `make build' will compile and install the libraries | |
12 | # before building the rest of the sources. The `make installsrc' | |
13 | # will then install the remaining binaries. | |
14 | # | |
15 | # It can also be run in the more conventional way: | |
16 | # make | |
17 | # make install | |
18 | # The `make' will compile everything without installing anything. | |
19 | # The `make install' will then install everything. Note however | |
20 | # that all the binaries will have been loaded with the old libraries. | |
21 | # | |
22 | # C library options: passed to libc makefile. | |
23 | # See lib/libc/Makefile for explanation. | |
24 | # HOSTLOOKUP must be either named or hosttable. | |
25 | # DFLMON must be either mon.o or gmon.o. | |
26 | # DEFS may include -DLIBC_SCCS, -DSYSLIBC_SCCS, both, or neither. | |
27 | # | |
28 | HOSTLOOKUP=named | |
29 | DFLMON=mon.o | |
30 | DEFS= -DLIBC_SCCS | |
31 | LIBCDEFS= HOSTLOOKUP=${HOSTLOOKUP} DFLMON=${DFLMON} DEFS="${DEFS}" | |
32 | ||
33 | # global flags | |
34 | # SRC_MFLAGS are used on makes in command source directories, | |
35 | # but not in library or compiler directories that will be installed | |
36 | # for use in compiling everything else. | |
9c1744c1 KM |
37 | # |
38 | DESTDIR= | |
39 | CFLAGS= -O | |
4653d32f | 40 | SRC_MFLAGS = -k |
9c1744c1 KM |
41 | |
42 | # Programs that live in subdirectories, and have makefiles of their own. | |
43 | # | |
63d11f9b | 44 | LIBDIR= lib usr.lib |
ea9dfc18 | 45 | SRCDIR= bin usr.bin etc ucb new games local old |
9c1744c1 | 46 | |
63d11f9b | 47 | all: ${LIBDIR} ${SRCDIR} |
9c1744c1 | 48 | |
4653d32f MK |
49 | lib: FRC |
50 | cd lib/libc; make ${MFLAGS} ${LIBCDEFS} | |
51 | cd lib; make ${MFLAGS} pcc cpp c2 | |
52 | ||
53 | usr.lib ${SRCDIR}: FRC | |
54 | cd $@; make ${MFLAGS} ${SRC_MFLAGS} | |
55 | ||
56 | build: buildlib ${SRCDIR} | |
9c1744c1 | 57 | |
4653d32f | 58 | buildlib: FRC |
d988052f | 59 | @echo installing /usr/include |
4653d32f MK |
60 | cd include; make ${MFLAGS} DESTDIR=${DESTDIR} install |
61 | @echo | |
62 | @echo compiling libc.a | |
63 | cd lib/libc; make ${MFLAGS} ${LIBCDEFS} | |
64 | @echo installing /lib/libc.a | |
65 | cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install | |
66 | @echo | |
67 | @echo compiling C compiler | |
68 | cd lib; make ${MFLAGS} pcc cpp c2 | |
69 | @echo installing C compiler | |
70 | cd lib/pcc; make ${MFLAGS} DESTDIR=${DESTDIR} install | |
71 | cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install | |
72 | cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install | |
73 | cd lib; make ${MFLAGS} clean | |
74 | @echo | |
75 | @echo re-compiling libc.a | |
76 | cd lib/libc; make ${MFLAGS} ${LIBCDEFS} | |
77 | @echo re-installing /lib/libc.a | |
78 | cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install | |
79 | @echo | |
80 | @echo re-compiling C compiler | |
81 | cd lib; make ${MFLAGS} pcc cpp c2 | |
82 | @echo re-installing C compiler | |
83 | cd lib/pcc; make ${MFLAGS} DESTDIR=${DESTDIR} install | |
84 | cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install | |
85 | cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install | |
86 | @echo | |
87 | @echo compiling usr.lib | |
88 | cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS} | |
d988052f | 89 | @echo installing /usr/lib |
4653d32f | 90 | cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install |
63d11f9b | 91 | |
b9fe0661 SL |
92 | FRC: |
93 | ||
9c1744c1 | 94 | install: |
d988052f | 95 | -for i in ${LIBDIR} ${SRCDIR}; do \ |
01de33b5 | 96 | (cd $$i; \ |
4653d32f MK |
97 | make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \ |
98 | done | |
9c1744c1 | 99 | |
f9091df4 KM |
100 | installsrc: |
101 | -for i in ${SRCDIR}; do \ | |
4653d32f MK |
102 | (cd $$i; \ |
103 | make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \ | |
104 | done | |
f9091df4 | 105 | |
74d5a2b2 SL |
106 | tags: |
107 | for i in include lib usr.lib; do \ | |
108 | (cd $$i; make ${MFLAGS} TAGSFILE=../tags tags); \ | |
109 | done | |
110 | sort -u +0 -1 -o tags tags | |
111 | ||
9c1744c1 KM |
112 | clean: |
113 | rm -f a.out core *.s *.o | |
4653d32f | 114 | for i in ${LIBDIR} ${SRCDIR}; do (cd $$i; make -k ${MFLAGS} clean); done |