changes designed so that ESIS and ARP may use routing table
[unix-history] / usr / src / Makefile
index 3c3f870..c306bbf 100644 (file)
-#
-# Copyright (c) 1986 Regents of the University of California.
-# All rights reserved.  The Berkeley software License Agreement
-# specifies the terms and conditions for redistribution.
-#
-#      @(#)Makefile    4.15    (Berkeley)      %G%
-#
-# This makefile is designed to be run in one of three ways:
-#
-#      make build
-#      make installsrc
-# The `make build' will 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.
-#
-#      make libthenall
-#      make installsrc
-# The `make libthenall' will compile and install the libraries, compile
-# and install the compiler and then compile everything else.  Note,
-# however, that the libraries will have been built with the old compiler.
-# The `make installsrc' will then install the remaining binaries.
-#
-#      make all
-#      make install
-# 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 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.
-#
-HOSTLOOKUP=named
-DFLMON=mon.o
-DEFS= -DLIBC_SCCS
-MACHINE=tahoe
-LIBCDEFS= MACHINE=${MACHINE} HOSTLOOKUP=${HOSTLOOKUP} DFLMON=${DFLMON} DEFS="${DEFS}"
+#      @(#)Makefile    4.20 (Berkeley) %G%
 
 
-# global flags
-# 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.
-#
-DESTDIR=
-CFLAGS=        -O
-SRC_MFLAGS = -k
+# skip old
+SUBDIR=        bin games include lib libexec old pgrm sbin share usr.bin usr.sbin
 
 
-# Programs that live in subdirectories, and have makefiles of their own.
-#
-LIBDIR= lib usr.lib
-SRCDIR=        bin usr.bin etc ucb new games local old
+build:
+       ${MAKE} cleandir
 
 
-all: ${LIBDIR} ${SRCDIR}
+       @echo +++ installing includes
+       cd include; ${MAKE} depend all install clean
 
 
-libthenall: buildlib1 buildlib3 ${SRCDIR}
+       @echo +++ installing C compiler
+       cd pgrm/cpp; ${MAKE} depend all install clean
+       cd libexec/c2.${MACHINE}; ${MAKE} depend all install clean
+       cd libexec/pcc; ${MAKE} depend all install clean
 
 
-build: buildlib1 buildlib2 buildlib3 ${SRCDIR}
+       @echo +++ installing C library
+       cd lib/libc; ${MAKE} depend all install clean
 
 
-lib:   FRC
-       cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
-       cd lib; make ${MFLAGS} pcc cpp c2
+       @echo +++ re-installing C compiler
+       cd pgrm/cpp; ${MAKE} all install all
+       cd libexec/c2.${MACHINE}; ${MAKE} all install all
+       cd libexec/pcc; ${MAKE} all install all
 
 
-usr.lib ${SRCDIR}: FRC
-       cd $@; make ${MFLAGS} ${SRC_MFLAGS}
+       @echo +++ installing all libraries
+       cd lib; ${MAKE} depend all install all
+       cd lib/libc; rm -f tags; ${MAKE} tags; \
+           install -c -o ${BINOWN} -g ${BINGRP} -m 444 tags /usr/libdata/tags
 
 
-buildlib1: FRC
-       @echo installing /usr/include
-       cd include; make ${MFLAGS} DESTDIR=${DESTDIR} install
-       @echo
-       @echo compiling libc.a
-       cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
-       @echo installing /lib/libc.a
-       cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install
-       @echo
-       @echo compiling C compiler
-       cd lib; make ${MFLAGS} pcc cpp c2
-       @echo installing C compiler
-       cd lib/pcc; make ${MFLAGS} DESTDIR=${DESTDIR} install
-       cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install
-       cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install
-       @echo
+       @echo +++ installing C library tags file
 
 
-buildlib2: FRC
-       cd lib; make ${MFLAGS} clean
-       @echo re-compiling libc.a
-       cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
-       @echo re-installing /lib/libc.a
-       cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install
-       @echo
-       @echo re-compiling C compiler
-       cd lib; make ${MFLAGS} pcc cpp c2
-       @echo re-installing C compiler
-       cd lib/pcc; make ${MFLAGS} DESTDIR=${DESTDIR} install
-       cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install
-       cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install
-       @echo
+       @echo +++ libraries done
+       ${MAKE}
 
 
-buildlib3: FRC
-       @echo compiling usr.lib
-       cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS}
-       @echo installing /usr/lib
-       cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install
-       @echo
-
-FRC:
-
-install:
-       -for i in ${LIBDIR} ${SRCDIR}; do \
-               (cd $$i; \
-               make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
-       done
-
-installsrc:
-       -for i in ${SRCDIR}; do \
-               (cd $$i; \
-               make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
+OBJ=   /usr/obj
+objlinks:
+       -for file in `find ${SUBDIR:S/^/-f /g} name SCCS prune or type dir print`; do \
+               if [ -s $$file/Makefile -a ! -d ${OBJ}/$$file ] ; then \
+                       rm -rf ${OBJ}/$$file; \
+                       mkdir -p ${OBJ}/$$file > /dev/null 2>&1 ; \
+                       rm -f $$file/obj; \
+                       ln -s ${OBJ}/$$file $$file/obj; \
+               fi; \
        done
 
        done
 
-tags:
-       for i in include lib usr.lib; do \
-               (cd $$i; make ${MFLAGS} TAGSFILE=../tags tags); \
+shadow:
+       -for file in `find ${SUBDIR:S/^/-f /g} name SCCS prune or type dir print`; do \
+               if [ -s $$file/obj ] ; then \
+                       rm -rf ${OBJ}/$$file; \
+                       mkdir -p ${OBJ}/$$file > /dev/null 2>&1 ; \
+               fi; \
        done
        done
-       sort -u +0 -1 -o tags tags
 
 
-clean:
-       rm -f a.out core *.s *.o
-       for i in ${LIBDIR} ${SRCDIR}; do (cd $$i; make -k ${MFLAGS} clean); done
+.include <bsd.own.mk>
+.include <bsd.subdir.mk>