# Copyright (c) 1986, 1988 Regents of the University of California.
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by the University of California, Berkeley. The name of the
# University may not be used to endorse or promote products derived
# from this software without specific prior written permission.
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
# @(#)Makefile 4.19 (Berkeley) %G%
# This makefile is designed to be run in one of two ways:
# This is the most rigorous way to rebuild the source tree. `make build'
# will clean the source tree, install the include files, remake the
# dependencies, and then compile and install the libraries and the compiler
# twice before building the rest of the sources. The `make installsrc'
# will then install the remaining binaries.
# The `make all' (the default) will compile everything, and install
# nothing. The `make install' will then install everything.
# C library options: passed to libc makefile.
# See usr.lib/libc/Makefile for explanation.
# HOSTLOOKUP must be either named or hosttable.
# DFLMON must be either mon.o or gmon.o.
# DEFS may include -DLIBC_SCCS, -DSYSLIBC_SCCS, both, or neither.
LIBCDEFS
= DFLMON
=${DFLMON} DEFS
="${DEFS}"
# SRC_MFLAGS are used on makes in command source directories,
# but not in library or compiler directories that will be installed
# for use in compiling everything else.
# order is important, old must be first, man must be last; contrib is
# too big for the current file system
SRC
= old games libexec pgrm sbin share usr.bin usr.sbin local man
build
: cleandir build1
${SRC}
@echo
; echo
+++ compiling
$@
@echo
+++ installing includes
cd
include; make
${MFLAGS} DESTDIR
=${DESTDIR} install
@echo
+++ building dependencies
echo
; echo
+++ dependencies for
$$i; \
(cd
$$i; make
${MFLAGS} depend
); \
@echo
+++ compiling C compiler
cd usr.bin
/cpp; make
${MFLAGS}
cd usr.libexec
/c2
; make
${MFLAGS}
cd usr.libexec
/pcc
; make
${MFLAGS}
@echo
+++ installing C compiler
cd usr.bin
/cpp; make
${MFLAGS} install
cd usr.libexec
/c2
; make
${MFLAGS} install
cd usr.libexec
/pcc
; make
${MFLAGS} install
@echo
+++ compiling C library
cd usr.lib
/libc
; make
${MFLAGS} ${LIBCDEFS}
@echo
+++ installing C library
cd usr.lib
/libc
; make
${MFLAGS} DESTDIR
=${DESTDIR} install
@echo
+++ cleaning C compiler
cd usr.bin
/cpp; make
${MFLAGS} clean
cd usr.libexec
/c2
; make
${MFLAGS} clean
cd usr.libexec
/pcc
; make
${MFLAGS} clean
@echo
+++ re-compiling C compiler
cd usr.bin
/cpp; make
${MFLAGS}
cd usr.libexec
/c2
; make
${MFLAGS}
cd usr.libexec
/pcc
; make
${MFLAGS}
@echo
+++ re-installing C compiler
cd usr.bin
/cpp; make
${MFLAGS} install
cd usr.libexec
/c2
; make
${MFLAGS} install
cd usr.libexec
/pcc
; make
${MFLAGS} install
@echo
+++ cleaning C library
cd usr.lib
/libc
; make
${MFLAGS} clean
@echo
+++ compiling
all libraries
cd usr.lib
; make
${MFLAGS} ${LIBCDEFS}
@echo
+++ installing
all libraries
cd usr.lib
; make
${MFLAGS} DESTDIR
=${DESTDIR} install
echo
+++ installing
$$i; \
make
${MFLAGS} ${SRC_MFLAGS} DESTDIR
=${DESTDIR} install); \
(cd
$$i; make
${SRC_MFLAGS} clean); \
@for i in
include ${ALL}; do \
echo
; echo
'+++ cleaning (cleandir)' $$i; \
(cd
$$i; make
${SRC_MFLAGS} cleandir
); \
echo
+++ doing dependencies for
$$i; \
(cd
$$i; make
${SRC_MFLAGS} depend
); \
echo
+++ installing
$$i; \
make
${MFLAGS} ${SRC_MFLAGS} DESTDIR
=${DESTDIR} install); \
@for i in
include lib usr.lib
; do \
echo
+++ making
tags for
$$i; \
(cd
$$i; make
${SRC_MFLAGS} TAGSFILE
=..
/tags tags); \
sort -u
+0 -1 -o
tags tags