Fix a potential bug in lib/c1 where struct ftconst was not compatible with struct...
[211bsd.git] / Makefile
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 #
6 #       @(#)Makefile    4.15    (2.11BSD)       96/10/21
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 # 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
26 #       HOSTLOOKUP
27 # DFLMON must be either mon.o or gmon.o.
28 # DEFS may include -DLIBC_SCCS, -DSYSLIBC_SCCS, both, or neither.
29 #
30 DFLMON=mon.o
31 DEFS= 
32 LIBCDEFS= DFLMON=${DFLMON} DEFS="${DEFS}"
33
34 # global flags
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.
38 #
39 DESTDIR=
40 CFLAGS= -O
41 # Nick, temporarily remove
42 #SRC_MFLAGS = -k
43
44 # Programs that live in subdirectories, and have makefiles of their own.
45 #
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.
48
49 XXXLIBDIR= lib usr.lib
50 XXXSRCDIR=      share bin sbin etc games libexec local new ucb usr.bin usr.sbin man
51
52 all:    ${XXXLIBDIR} ${XXXSRCDIR}
53
54 lib:    FRC
55         cd lib/libc; make ${MFLAGS} ${LIBCDEFS}
56         cd lib; make ${MFLAGS} ccom cpp c2
57
58 usr.lib ${XXXSRCDIR}: FRC
59         cd $@; make ${MFLAGS} ${SRC_MFLAGS}
60
61 build: buildlib ${XXXSRCDIR}
62
63 buildlib: FRC
64         @echo installing /usr/include
65         # cd include; make ${MFLAGS} DESTDIR=${DESTDIR} install
66         @echo
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
71         @echo
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
79         @echo
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
84         @echo
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
91         @echo
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
96
97 FRC:
98
99 install:
100         -for i in ${XXXLIBDIR} ${XXXSRCDIR}; do \
101                 (cd $$i; \
102                 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
103         done
104
105 installsrc:
106         -for i in ${XXXSRCDIR}; do \
107                 (cd $$i; \
108                 make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \
109         done
110
111 tags:
112         for i in include lib usr.lib; do \
113                 (cd $$i; make ${MFLAGS} TAGSFILE=../tags tags); \
114         done
115         sort -u +0 -1 -o tags tags
116
117 clean:
118         rm -f a.out core *.s *.o
119         for i in ${XXXLIBDIR} ${XXXSRCDIR}; do (cd $$i; make -k ${MFLAGS} clean); done
120
121 # Nick
122 depend:
123         -for i in ${XXXLIBDIR} ${XXXSRCDIR}; do \
124                 (cd $$i; make ${MFLAGS} depend); \
125         done