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.15 (2.11BSD) 96/10/21
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 # NOTE: The method of hostname lookup (hosts file or nameserver) is no
25 # longer selected here. Make sure to edit lib/libc/Makefile to set
27 # DFLMON must be either mon.o or gmon.o.
28 # DEFS may include -DLIBC_SCCS, -DSYSLIBC_SCCS, both, or neither.
32 LIBCDEFS= DFLMON=${DFLMON} DEFS="${DEFS}"
35 # SRC_MFLAGS are used on makes in command source directories,
36 # but not in library or compiler directories that will be installed
37 # for use in compiling everything else.
41 # Nick, temporarily remove
44 # Programs that live in subdirectories, and have makefiles of their own.
46 # 'share' has to be towards the front of the list because programs such as
47 # lint(1) need their data files, etc installed first.
49 XXXLIBDIR= lib usr.lib
50 XXXSRCDIR= share bin sbin etc games libexec local new ucb usr.bin usr.sbin man
52 all: ${XXXLIBDIR} ${XXXSRCDIR}
55 cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
56 cd lib; make ${MFLAGS} ccom cpp c2
58 usr.lib ${XXXSRCDIR}: FRC
59 cd $@; make ${MFLAGS} ${SRC_MFLAGS}
61 build: buildlib ${XXXSRCDIR}
64 @echo installing /usr/include
65 # cd include; make ${MFLAGS} DESTDIR=${DESTDIR} install
67 @echo compiling libc.a
68 cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
69 @echo installing /lib/libc.a
70 cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install
72 @echo compiling C compiler
73 cd lib; make ${MFLAGS} ccom cpp c2
74 @echo installing C compiler
75 cd lib/ccom; make ${MFLAGS} DESTDIR=${DESTDIR} install
76 cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install
77 cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install
78 cd lib; make ${MFLAGS} clean
80 @echo re-compiling libc.a
81 cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
82 @echo re-installing /lib/libc.a
83 cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install
85 @echo re-compiling C compiler
86 cd lib; make ${MFLAGS} ccom cpp c2
87 @echo re-installing C compiler
88 cd lib/ccom; make ${MFLAGS} DESTDIR=${DESTDIR} install
89 cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install
90 cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install
92 @echo compiling usr.lib
93 cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS}
94 @echo installing /usr/lib
95 cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install
100 -for i in ${XXXLIBDIR} ${XXXSRCDIR}; do \
102 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
106 -for i in ${XXXSRCDIR}; do \
108 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
112 for i in include lib usr.lib; do \
113 (cd $$i; make ${MFLAGS} TAGSFILE=../tags tags); \
115 sort -u +0 -1 -o tags tags
118 rm -f a.out core *.s *.o
119 for i in ${XXXLIBDIR} ${XXXSRCDIR}; do (cd $$i; make -k ${MFLAGS} clean); done
123 -for i in ${XXXLIBDIR} ${XXXSRCDIR}; do \
124 (cd $$i; make ${MFLAGS} depend); \