1 # $NetBSD: bsd.own.mk,v 1.603 2009/12/06 16:15:15 uebayasi Exp $
3 .if
!defined
(_MINIX_OWN_MK_
)
7 SMP_FLAGS
+= -DCONFIG_SMP
9 SMP_FLAGS
+= -DCONFIG_MAX_CPUS
=${CONFIG_MAX_CPUS}
13 CPPFLAGS
+= ${SMP_FLAGS}
15 MAKECONF?
= /etc
/make.conf
16 .
-include "${MAKECONF}"
23 # CPU model, derived from MACHINE_ARCH
25 MACHINE_CPU
= ${MACHINE_ARCH
:C
/mipse
[bl
]/mips
/:C
/mips64e
[bl
]/mips
/:C
/sh3e
[bl
]/sh3
/:S
/m68000
/m68k
/:S
/armeb
/arm
/}
28 # Subdirectory used below ${RELEASEDIR} when building a release
30 RELEASEMACHINEDIR?
= ${MACHINE}
33 # Subdirectory or path component used for the following paths:
34 # distrib/${RELEASEMACHINE}
35 # distrib/notes/${RELEASEMACHINE}
36 # etc/etc.${RELEASEMACHINE}
37 # Used when building a release.
39 RELEASEMACHINE?
= ${MACHINE}
42 # NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
43 # ensure that things defined by <bsd.own.mk> (default targets,
44 # INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
46 NEED_OWN_INSTALL_TARGET?
= yes
49 # This lists the platforms which do not have working in-tree toolchains.
50 # For the in-tree gcc 3.3.2 toolchain, this list is empty.
51 # If some future port is not supported by the in-tree toolchain, this
52 # should be set to "yes" for that port only.
54 TOOLCHAIN_MISSING?
= no
57 .if
!defined
(HAVE_GCC
) && !defined
(HAVE_PCC
)
59 .if
!defined
(_GCC_LIBGCCDIR
)
60 _GCC_LIBGCCDIR
= ${DESTDIR}/usr
/lib
65 ${MACHINE_ARCH} == "i386" || \
66 ${MACHINE_ARCH} == "powerpc" || \
67 ${MACHINE_ARCH} == "x86_64"
68 USE_COMPILERCRTSTUFF?
= no
70 USE_COMPILERCRTSTUFF?
= yes
77 # default to binutils 2.19
80 CPPFLAG_ISYSTEM
= -isystem
83 CPPFLAG_ISYSTEMXX
= -isystem-cxx
85 CPPFLAG_ISYSTEMXX
= -cxx-isystem
89 .if empty
(.MAKEFLAGS
:M-V
*)
90 .if defined
(MAKEOBJDIRPREFIX
) || defined
(MAKEOBJDIR
)
91 PRINTOBJDIR
= ${MAKE} -r
-V .OBJDIR
-f
/dev
/null xxx
93 PRINTOBJDIR
= ${MAKE} -V .OBJDIR
96 PRINTOBJDIR
= echo
# prevent infinite recursion
101 # Determine if running in the NetBSD source tree by checking for the
102 # existence of build.sh and tools/ in the current or a parent directory,
103 # and setting _SRC_TOP_ to the result.
105 .if
!defined
(_SRC_TOP_
) # {
106 _SRC_TOP_
!= cd
${.CURDIR
}; while
:; do \
108 [ -f build.sh
] && [ -d tools
] && { echo
$$here; break
; }; \
109 case
$$here in
/) echo
""; break
;; esac
; \
112 .MAKEOVERRIDES
+= _SRC_TOP_
117 # If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
118 # defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
120 .if
(${_SRC_TOP_} != "") # {
122 NETBSDSRCDIR?
= ${_SRC_TOP_}
124 .if
!defined
(_SRC_TOP_OBJ_
)
125 _SRC_TOP_OBJ_
!= cd
${_SRC_TOP_} && ${PRINTOBJDIR}
126 .MAKEOVERRIDES
+= _SRC_TOP_OBJ_
129 .
endif # _SRC_TOP_ != "" # }
132 .if
(${_SRC_TOP_} != "") && \
133 (${TOOLCHAIN_MISSING} == "no" || defined
(EXTERNAL_TOOLCHAIN
))
134 .if
(defined
(BUILDSH
))
141 .if
${MACHINE_ARCH} == "mips" ||
${MACHINE_ARCH} == "mips64" || \
142 ${MACHINE_ARCH} == "sh3"
144 @echo
"Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
146 .elif defined
(REQUIRETOOLS
) && \
147 (${TOOLCHAIN_MISSING} == "no" || defined
(EXTERNAL_TOOLCHAIN
)) && \
150 @echo
"USETOOLS=no, but this component requires a version-specific host toolchain"
155 # Host platform information; may be overridden
157 .if
!defined
(HOST_OSTYPE
)
158 _HOST_OSNAME
!= uname
-s
159 _HOST_OSREL
!= uname
-r
160 # For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints
161 # something that does not look like an identifier, then use uname -m.
162 _HOST_ARCH
!= uname
-p
2>/dev
/null
163 _HOST_ARCH
:= ${HOST_ARCH
:tW
:C
/.
*[^
-_A-Za-z0-9
].
*//:S
/unknown
//}
164 .if empty
(_HOST_ARCH
)
165 _HOST_ARCH
!= uname
-m
167 HOST_OSTYPE
:= ${_HOST_OSNAME}-${_HOST_OSREL
:C
/\
([^\
)]*\
)//g
:[*]:C
/ /_
/g
}-${_HOST_ARCH
:C
/\
([^\
)]*\
)//g
:[*]:C
/ /_
/g
}
168 .MAKEOVERRIDES
+= HOST_OSTYPE
169 .
endif # !defined(HOST_OSTYPE)
171 .if
${USETOOLS} == "yes" # {
174 # Provide a default for TOOLDIR.
176 .if
!defined
(TOOLDIR
)
177 TOOLDIR
:= ${_SRC_TOP_OBJ_}/tooldir.
${HOST_OSTYPE}
178 .MAKEOVERRIDES
+= TOOLDIR
182 # This is the prefix used for the NetBSD-sourced tools.
187 # If an external toolchain base is specified, use it.
189 .if defined
(EXTERNAL_TOOLCHAIN
) # {
190 AR
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-ar
191 AS
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-as
192 LD
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-ld
193 NM
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-nm
194 OBJCOPY
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-objcopy
195 OBJDUMP
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-objdump
196 RANLIB
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-ranlib
197 SIZE
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-size
198 STRIP
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-strip
200 CC
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-gcc
201 CPP
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-cpp
202 CXX
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-c
++
203 FC
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-g77
204 OBJC
= ${EXTERNAL_TOOLCHAIN}/bin
/${MACHINE_GNU_PLATFORM}-gcc
206 # Define default locations for common tools.
207 .if
${USETOOLS_BINUTILS
:Uyes
} == "yes" # {
208 AR
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-ar
209 AS
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-as
210 LD
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-ld
211 NM
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-nm
212 OBJCOPY
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-objcopy
213 OBJDUMP
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-objdump
214 RANLIB
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-ranlib
215 SIZE
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-size
216 STRIP
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-strip
219 .if defined
(HAVE_GCC
) && ${USETOOLS_GCC
:Uyes
} == "yes" # {
220 CC
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-gcc
221 CPP
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-cpp
222 CXX
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-c
++
223 FC
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-g77
224 OBJC
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-gcc
227 .if defined
(HAVE_PCC
) && ${USETOOLS_PCC
:Uyes
} == "yes"
228 CC
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-pcc
229 CPP
= ${TOOLDIR}/libexec
/${MACHINE_GNU_PLATFORM}-cpp
231 FC
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-f77
235 .
endif # EXTERNAL_TOOLCHAIN # }
237 HOST_MKDEP
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}host-mkdep
239 DBSYM
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-dbsym
240 ELF2ECOFF
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}mips-elf2ecoff
241 INSTALL
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-install
242 LEX
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}lex
243 LINT
= CC
=${CC
:Q
} ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-lint
244 LORDER
= NM
=${NM
:Q
} MKTEMP
=${TOOL_MKTEMP
:Q
} ${TOOLDIR}/bin
/${_TOOL_PREFIX}lorder
245 MKDEP
= CC
=${CC
:Q
} ${TOOLDIR}/bin
/${_TOOL_PREFIX}mkdep
246 PAXCTL
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}paxctl
247 TSORT
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}tsort
-q
248 YACC
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}yacc
250 TOOL_AMIGAAOUT2BB
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}amiga-aout2bb
251 TOOL_AMIGAELF2BB
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}amiga-elf2bb
252 TOOL_AMIGATXLT
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}amiga-txlt
253 TOOL_ASN1_COMPILE
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}asn1_compile
254 TOOL_ATF_COMPILE
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}atf-compile
255 TOOL_AWK
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}awk
256 TOOL_CAP_MKDB
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}cap_mkdb
257 TOOL_CAT
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}cat
258 TOOL_CKSUM
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}cksum
259 TOOL_COMPILE_ET
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}compile_et
260 TOOL_CONFIG
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}config
261 TOOL_CRUNCHGEN
= MAKE
=${.MAKE
:Q
} ${TOOLDIR}/bin
/${_TOOL_PREFIX}crunchgen
262 TOOL_CTAGS
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}ctags
263 TOOL_DB
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}db
264 TOOL_DISKLABEL
= ${TOOLDIR}/bin
/nbdisklabel-
${MAKEWRAPPERMACHINE}
265 TOOL_EQN
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}eqn
266 TOOL_FDISK
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-fdisk
267 TOOL_FGEN
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}fgen
268 TOOL_GENASSYM
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}genassym
269 TOOL_GENCAT
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}gencat
270 TOOL_GMAKE
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}gmake
271 TOOL_GREP
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}grep
272 TOOL_GROFF
= PATH
=${TOOLDIR}/lib
/groff
:$${PATH} ${TOOLDIR}/bin
/${_TOOL_PREFIX}groff
273 TOOL_HEXDUMP
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}hexdump
274 TOOL_HP300MKBOOT
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}hp300-mkboot
275 TOOL_HP700MKBOOT
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}hp700-mkboot
276 TOOL_INDXBIB
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}indxbib
277 TOOL_INSTALLBOOT
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}installboot
278 TOOL_INSTALL_INFO
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}install-info
279 TOOL_JOIN
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}join
280 TOOL_M4
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}m4
281 TOOL_MACPPCFIXCOFF
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}macppc-fixcoff
282 TOOL_MAKEFS
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}makefs
283 TOOL_MAKEINFO
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}makeinfo
284 TOOL_MAKEWHATIS
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}makewhatis
285 TOOL_MANDOC_ASCII
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}mandoc
-Tascii
286 TOOL_MANDOC_HTML
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}mandoc
-Thtml
287 TOOL_MANDOC_LINT
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}mandoc
-Tlint
288 TOOL_MDSETIMAGE
= ${TOOLDIR}/bin
/${MACHINE_GNU_PLATFORM}-mdsetimage
289 TOOL_MENUC
= MENUDEF
=${TOOLDIR}/share
/misc
${TOOLDIR}/bin
/${_TOOL_PREFIX}menuc
290 TOOL_MIPSELF2ECOFF
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}mips-elf2ecoff
291 TOOL_MKCSMAPPER
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}mkcsmapper
292 TOOL_MKESDB
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}mkesdb
293 TOOL_MKFSMFS
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}mkfs.mfs
294 TOOL_MKLOCALE
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}mklocale
295 TOOL_MKMAGIC
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}file
296 TOOL_MKTEMP
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}mktemp
297 TOOL_MSGC
= MSGDEF
=${TOOLDIR}/share
/misc
${TOOLDIR}/bin
/${_TOOL_PREFIX}msgc
298 TOOL_MTREE
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}mtree
299 TOOL_PAX
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}pax
300 TOOL_PIC
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}pic
301 TOOL_PKG_CREATE
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}pkg_create
302 TOOL_POWERPCMKBOOTIMAGE
=${TOOLDIR}/bin
/${_TOOL_PREFIX}powerpc-mkbootimage
303 TOOL_PWD_MKDB
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}pwd_mkdb
304 TOOL_REFER
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}refer
305 TOOL_ROFF_ASCII
= PATH
=${TOOLDIR}/lib
/groff
:$${PATH} ${TOOLDIR}/bin
/${_TOOL_PREFIX}nroff
306 TOOL_ROFF_DVI
= ${TOOL_GROFF} -Tdvi
307 TOOL_ROFF_HTML
= ${TOOL_GROFF} -Tlatin1
-mdoc2html
308 TOOL_ROFF_PS
= ${TOOL_GROFF} -Tps
309 TOOL_ROFF_RAW
= ${TOOL_GROFF} -Z
310 TOOL_RPCGEN
= RPCGEN_CPP
=${CPP
:Q
} ${TOOLDIR}/bin
/${_TOOL_PREFIX}rpcgen
311 TOOL_SED
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}sed
312 TOOL_SOELIM
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}soelim
313 TOOL_SPARKCRC
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}sparkcrc
314 TOOL_STAT
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}stat
315 TOOL_STRFILE
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}strfile
316 TOOL_SUNLABEL
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}sunlabel
317 TOOL_TBL
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}tbl
318 TOOL_TIC
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}tic
319 TOOL_UUDECODE
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}uudecode
320 TOOL_VGRIND
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}vgrind
-f
321 TOOL_ZIC
= ${TOOLDIR}/bin
/${_TOOL_PREFIX}zic
323 .
else # USETOOLS != yes # } {
325 TOOL_AMIGAAOUT2BB
= amiga-aout2bb
326 TOOL_AMIGAELF2BB
= amiga-elf2bb
327 TOOL_AMIGATXLT
= amiga-txlt
328 TOOL_ASN1_COMPILE
= asn1_compile
329 TOOL_ATF_COMPILE
= atf-compile
331 TOOL_CAP_MKDB
= cap_mkdb
334 TOOL_COMPILE_ET
= compile_et
336 TOOL_CRUNCHGEN
= crunchgen
339 TOOL_DISKLABEL
= disklabel
343 TOOL_GENASSYM
= genassym
348 TOOL_HEXDUMP
= hexdump
349 TOOL_HP300MKBOOT
= hp300-mkboot
350 TOOL_HP700MKBOOT
= hp700-mkboot
351 TOOL_INDXBIB
= indxbib
352 TOOL_INSTALLBOOT
= installboot
353 TOOL_INSTALL_INFO
= install-info
356 TOOL_MACPPCFIXCOFF
= macppc-fixcoff
358 TOOL_MAKEINFO
= makeinfo
359 TOOL_MAKEWHATIS
= /usr
/libexec
/makewhatis
360 #TOOL_MAKEWHATIS= /usr/bin/makewhatis
361 TOOL_MDSETIMAGE
= mdsetimage
363 TOOL_MIPSELF2ECOFF
= mips-elf2ecoff
364 TOOL_MKCSMAPPER
= mkcsmapper
366 TOOL_MKFSMFS
= mkfs.mfs
367 TOOL_MKLOCALE
= mklocale
374 TOOL_PKG_CREATE
= pkg_create
375 TOOL_POWERPCMKBOOTIMAGE
= powerpc-mkbootimage
376 TOOL_PWD_MKDB
= pwd_mkdb
378 TOOL_ROFF_ASCII
= nroff
379 TOOL_ROFF_DVI
= ${TOOL_GROFF} -Tdvi
380 TOOL_ROFF_HTML
= ${TOOL_GROFF} -Tlatin1
-mdoc2html
381 TOOL_ROFF_PS
= ${TOOL_GROFF} -Tps
382 TOOL_ROFF_RAW
= ${TOOL_GROFF} -Z
386 TOOL_SPARKCRC
= sparkcrc
388 TOOL_STRFILE
= strfile
389 TOOL_SUNLABEL
= sunlabel
392 TOOL_UUDECODE
= uudecode
393 TOOL_VGRIND
= vgrind
-f
396 .
endif # USETOOLS != yes # }
399 # Targets to check if DESTDIR or RELEASEDIR is provided
401 .if
!target
(check_DESTDIR
)
402 check_DESTDIR
: .PHONY .NOTMAIN
403 .if
!defined
(DESTDIR
)
404 @echo
"setenv DESTDIR before doing that!"
411 .if
!target
(check_RELEASEDIR
)
412 check_RELEASEDIR
: .PHONY .NOTMAIN
413 .if
!defined
(RELEASEDIR
)
414 @echo
"setenv RELEASEDIR before doing that!"
422 .if
${USETOOLS} == "yes" # {
424 # Make sure DESTDIR is set, so that builds with these tools always
425 # get appropriate -nostdinc, -nostdlib, etc. handling. The default is
426 # <empty string>, meaning start from /, the root directory.
432 # Build a dynamically linked /bin and /sbin, with the necessary shared
433 # libraries moved from /usr/lib to /lib and the shared linker moved
434 # from /usr/libexec to /lib
436 # Note that if the BINDIR is not /bin or /sbin, then we always use the
437 # non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
438 # and /sbin). See <bsd.shlib.mk>.
443 # Where the system object and source trees are kept; can be configurable
444 # by the user in case they want them in ~/foosrc and ~/fooobj (for example).
448 NETBSDSRCDIR?
= ${BSDSRCDIR}
456 #MANDIR?= /usr/share/man
461 MANMODE?
= ${NONBINMODE}
462 #MANINSTALL?= catinstall htmlinstall maninstall
463 MANINSTALL?
= maninstall
465 INFODIR?
= /usr
/share
/info
469 INFOMODE?
= ${NONBINMODE}
473 LINTLIBDIR?
= /usr
/libdata
/lint
476 LIBMODE?
= ${NONBINMODE}
478 DOCDIR?
= /usr
/share
/doc
479 HTMLDOCDIR?
= /usr
/share
/doc
/html
483 DOCMODE?
= ${NONBINMODE}
485 NLSDIR?
= /usr
/share
/nls
488 NLSMODE?
= ${NONBINMODE}
492 KMODULEMODE?
= ${NONBINMODE}
494 LOCALEDIR?
= /usr
/share
/locale
497 LOCALEMODE?
= ${NONBINMODE}
499 FIRMWAREDIR?
= /libdata
/firmware
502 FIRMWAREMODE?
= ${NONBINMODE}
504 DEBUGDIR?
= /usr
/libdata
/debug
507 DEBUGMODE?
= ${NONBINMODE}
510 # Data-driven table using make variables to control how
511 # toolchain-dependent targets and shared libraries are built
512 # for different platforms and object formats.
514 # OBJECT_FMT: currently either "ELF" or "a.out".
516 # All platforms are ELF.
521 # If this platform's toolchain is missing, we obviously cannot build it.
523 .if
${TOOLCHAIN_MISSING} != "no"
530 # If we are using an external toolchain, we can still build the target's
531 # binutils, but we cannot build GCC's support libraries, since those are
532 # tightly-coupled to the version of GCC being used.
534 .if defined
(EXTERNAL_TOOLCHAIN
)
539 # The m68000 port is incomplete.
541 .if
${MACHINE_ARCH} == "m68000"
544 # XXX GCC 4 outputs mcount() calling sequences that try to load values
545 # from over 64KB away and this fails to assemble.
546 .if defined
(HAVE_GCC
) && (${HAVE_GCC} == 4)
552 # The ia64 port is incomplete.
554 .if
${MACHINE_ARCH} == "ia64"
560 # On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
561 # not just shared libraries, so don't build the _pic version.
563 .if
${MACHINE_ARCH} == "mipsel" ||
${MACHINE_ARCH} == "mipseb" || \
564 ${MACHINE_ARCH} == "mips64el" ||
${MACHINE_ARCH} == "mips64eb"
569 # On VAX using ELF, all objects are PIC, not just shared libraries,
570 # so don't build the _pic version. Unless we are using GCC3 which
571 # doesn't support PIC yet.
573 .if
${MACHINE_ARCH} == "vax"
578 # Location of the file that contains the major and minor numbers of the
579 # version of a shared library. If this file exists a shared library
580 # will be built by <bsd.lib.mk>.
582 SHLIB_VERSION_FILE?
= ${.CURDIR
}/shlib_version
585 # GNU sources and packages sometimes see architecture names differently.
587 GNU_ARCH.coldfire
=m68k
589 GCC_CONFIG_ARCH.i386
=i486
590 GCC_CONFIG_TUNE.i386
=nocona
591 GCC_CONFIG_TUNE.x86_64
=nocona
592 GNU_ARCH.m68000
=m68010
595 GNU_ARCH.mips64eb
=mips64
596 MACHINE_GNU_ARCH
=${GNU_ARCH.
${MACHINE_ARCH}:U
${MACHINE_ARCH}}
599 # In order to identify NetBSD to GNU packages, we sometimes need
600 # an "elf" tag for historically a.out platforms.
602 .if
${OBJECT_FMT} == "ELF" && \
603 (${MACHINE_GNU_ARCH} == "arm" || \
604 ${MACHINE_GNU_ARCH} == "armeb" || \
605 ${MACHINE_ARCH} == "i386" || \
606 ${MACHINE_CPU} == "m68k" || \
607 ${MACHINE_GNU_ARCH} == "sh" || \
608 ${MACHINE_GNU_ARCH} == "shle" || \
609 ${MACHINE_ARCH} == "sparc" || \
610 ${MACHINE_ARCH} == "vax")
611 MACHINE_GNU_PLATFORM?
=${MACHINE_GNU_ARCH}--netbsdelf
613 MACHINE_GNU_PLATFORM?
=${MACHINE_GNU_ARCH}--netbsd
617 # Determine if arch uses native kernel modules with rump
619 .if
${MACHINE_ARCH} == "i386" || \
620 ${MACHINE_ARCH} == "x86_64"
624 TARGETS
+= all clean cleandir depend dependall includes \
625 install lint obj regress
tags html
626 PHONY_NOTMAIN
= all clean cleandir depend dependall
distclean includes \
627 install lint obj regress
tags beforedepend afterdepend \
628 beforeinstall afterinstall realinstall realdepend realall \
629 html subdir-all subdir-install subdir-depend
630 .PHONY
: ${PHONY_NOTMAIN}
631 .NOTMAIN
: ${PHONY_NOTMAIN}
633 .if
${NEED_OWN_INSTALL_TARGET} != "no"
635 install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
641 all: realall subdir-all
644 depend
: realdepend subdir-depend
650 dependall
: .NOTMAIN realdepend .MAKE
651 @cd
${.CURDIR
}; ${MAKE} realall
655 # Define MKxxx variables (which are either yes or no) for users
656 # to set in /etc/mk.conf and override in the make environment.
657 # These should be tested with `== "no"' or `!= "no"'.
658 # The NOxxx variables should only be set by Makefiles.
660 # Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
661 # with changes to the MK* variables here.
665 # Supported NO* options (if defined, MK* will be forced to "no",
666 # regardless of user's mk.conf setting).
668 # Source makefiles should set NO*, and not MK*, and must do so before
669 # including bsd.own.mk.
672 NOCRYPTO NODOC NOHTML NOINFO NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \
673 NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB
675 MK
${var
:S
/^NO
//}:= no
680 # Older-style variables that enabled behaviour when set.
682 .for var in MANZ UNPRIVED UPDATE
689 # MK* options which have variable defaults.
691 .if
${MACHINE} == "amd64" ||
${MACHINE} == "sparc64"
694 # Don't let this build where it really isn't supported.
699 # MK* backward compatibility.
702 MKBINUTILS?
= ${MKBFD}
706 # We want to build zfs only for i386 and amd64 by default for now.
708 .if
${MACHINE} == "amd64" ||
${MACHINE} == "i386"
712 # Some tough Minix defaults
717 # Is a clang installed that understands what to do with -shared,
718 # needed to build shared libraries? If not then default to no
719 # to build them. (It could still be done with gcc though so MKPIC
720 # might be set to yes by the user.)
721 .if
!exists
(/usr
/pkg
/bin
/clang.dynok
)
722 NONPICCLANG
= yes
# Hint to other Makefiles
727 # MK* options which default to "yes".
732 MKCATPAGES MKCRYPTO MKCOMPLEX MKCVS \
734 MKGCC MKGCCCMDS MKGDB \
736 MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
739 MKLDAP MKLINKLIB MKLINT MKLVM \
745 MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
746 MKSHARE MKSKEY MKSTATICLIB \
751 MKMCONTEXT MKSYSDEBUG MKLIVEUPDATE MKSTATECTL MKTRACE
752 .if
(${MACHINE_ARCH} == "i386")
754 MKWATCHDOG MKACPI MKAPIC MKDEBUGREG MKINSTALLBOOT MKPCI
757 .for var in
${_MKVARS.yes
}
762 # MK* options which default to "no".
765 MKCRYPTO_IDEA MKCRYPTO_MDC2 MKCRYPTO_RC5 MKDEBUG MKDEBUGLIB \
766 MKEXTSRC MKCOVERAGE \
767 MKMANDOC MKMANZ MKOBJDIRS \
769 MKSOFTFLOAT MKSTRIPIDENT \
770 MKUNPRIVED MKUPDATE MKX11 MKZFS MKBSDTAR \
774 MKIMAGEONLY MKSMALL USETOOLS
775 .if
(${MACHINE_ARCH} == "arm")
777 MKWATCHDOG MKACPI MKAPIC MKDEBUGREG MKINSTALLBOOT MKPCI
779 .for var in
${_MKVARS.no
}
784 # Force some options off if their dependencies are off.
787 .if
${MKCRYPTO} == "no"
796 .if
${MKLINKLIB} == "no"
810 .if
${MKSHARE} == "no"
820 .if
${MKSMALL} == "yes"
834 # install(1) parameters.
837 .if
${MKUPDATE} == "no"
842 #XXX: Not supported by MINIX install
847 METALOG?
= ${DESTDIR}/METALOG
848 METALOG.add?
= ${TOOL_CAT} -l
>> ${METALOG}
849 .if
(${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
850 .if
${MKUNPRIVED} != "no"
851 INSTPRIV.unpriv
=-U
-M
${METALOG} -D
${DESTDIR} -h sha256
855 INSTPRIV?
= ${INSTPRIV.unpriv
} -N
${NETBSDSRCDIR}/etc
858 #XXX: Strip flag for MINIX
861 .if
${NEED_OWN_INSTALL_TARGET} != "no"
862 INSTALL_DIR?
= ${INSTALL} ${INSTPRIV} -d
863 INSTALL_FILE?
= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
864 INSTALL_LINK?
= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
865 INSTALL_SYMLINK?
= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
866 HOST_INSTALL_FILE?
= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
867 HOST_INSTALL_DIR?
= ${INSTALL} -d
868 HOST_INSTALL_SYMLINK?
= ${INSTALL} ${SYMLINK} ${RENAME}
872 # Set defaults for the USE_xxx variables.
876 # USE_* options which default to "no" and will be forced to "no" if their
877 # corresponding MK* variable is set to "no".
880 .if
(${${var
:S
/USE_
/MK
/}} == "no")
888 # USE_* options which default to "yes" unless their corresponding MK*
889 # variable is set to "no".
891 .for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP \
892 USE_WATCHDOG USE_ACPI USE_APIC USE_MCONTEXT USE_DEBUGREG USE_SYSDEBUG \
893 USE_LIVEUPDATE USE_STATECTL USE_TRACE USE_PCI
894 .if
(${${var
:S
/USE_
/MK
/}} == "no")
902 # USE_* options which default to "yes".
904 .for var in USE_JEMALLOC
909 # USE_* options which default to "no".
917 # MAKEDIRTARGET dir target [extra make(1) params]
918 # run "cd $${dir} && ${MAKE} [params] $${target}", with a pretty message
921 @_makedirtarget
() { \
923 target
="$$1"; shift
; \
925 /*) this
="$${dir}/"; \
927 .
) this
="${_THISDIR_}"; \
928 real
="${.CURDIR}" ;; \
929 *) this
="${_THISDIR_}$${dir}/"; \
930 real
="${.CURDIR}/$${dir}" ;; \
933 echo
"$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
935 && ${MAKE} _THISDIR_
="$${this}" "$$@" $${target}; \
940 # MAKEVERBOSE support. Levels are:
941 # 0 Minimal output ("quiet")
942 # 1 Describe what is occurring
943 # 2 Describe what is occurring and echo the actual command
944 # 3 Ignore the effect of the "@" prefix in make commands
945 # 4 Trace shell commands using the shell's -x flag
949 .if
${MAKEVERBOSE} == 0
954 .elif
${MAKEVERBOSE} == 1
959 .
else # MAKEVERBOSE >= 2
961 _MKSHMSG?
= echo
'\# '
963 .SILENT
: __makeverbose_dummy_target__
964 .
endif # MAKEVERBOSE >= 2
965 .if
${MAKEVERBOSE} >= 3
967 .
endif # ${MAKEVERBOSE} >= 3
968 .if
${MAKEVERBOSE} >= 4
970 .
endif # ${MAKEVERBOSE} >= 4
972 _MKMSG_BUILD?
= ${_MKMSG} " build "
973 _MKMSG_CREATE?
= ${_MKMSG} " create "
974 _MKMSG_COMPILE?
= ${_MKMSG} "compile "
975 _MKMSG_FORMAT?
= ${_MKMSG} " format "
976 _MKMSG_INSTALL?
= ${_MKMSG} "install "
977 _MKMSG_LINK?
= ${_MKMSG} " link "
978 _MKMSG_LEX?
= ${_MKMSG} " lex "
979 _MKMSG_REMOVE?
= ${_MKMSG} " remove "
980 _MKMSG_YACC?
= ${_MKMSG} " yacc "
982 _MKSHMSG_CREATE?
= ${_MKSHMSG} " create "
983 _MKSHMSG_INSTALL?
= ${_MKSHMSG} "install "
985 _MKTARGET_BUILD?
= ${_MKMSG_BUILD} ${.CURDIR
:T
}/${.TARGET
}
986 _MKTARGET_CREATE?
= ${_MKMSG_CREATE} ${.CURDIR
:T
}/${.TARGET
}
987 _MKTARGET_COMPILE?
= ${_MKMSG_COMPILE} ${.CURDIR
:T
}/${.TARGET
}
988 _MKTARGET_FORMAT?
= ${_MKMSG_FORMAT} ${.CURDIR
:T
}/${.TARGET
}
989 _MKTARGET_INSTALL?
= ${_MKMSG_INSTALL} ${.TARGET
}
990 _MKTARGET_LINK?
= ${_MKMSG_LINK} ${.CURDIR
:T
}/${.TARGET
}
991 _MKTARGET_LEX?
= ${_MKMSG_LEX} ${.CURDIR
:T
}/${.TARGET
}
992 _MKTARGET_REMOVE?
= ${_MKMSG_REMOVE} ${.TARGET
}
993 _MKTARGET_YACC?
= ${_MKMSG_YACC} ${.CURDIR
:T
}/${.TARGET
}
995 .if
${MKMANDOC} == "yes"
996 TARGETS
+= lintmanpages
999 .
endif # !defined(_MINIX_OWN_MK_)