Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 163 lines (142 sloc) 4.778 kB
622e9fe Sync w/ netbsd-1-5-base.
minoura authored
1 # $NetBSD: Makefile,v 1.117.2.1 2000/06/22 14:57:40 minoura Exp $
4693743 Improve documentation.
cjs authored
2
3 # This is the top-level makefile for building NetBSD. For an outline of
4 # how to build a snapshot or release, as well as other release engineering
5 # information, see http://www.netbsd.org/developers/releng/index.html
6 #
7 # Not everything you can set or do is documented in this makefile. In
8 # particular, you should review the files in /usr/share/mk (especially
9 # bsd.README) for general information on building programs and writing
10 # Makefiles within this structure, and see the comments in src/etc/Makefile
11 # for further information on installation and release set options.
12 #
13 # Variables listed below can be set on the make command line (highest
14 # priority), in /etc/mk.conf (middle priority), or in the environment
15 # (lowest priority).
16 #
17 # Variables:
f7a8ac6 Document MKOBJDIRS here, and sort the variable list in the comments
sommerfeld authored
18 # DESTDIR is the target directory for installation of the compiled
19 # software. It defaults to /. Note that programs are built against
20 # libraries installed in DESTDIR.
4693743 Improve documentation.
cjs authored
21 # MKMAN, if set to `no', will prevent building of manual pages.
f7a8ac6 Document MKOBJDIRS here, and sort the variable list in the comments
sommerfeld authored
22 # MKOBJDIRS, if not set to `no', will build object directories at
23 # an appropriate point in a build.
4693743 Improve documentation.
cjs authored
24 # MKSHARE, if set to `no', will prevent building and installing
25 # anything in /usr/share.
f7a8ac6 Document MKOBJDIRS here, and sort the variable list in the comments
sommerfeld authored
26 # NBUILDJOBS is the number of jobs to start in parallel during a
27 # 'make build'. It defaults to 1.
4693743 Improve documentation.
cjs authored
28 # UPDATE will avoid a `make cleandir' at the start of `make build',
29 # as well as having the effects listed in /usr/share/mk/bsd.README.
30 #
31 # Targets:
b101583 Handle new make variable BUILD_DONE which creates an empty build targ…
jlam authored
32 # build: builds a full release of netbsd in DESTDIR. If BUILD_DONE is
33 # set, this is an empty target.
4693743 Improve documentation.
cjs authored
34 # release: does a `make build,' and then tars up the DESTDIR files
35 # into RELEASEDIR, in release(7) format. (See etc/Makefile for
36 # more information on this.)
37 # snapshot: a synonym for release.
448982f pull in bsd.own.mk earlier, to get configuration variables.
cgd authored
38
622e9fe Sync w/ netbsd-1-5-base.
minoura authored
39 .include <bsd.own.mk>
a445358 change "Id" to "Header" in rcsid, and noted why etc was not in subdirs
cgd authored
40
1605754 Add MKOBJDIRS make variable to bsd.own.mk, defaulting to "no" but
sommerfeld authored
41 MKOBJDIRS ?= no
b2ce7d1 HAVE_GCC28 -> HAVE_EGCS, and make it match gcc 2.9, as well.
thorpej authored
42 HAVE_EGCS!= ${CXX} --version | egrep "^(2\.[89]|egcs)" ; echo
c2e4e20 Fix the rebuild of libgcc:
tv authored
43
046845e Add a 'NBUILDJOBS' variable which control the number of jobs started in
bouyer authored
44 .if defined(NBUILDJOBS)
45 _J= -j${NBUILDJOBS}
46 .endif
47
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
48 .if defined(DESTDIR)
49 _M=-m ${DESTDIR}/usr/share/mk
50 .endif
51
a445358 change "Id" to "Header" in rcsid, and noted why etc was not in subdirs
cgd authored
52 # NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
729d7b8 after 0.2.2 "stable" patches applied
cgd authored
53
280e18d Make sure system includes are installed before descending into gnu.
mycroft authored
54 SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
1702e77 When you type `make obj', make obj dirs in distrib whether or not you
cjs authored
55 .if make(obj)
56 SUBDIR+= distrib
8f4874d if MAKEOBJDIRPREFIX defined, include etc in make obj
sjg authored
57 .ifdef MAKEOBJDIRPREFIX
58 SUBDIR+= etc
59 .endif
1702e77 When you type `make obj', make obj dirs in distrib whether or not you
cjs authored
60 .endif
634e8c1 allow builds to work if directory games is missing. Closes pr misc/19…
explorer authored
61
e2c2314 make sure include and include/sys are populated before starting to
assar authored
62 includes-lib: includes-include includes-sys
63
634e8c1 allow builds to work if directory games is missing. Closes pr misc/19…
explorer authored
64 .if exists(games)
65 SUBDIR+= games
66 .endif
67
a984b18 put all of the gnu stuff in one place
cgd authored
68 SUBDIR+= gnu
280e18d Make sure system includes are installed before descending into gnu.
mycroft authored
69 # This is needed for libstdc++ and gen-params.
70 includes-gnu: includes-include includes-sys
c330d79 allow toplevel makefile to descend into sys
cgd authored
71
72a7b88 Make regress only if directory exists. It can be optional.
brezak authored
72 .if exists(regress)
bfa953f add regress, but not for install. also, add "regress" target
cgd authored
73 .ifmake !(install)
74 SUBDIR+= regress
75 .endif
76
7e08344 oops, clean that up a bit
cgd authored
77 regression-tests:
78 @echo Running regression tests...
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
79 @(cd ${.CURDIR}/regress && ${MAKE} ${_M} regress)
72a7b88 Make regress only if directory exists. It can be optional.
brezak authored
80 .endif
bfa953f add regress, but not for install. also, add "regress" target
cgd authored
81
24f3405 Add a buildmsg target for build to depend upon instead of using an if…
erh authored
82 buildmsg:
f4a5534 add date printout at beginning and end of 'make build's
perry authored
83 @echo -n "Build started at: "
84 @date
24f3405 Add a buildmsg target for build to depend upon instead of using an if…
erh authored
85
86 beforeinstall:
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
87 .ifndef NODISTRIBDIRS
f41d59f get krb4 includes installed, do distrib-dirs if DESTDIR not set
tls authored
88 .ifndef DESTDIR
89 (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
35e8ebf behaviour of 'make build' should not change if DESTDIR is set; this i…
tls authored
90 .else
781d133 remove two of the previous ${_M}; they were invoked before $DESTDIR/s…
mrg authored
91 (cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
f41d59f get krb4 includes installed, do distrib-dirs if DESTDIR not set
tls authored
92 .endif
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
93 .endif
3c15833 stick distrib-dirs in beforeinstall -- should be cleaner?
tls authored
94
7413e10 add some new targets to DTRT when installing/building
cgd authored
95 afterinstall:
dbc0d26 convert from NOxxx= to MKxxx=no.
lukem authored
96 .if ${MKMAN} != "no" && !defined(_BUILD)
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
97 ${MAKE} ${_M} whatis.db
bc33876 if not installing man pages, don't remake whatis db
cgd authored
98 .endif
7413e10 add some new targets to DTRT when installing/building
cgd authored
99
9540b75 If doing a "domestic" build, make sure whatis.db is built _after_ the
scottr authored
100 whatis.db:
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
101 (cd ${.CURDIR}/share/man && ${MAKE} ${_M} makedb)
9540b75 If doing a "domestic" build, make sure whatis.db is built _after_ the
scottr authored
102
a3028a2 If updating from a system which has a /usr/pkg/info/dir, move that to
tv authored
103 # wrt info/dir below: It's safe to move this over top of /usr/share/info/dir,
104 # as the build will automatically remove/replace the non-pkg entries there.
105
b101583 Handle new make variable BUILD_DONE which creates an empty build targ…
jlam authored
106 .if defined(BUILD_DONE)
107 build:
108 @echo "Build installed into ${DESTDIR}"
109 .else
24f3405 Add a buildmsg target for build to depend upon instead of using an if…
erh authored
110 build: buildmsg beforeinstall
3a47919 Add the FORCE_DOMESTIC flag to force the 'all', 'includes',
scottr authored
111 .if defined(FORCE_DOMESTIC)
112 @echo '*** CAPUTE!'
113 @echo ' The FORCE_DOMESTIC flag is not compatible with "make build".'
114 @echo ' Please correct the problem and try again.'
115 @false
116 .endif
dbc0d26 convert from NOxxx= to MKxxx=no.
lukem authored
117 .if ${MKSHARE} != "no"
781d133 remove two of the previous ${_M}; they were invoked before $DESTDIR/s…
mrg authored
118 (cd ${.CURDIR}/share/mk && ${MAKE} install)
80792d5 don't install in /usr/share if NOSHARE is defined
lukem authored
119 .endif
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
120 .if !defined(UPDATE) && !defined(NOCLEANDIR)
781d133 remove two of the previous ${_M}; they were invoked before $DESTDIR/s…
mrg authored
121 ${MAKE} ${_J} ${_M} cleandir
649cdeb Don't cleandir on make build when UPDATE is set.
christos authored
122 .endif
9207e8a Revert previous but move "cd share/tmac" later down so that any
simonb authored
123 .if ${MKOBJDIRS} != "no"
c577d3e Add ${_M} where it was missing in a few places.
thorpej authored
124 ${MAKE} ${_M} obj
9207e8a Revert previous but move "cd share/tmac" later down so that any
simonb authored
125 .endif
b2ce7d1 HAVE_GCC28 -> HAVE_EGCS, and make it match gcc 2.9, as well.
thorpej authored
126 .if empty(HAVE_EGCS)
3acd090 Do not build libgcc 3 times.
mycroft authored
127 .if defined(DESTDIR)
128 @echo "*** CAPUTE!"
a3028a2 If updating from a system which has a /usr/pkg/info/dir, move that to
tv authored
129 @echo " You attempted to compile the world without egcs. You must"
3acd090 Do not build libgcc 3 times.
mycroft authored
130 @echo " first install a native egcs compiler."
a3028a2 If updating from a system which has a /usr/pkg/info/dir, move that to
tv authored
131 @false
3acd090 Do not build libgcc 3 times.
mycroft authored
132 .else
133 (cd ${.CURDIR}/gnu/usr.bin/egcs && \
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
134 ${MAKE} ${_M} ${_J} dependall MKMAN=no && \
135 ${MAKE} ${_M} MKMAN=no install && ${MAKE} ${_M} cleandir)
136 .endif
3acd090 Do not build libgcc 3 times.
mycroft authored
137 .endif
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
138 .if !defined(NOINCLUDES)
139 ${MAKE} ${_M} includes
3acd090 Do not build libgcc 3 times.
mycroft authored
140 .endif
4b20b67 During the initial library pass, do not install man pages.
mycroft authored
141 (cd ${.CURDIR}/lib/csu && \
1a134fc use MKSHARE=no instead.
mrg authored
142 ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
143 ${MAKE} ${_M} MKSHARE=no install)
4b20b67 During the initial library pass, do not install man pages.
mycroft authored
144 (cd ${.CURDIR}/lib && \
1a134fc use MKSHARE=no instead.
mrg authored
145 ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
146 ${MAKE} ${_M} MKSHARE=no install)
4b20b67 During the initial library pass, do not install man pages.
mycroft authored
147 (cd ${.CURDIR}/gnu/lib && \
1a134fc use MKSHARE=no instead.
mrg authored
148 ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
149 ${MAKE} ${_M} MKSHARE=no install)
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
150 ${MAKE} ${_M} ${_J} dependall && ${MAKE} ${_M} _BUILD= install
cbcc3bd Handle crypto-us just like domestic
christos authored
151 .if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM)
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
152 (cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_M} ${_J} _SLAVE_BUILD= build)
89822cd fix make build for non-usa domestic a better way
lukem authored
153 .endif
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
154 ${MAKE} ${_M} whatis.db
fa94a36 Print date after build completes as well as before. Previous code f…
mellon authored
155 @echo -n "Build finished at: "
156 @date
b101583 Handle new make variable BUILD_DONE which creates an empty build targ…
jlam authored
157 .endif
7413e10 add some new targets to DTRT when installing/building
cgd authored
158
f03f6b1 Add release and snapshot targets. (They do the same thing.)
cjs authored
159 release snapshot: build
5ae2328 fix long standing bug in `make build' with $DESTDIR:
mrg authored
160 (cd ${.CURDIR}/etc && ${MAKE} ${_M} INSTALL_DONE=1 release)
f03f6b1 Add release and snapshot targets. (They do the same thing.)
cjs authored
161
c589a90 initial import of 386bsd-0.1 sources
cgd authored
162 .include <bsd.subdir.mk>
Something went wrong with that request. Please try again.