Makefile revision 1.94 1 # $NetBSD: Makefile,v 1.94 1999/03/10 19:18:59 scottr Exp $
2
3 .include <bsd.own.mk> # for configuration variables.
4
5 # Configurations variables (can be set either in /etc/mk.conf or
6 # as environement variable
7 # NBUILDJOBS: the number of jobs to start in parallel in a 'make build'.
8 # defaults to 1
9 # MKMAN: if set to no, don't build and install man pages
10 # MKSHARE: if set to no, don't build or install /usr/share stuffs
11 # UPDATE: if set to 1, don't do a 'make cleandir' before compile
12 # DESTDIR: The target directory for installation (default to '/',
13 # which mean the current system is updated).
14
15 HAVE_GCC28!= ${CXX} --version | egrep "^(2\.8|egcs)" ; echo
16
17 .if defined(NBUILDJOBS)
18 _J= -j${NBUILDJOBS}
19 .endif
20
21 # NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
22
23 SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
24
25 .if exists(games)
26 SUBDIR+= games
27 .endif
28
29 SUBDIR+= gnu
30 # This is needed for libstdc++ and gen-params.
31 includes-gnu: includes-include includes-sys
32
33 # Descend into the domestic tree if it exists AND
34 # 1) the target is clean, cleandir, or obj, OR
35 # 2) the the target is install or includes AND
36 # NOT compiling only "exportable" code AND
37 # doing it as part of installing a distribution.
38 #
39 # NOTE: due to the use of the make(foo) construct here, using the
40 # clean, cleandir, and obj targets on the command line in conjunction
41 # with any other target may produce unexpected results.
42
43 .if exists(domestic) && \
44 (make(clean) || make(cleandir) || make(obj) || \
45 ((make(includes) || make(install)) && \
46 !defined(EXPORTABLE_SYSTEM) && defined(_DISTRIB)))
47 SUBDIR+= domestic
48 .endif
49
50 .if exists(regress)
51 .ifmake !(install)
52 SUBDIR+= regress
53 .endif
54
55 regression-tests:
56 @echo Running regression tests...
57 @(cd ${.CURDIR}/regress && ${MAKE} regress)
58 .endif
59
60 beforeinstall:
61 .ifmake build
62 @echo -n "Build started at: "
63 @date
64 .endif
65 .ifndef DESTDIR
66 (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
67 .else
68 (cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
69 .endif
70
71 afterinstall:
72 .if ${MKMAN} != "no" && !defined(_BUILD)
73 ${MAKE} whatis.db
74 .endif
75
76 whatis.db:
77 (cd ${.CURDIR}/share/man && ${MAKE} makedb)
78
79 # wrt info/dir below: It's safe to move this over top of /usr/share/info/dir,
80 # as the build will automatically remove/replace the non-pkg entries there.
81
82 build: beforeinstall
83 .if ${MKSHARE} != "no"
84 (cd ${.CURDIR}/share/mk && ${MAKE} install)
85 (cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install)
86 .endif
87 .if !defined(UPDATE)
88 ${MAKE} cleandir
89 .endif
90 .if empty(HAVE_GCC28)
91 .if defined(DESTDIR)
92 @echo "*** CAPUTE!"
93 @echo " You attempted to compile the world without egcs. You must"
94 @echo " first install a native egcs compiler."
95 @false
96 .else
97 (cd ${.CURDIR}/gnu/usr.bin/egcs && \
98 ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
99 ${MAKE} MKMAN=no install && ${MAKE} cleandir)
100 .endif
101 .endif
102 ${MAKE} includes
103 (cd ${.CURDIR}/lib/csu && \
104 ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
105 ${MAKE} MKMAN=no install)
106 (cd ${.CURDIR}/lib && \
107 ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
108 ${MAKE} MKMAN=no install)
109 (cd ${.CURDIR}/gnu/lib && \
110 ${MAKE} depend && ${MAKE} ${_J} MKMAN=no MKINFO=no && \
111 ${MAKE} MKMAN=no MKINFO=no install)
112 ${MAKE} depend && ${MAKE} ${_J} && ${MAKE} _BUILD= install
113 .if exists(domestic) && !defined(EXPORTABLE_SYSTEM)
114 (cd ${.CURDIR}/domestic && ${MAKE} ${_J} _SLAVE_BUILD= build)
115 .endif
116 ${MAKE} whatis.db
117 @echo -n "Build finished at: "
118 @date
119
120 release snapshot: build
121 (cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release)
122
123 .include <bsd.subdir.mk>
124