Makefile revision 1.93
1#	$NetBSD: Makefile,v 1.93 1999/03/10 19:10:14 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
15HAVE_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
23SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
24
25.if exists(games)
26SUBDIR+= games
27.endif
28
29SUBDIR+= gnu
30# This is needed for libstdc++ and gen-params.
31includes-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.if exists(domestic) && \
40    (make(clean) || make(cleandir) || make(obj) || \
41    ((make(includes) || make(install)) && \
42    !defined(EXPORTABLE_SYSTEM) && defined(_DISTRIB)))
43SUBDIR+= domestic
44.endif
45
46.if exists(regress)
47.ifmake !(install)
48SUBDIR+= regress
49.endif
50
51regression-tests:
52	@echo Running regression tests...
53	@(cd ${.CURDIR}/regress && ${MAKE} regress)
54.endif
55
56beforeinstall:
57.ifmake build
58	@echo -n "Build started at: "
59	@date
60.endif
61.ifndef DESTDIR
62	(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
63.else
64	(cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
65.endif
66
67afterinstall:
68.if ${MKMAN} != "no" && !defined(_BUILD)
69	${MAKE} whatis.db
70.endif
71
72whatis.db:
73	(cd ${.CURDIR}/share/man && ${MAKE} makedb)
74
75# wrt info/dir below:  It's safe to move this over top of /usr/share/info/dir,
76# as the build will automatically remove/replace the non-pkg entries there.
77
78build: beforeinstall
79.if ${MKSHARE} != "no"
80	(cd ${.CURDIR}/share/mk && ${MAKE} install)
81	(cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install)
82.endif
83.if !defined(UPDATE)
84	${MAKE} cleandir
85.endif
86.if empty(HAVE_GCC28)
87.if defined(DESTDIR)
88	@echo "*** CAPUTE!"
89	@echo "    You attempted to compile the world without egcs.  You must"
90	@echo "    first install a native egcs compiler."
91	@false
92.else
93	(cd ${.CURDIR}/gnu/usr.bin/egcs && \
94	    ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
95	    ${MAKE} MKMAN=no install && ${MAKE} cleandir)
96.endif
97.endif
98	${MAKE} includes
99	(cd ${.CURDIR}/lib/csu && \
100	    ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
101	    ${MAKE} MKMAN=no install)
102	(cd ${.CURDIR}/lib && \
103	    ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
104	    ${MAKE} MKMAN=no install)
105	(cd ${.CURDIR}/gnu/lib && \
106	    ${MAKE} depend && ${MAKE} ${_J} MKMAN=no MKINFO=no && \
107	    ${MAKE} MKMAN=no MKINFO=no install)
108	${MAKE} depend && ${MAKE} ${_J} && ${MAKE} _BUILD= install
109.if exists(domestic) && !defined(EXPORTABLE_SYSTEM)
110	(cd ${.CURDIR}/domestic && ${MAKE} ${_J} _SLAVE_BUILD= build)
111.endif
112	${MAKE} whatis.db
113	@echo -n "Build finished at: "
114	@date
115
116release snapshot: build
117	(cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release)
118
119.include <bsd.subdir.mk>
120