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.
6 # @(#)Makefile 4.13 (Berkeley) 5/15/86
8 # This makefile is designed to be run as:
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.
15 # It can also be run in the more conventional way:
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.
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.
31 LIBCDEFS= HOSTLOOKUP=${HOSTLOOKUP} DFLMON=${DFLMON} DEFS="${DEFS}"
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.
42 # Programs that live in subdirectories, and have makefiles of their own.
45 SRCDIR= bin usr.bin etc ucb new games local old
47 all: ${LIBDIR} ${SRCDIR}
50 cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
51 cd lib; make ${MFLAGS} pcc cpp c2
53 usr.lib ${SRCDIR}: FRC
54 cd $@; make ${MFLAGS} ${SRC_MFLAGS}
56 build: buildlib ${SRCDIR}
59 @echo installing /usr/include
60 cd include; make ${MFLAGS} DESTDIR=${DESTDIR} install
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
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
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
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
87 @echo compiling usr.lib
88 cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS}
89 @echo installing /usr/lib
90 cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install
95 -for i in ${LIBDIR} ${SRCDIR}; do \
97 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
101 -for i in ${SRCDIR}; do \
103 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
107 for i in include lib usr.lib; do \
108 (cd $$i; make ${MFLAGS} TAGSFILE=../tags tags); \
110 sort -u +0 -1 -o tags tags
113 rm -f a.out core *.s *.o
114 for i in ${LIBDIR} ${SRCDIR}; do (cd $$i; make -k ${MFLAGS} clean); done