Makefile revision 1.78
1#	$NetBSD: Makefile,v 1.78 1999/01/05 07:09:58 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# NOMAN: if set to 1, don't build and install man pages
10# NOSHARE: if set to 1, 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.if exists(domestic) && (make(clean) || make(cleandir) || make(obj))
34SUBDIR+= domestic
35.endif
36
37.if exists(regress)
38.ifmake !(install)
39SUBDIR+= regress
40.endif
41
42regression-tests:
43	@echo Running regression tests...
44	@(cd ${.CURDIR}/regress && ${MAKE} regress)
45.endif
46
47beforeinstall:
48.ifmake build
49	@echo -n "Build started at: "
50	@date
51.endif
52.ifndef DESTDIR
53	(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
54.else
55	(cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
56.endif
57
58afterinstall:
59.if !defined(NOMAN) && !defined(NOSHARE)
60	(cd ${.CURDIR}/share/man && ${MAKE} makedb)
61.endif
62
63build: beforeinstall
64.if !defined(NOSHARE)
65	(cd ${.CURDIR}/share/mk && ${MAKE} install)
66	(cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install)
67.endif
68.if !defined(UPDATE)
69	${MAKE} cleandir
70.endif
71.if empty(HAVE_GCC28)
72.if defined(DESTDIR)
73	@echo "*** CAPUTE!"
74	@echo "    You attempted to compile the world with egcs.  You must"
75	@echo "    first install a native egcs compiler."
76	false
77.else
78	(cd ${.CURDIR}/gnu/usr.bin/egcs && \
79	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && \
80	    ${MAKE} NOMAN= install && ${MAKE} cleandir)
81.endif
82.endif
83	${MAKE} includes
84	(cd ${.CURDIR}/lib/csu && \
85	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install)
86	(cd ${.CURDIR}/lib && \
87	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install)
88	(cd ${.CURDIR}/gnu/lib && \
89	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install)
90	${MAKE} depend && ${MAKE} ${_J} && ${MAKE} install
91.if exists(domestic) && !defined(EXPORTABLE_SYSTEM)
92	(cd ${.CURDIR}/domestic && ${MAKE} ${_J} _SLAVE_BUILD= build)
93.endif
94	@echo -n "Build finished at: "
95	@date
96
97.include <bsd.subdir.mk>
98