Annotation of src/share/mk/bsd.own.mk, Revision 1.662
1.662 ! joerg 1: # $NetBSD: bsd.own.mk,v 1.661 2011/04/17 15:03:37 christos Exp $
1.611 mrg 2:
3: # This needs to be before bsd.init.mk
4: .if defined(BSD_MK_COMPAT_FILE)
5: .include <${BSD_MK_COMPAT_FILE}>
6: .endif
1.64 lukem 7:
8: .if !defined(_BSD_OWN_MK_)
9: _BSD_OWN_MK_=1
1.24 thorpej 10:
1.169 tv 11: MAKECONF?= /etc/mk.conf
1.205 tv 12: .-include "${MAKECONF}"
1.13 mycroft 13:
1.341 lukem 14: #
1.310 thorpej 15: # CPU model, derived from MACHINE_ARCH
1.341 lukem 16: #
1.624 mrg 17: MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/:S/powerpc64/powerpc/}
1.310 thorpej 18:
1.341 lukem 19: #
1.418 cl 20: # Subdirectory used below ${RELEASEDIR} when building a release
21: #
22: RELEASEMACHINEDIR?= ${MACHINE}
23:
24: #
25: # Subdirectory or path component used for the following paths:
26: # distrib/${RELEASEMACHINE}
27: # distrib/notes/${RELEASEMACHINE}
28: # etc/etc.${RELEASEMACHINE}
29: # Used when building a release.
30: #
31: RELEASEMACHINE?= ${MACHINE}
32:
33: #
1.209 tv 34: # NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
35: # ensure that things defined by <bsd.own.mk> (default targets,
36: # INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
1.341 lukem 37: #
1.209 tv 38: NEED_OWN_INSTALL_TARGET?= yes
39:
1.341 lukem 40: #
1.644 skrll 41: # This lists the platforms which do not have working in-tree toolchains. For
42: # the in-tree gcc toolchain, this list is empty.
43: #
44: # If some future port is not supported by the in-tree toolchain, this should
45: # be set to "yes" for that port only.
1.341 lukem 46: #
1.448 mrg 47: TOOLCHAIN_MISSING?= no
1.221 thorpej 48:
1.477 matt 49: # default to GCC4
1.519 gmcgarry 50: .if !defined(HAVE_GCC) && !defined(HAVE_PCC)
51: HAVE_GCC= 4
52: .endif
1.395 mrg 53:
1.643 skrll 54: .if \
55: ${MACHINE_ARCH} == "i386" || \
56: ${MACHINE_ARCH} == "x86_64"
57: USE_COMPILERCRTSTUFF?= no
58: .endif
59: USE_COMPILERCRTSTUFF?= yes
60:
1.493 chs 61: # default to GDB6
1.476 christos 62: HAVE_GDB?= 6
1.456 christos 63:
1.594 skrll 64: # default to binutils 2.19
1.573 skrll 65: HAVE_BINUTILS?= 219
1.568 skrll 66:
1.222 perry 67: .if empty(.MAKEFLAGS:M-V*)
1.489 dsl 68: .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
69: PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx
70: .else
1.488 drochner 71: PRINTOBJDIR= ${MAKE} -V .OBJDIR
1.489 dsl 72: .endif
1.222 perry 73: .else
74: PRINTOBJDIR= echo # prevent infinite recursion
75: .endif
76:
1.341 lukem 77: #
1.286 lukem 78: # Determine if running in the NetBSD source tree by checking for the
79: # existence of build.sh and tools/ in the current or a parent directory,
80: # and setting _SRC_TOP_ to the result.
81: #
1.287 lukem 82: .if !defined(_SRC_TOP_) # {
1.615 christos 83: _SRC_TOP_!= cd "${.CURDIR}"; while :; do \
1.200 jmc 84: here=`pwd`; \
1.199 jmc 85: [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
86: case $$here in /) echo ""; break;; esac; \
1.341 lukem 87: cd ..; done
1.199 jmc 88:
89: .MAKEOVERRIDES+= _SRC_TOP_
90:
1.287 lukem 91: .endif # }
1.222 perry 92:
1.341 lukem 93: #
1.322 lukem 94: # If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
1.288 lukem 95: # defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
1.287 lukem 96: #
97: .if (${_SRC_TOP_} != "") # {
98:
1.288 lukem 99: NETBSDSRCDIR?= ${_SRC_TOP_}
1.180 tv 100:
1.287 lukem 101: .if !defined(_SRC_TOP_OBJ_)
1.615 christos 102: _SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR}
1.287 lukem 103: .MAKEOVERRIDES+= _SRC_TOP_OBJ_
1.286 lukem 104: .endif
105:
1.322 lukem 106: .endif # _SRC_TOP_ != "" # }
1.286 lukem 107:
108:
1.310 thorpej 109: .if (${_SRC_TOP_} != "") && \
1.406 lukem 110: (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
1.287 lukem 111: USETOOLS?= yes
1.286 lukem 112: .endif
1.287 lukem 113: USETOOLS?= no
114:
1.286 lukem 115:
1.468 matt 116: .if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
1.495 scw 117: ${MACHINE_ARCH} == "sh3"
1.180 tv 118: .BEGIN:
119: @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
120: @false
1.310 thorpej 121: .elif defined(REQUIRETOOLS) && \
1.406 lukem 122: (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
1.310 thorpej 123: ${USETOOLS} == "no"
1.180 tv 124: .BEGIN:
1.203 tv 125: @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
1.180 tv 126: @false
127: .endif
128:
1.341 lukem 129: #
1.204 tv 130: # Host platform information; may be overridden
1.341 lukem 131: #
1.204 tv 132: .if !defined(HOST_OSTYPE)
133: _HOST_OSNAME!= uname -s
134: _HOST_OSREL!= uname -r
1.558 apb 135: # For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints
136: # something that does not look like an identifier, then use uname -m.
137: _HOST_ARCH!= uname -p 2>/dev/null
1.559 apb 138: _HOST_ARCH:= ${HOST_ARCH:tW:C/.*[^-_A-Za-z0-9].*//:S/unknown//}
1.558 apb 139: .if empty(_HOST_ARCH)
140: _HOST_ARCH!= uname -m
141: .endif
1.421 jmc 142: HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g}
1.204 tv 143: .MAKEOVERRIDES+= HOST_OSTYPE
1.558 apb 144: .endif # !defined(HOST_OSTYPE)
1.204 tv 145:
1.275 lukem 146: .if ${USETOOLS} == "yes" # {
147:
1.341 lukem 148: #
1.204 tv 149: # Provide a default for TOOLDIR.
1.341 lukem 150: #
1.199 jmc 151: .if !defined(TOOLDIR)
1.339 lukem 152: TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
1.204 tv 153: .MAKEOVERRIDES+= TOOLDIR
1.199 jmc 154: .endif
1.180 tv 155:
1.341 lukem 156: #
1.320 thorpej 157: # This is the prefix used for the NetBSD-sourced tools.
1.341 lukem 158: #
1.320 thorpej 159: _TOOL_PREFIX?= nb
160:
1.341 lukem 161: #
1.318 thorpej 162: # If an external toolchain base is specified, use it.
1.341 lukem 163: #
164: .if defined(EXTERNAL_TOOLCHAIN) # {
1.318 thorpej 165: AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
166: AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
167: LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
168: NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
169: OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
170: OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
171: RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
172: SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
173: STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
174:
175: CC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
176: CPP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
177: CXX= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
178: FC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
179: OBJC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
1.341 lukem 180: .else # } {
1.204 tv 181: # Define default locations for common tools.
1.341 lukem 182: .if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
1.232 tv 183: AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
184: AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
1.234 thorpej 185: LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
186: NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
187: OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
188: OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
189: RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
190: SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
191: STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
1.341 lukem 192: .endif # }
1.234 thorpej 193:
1.519 gmcgarry 194: .if defined(HAVE_GCC) && ${USETOOLS_GCC:Uyes} == "yes" # {
1.234 thorpej 195: CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
196: CPP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
197: CXX= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
198: FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
199: OBJC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
1.341 lukem 200: .endif # }
1.519 gmcgarry 201:
202: .if defined(HAVE_PCC) && ${USETOOLS_PCC:Uyes} == "yes"
203: CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
204: CPP= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-cpp
205: CXX= false
206: FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-f77
207: OBJC= false
208: .endif
209:
1.662 ! joerg 210: #
! 211: # Make sure DESTDIR is set, so that builds with these tools always
! 212: # get appropriate -nostdinc, -nostdlib, etc. handling. The default is
! 213: # <empty string>, meaning start from /, the root directory.
! 214: #
! 215: DESTDIR?=
! 216:
! 217: .if !defined(HOSTPROG) && !defined(HOSTLIB)
! 218: . if ${DESTDIR} != ""
1.659 mrg 219: CPPFLAGS+= --sysroot=${DESTDIR}
1.657 christos 220: LDFLAGS+= --sysroot=${DESTDIR}
1.662 ! joerg 221: . else
1.661 christos 222: CPPFLAGS+= --sysroot=/
223: LDFLAGS+= --sysroot=/
1.662 ! joerg 224: . endif
1.657 christos 225: .endif
1.341 lukem 226: .endif # EXTERNAL_TOOLCHAIN # }
1.234 thorpej 227:
1.338 lukem 228: HOST_MKDEP= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
229:
1.210 thorpej 230: DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
1.320 thorpej 231: ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
1.496 joerg 232: INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
1.320 thorpej 233: LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
1.215 tv 234: LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
1.338 lukem 235: LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
1.320 thorpej 236: MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
1.483 christos 237: PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
1.320 thorpej 238: TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
239: YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
1.338 lukem 240:
1.426 jmc 241: TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
242: TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
243: TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
1.338 lukem 244: TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
1.535 apb 245: TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk
1.338 lukem 246: TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
247: TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
248: TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
249: TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
250: TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
251: TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
252: TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
1.620 darran 253: TOOL_CTFCONVERT= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfconvert
254: TOOL_CTFMERGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfmerge
1.338 lukem 255: TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
1.532 apb 256: TOOL_DISKLABEL= ${TOOLDIR}/bin/nbdisklabel-${MAKEWRAPPERMACHINE}
1.338 lukem 257: TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
1.532 apb 258: TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
1.338 lukem 259: TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
1.439 thorpej 260: TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
1.338 lukem 261: TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
1.446 jmc 262: TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
1.557 sketch 263: TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
1.338 lukem 264: TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
265: TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
1.427 jmc 266: TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
1.510 skrll 267: TOOL_HP700MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp700-mkboot
1.338 lukem 268: TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
269: TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
270: TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
1.492 apb 271: TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join
1.338 lukem 272: TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
1.405 matt 273: TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
1.338 lukem 274: TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
275: TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
276: TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
1.588 joerg 277: TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
1.653 njoly 278: TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
1.588 joerg 279: TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint
1.338 lukem 280: TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
281: TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
1.425 jmc 282: TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
1.338 lukem 283: TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
284: TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
285: TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
286: TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
287: TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
1.650 matt 288: TOOL_MKUBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkubootimage
1.338 lukem 289: TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
290: TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
1.616 roy 291: TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}nbperf
1.338 lukem 292: TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
293: TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
1.632 mrg 294: TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz
1.599 uebayasi 295: TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create
1.506 garbled 296: TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
1.338 lukem 297: TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
298: TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
299: TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
300: TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
1.340 lukem 301: TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
1.338 lukem 302: TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
303: TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
1.501 nakayama 304: TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
1.454 gdamore 305: TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
1.656 elric 306: TOOL_SLC= ${TOOLDIR}/bin/${_TOOL_PREFIX}slc
1.338 lukem 307: TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
1.532 apb 308: TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
1.342 lukem 309: TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
1.530 apb 310: TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile
1.338 lukem 311: TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
312: TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
1.651 joerg 313: TOOL_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}tblgen
1.616 roy 314: TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic
1.338 lukem 315: TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
316: TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
317: TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
1.180 tv 318:
1.538 apb 319: .else # USETOOLS != yes # } {
320:
321: TOOL_AMIGAAOUT2BB= amiga-aout2bb
322: TOOL_AMIGAELF2BB= amiga-elf2bb
323: TOOL_AMIGATXLT= amiga-txlt
324: TOOL_ASN1_COMPILE= asn1_compile
325: TOOL_AWK= awk
326: TOOL_CAP_MKDB= cap_mkdb
327: TOOL_CAT= cat
328: TOOL_CKSUM= cksum
329: TOOL_COMPILE_ET= compile_et
330: TOOL_CONFIG= config
331: TOOL_CRUNCHGEN= crunchgen
332: TOOL_CTAGS= ctags
1.620 darran 333: TOOL_CTFCONVERT= ctfconvert
334: TOOL_CTFMERGE= ctfmerge
1.538 apb 335: TOOL_DB= db
336: TOOL_DISKLABEL= disklabel
337: TOOL_EQN= eqn
338: TOOL_FDISK= fdisk
339: TOOL_FGEN= fgen
340: TOOL_GENASSYM= genassym
341: TOOL_GENCAT= gencat
342: TOOL_GMAKE= gmake
1.557 sketch 343: TOOL_GREP= grep
1.538 apb 344: TOOL_GROFF= groff
345: TOOL_HEXDUMP= hexdump
346: TOOL_HP300MKBOOT= hp300-mkboot
347: TOOL_HP700MKBOOT= hp700-mkboot
348: TOOL_INDXBIB= indxbib
349: TOOL_INSTALLBOOT= installboot
350: TOOL_INSTALL_INFO= install-info
351: TOOL_JOIN= join
352: TOOL_M4= m4
353: TOOL_MACPPCFIXCOFF= macppc-fixcoff
354: TOOL_MAKEFS= makefs
355: TOOL_MAKEINFO= makeinfo
356: TOOL_MAKEWHATIS= /usr/libexec/makewhatis
1.629 joerg 357: TOOL_MANDOC_ASCII= mandoc -Tascii
358: TOOL_MANDOC_HTML= mandoc -Thtml -Oman=../html%S/%N.html -Ostyle=../style.css
359: TOOL_MANDOC_LINT= mandoc -Tlint
1.538 apb 360: TOOL_MDSETIMAGE= mdsetimage
361: TOOL_MENUC= menuc
362: TOOL_MIPSELF2ECOFF= mips-elf2ecoff
363: TOOL_MKCSMAPPER= mkcsmapper
364: TOOL_MKESDB= mkesdb
365: TOOL_MKLOCALE= mklocale
366: TOOL_MKMAGIC= file
367: TOOL_MKTEMP= mktemp
1.650 matt 368: TOOL_MKUBOOTIMAGE= mkubootimage
1.538 apb 369: TOOL_MSGC= msgc
370: TOOL_MTREE= mtree
1.616 roy 371: TOOL_NBPERF= nbperf
1.538 apb 372: TOOL_PAX= pax
373: TOOL_PIC= pic
1.632 mrg 374: TOOL_PIGZ= pigz
1.599 uebayasi 375: TOOL_PKG_CREATE= pkg_create
1.538 apb 376: TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage
377: TOOL_PWD_MKDB= pwd_mkdb
378: TOOL_REFER= refer
379: TOOL_ROFF_ASCII= nroff
380: TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
381: TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
382: TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
383: TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
384: TOOL_RPCGEN= rpcgen
385: TOOL_SED= sed
386: TOOL_SOELIM= soelim
387: TOOL_SPARKCRC= sparkcrc
388: TOOL_STAT= stat
389: TOOL_STRFILE= strfile
390: TOOL_SUNLABEL= sunlabel
391: TOOL_TBL= tbl
1.651 joerg 392: TOOL_TBLGEN= llvm-tblgen
1.616 roy 393: TOOL_TIC= tic
1.538 apb 394: TOOL_UUDECODE= uudecode
395: TOOL_VGRIND= vgrind -f
396: TOOL_ZIC= zic
397:
398: .endif # USETOOLS != yes # }
1.272 lukem 399:
1.341 lukem 400: #
1.272 lukem 401: # Targets to check if DESTDIR or RELEASEDIR is provided
402: #
403: .if !target(check_DESTDIR)
404: check_DESTDIR: .PHONY .NOTMAIN
405: .if !defined(DESTDIR)
406: @echo "setenv DESTDIR before doing that!"
407: @false
408: .else
409: @true
410: .endif
411: .endif
412:
413: .if !target(check_RELEASEDIR)
414: check_RELEASEDIR: .PHONY .NOTMAIN
415: .if !defined(RELEASEDIR)
416: @echo "setenv RELEASEDIR before doing that!"
417: @false
418: .else
419: @true
420: .endif
421: .endif
422:
1.341 lukem 423: #
1.306 lukem 424: # Build a dynamically linked /bin and /sbin, with the necessary shared
425: # libraries moved from /usr/lib to /lib and the shared linker moved
426: # from /usr/libexec to /lib
427: #
1.315 thorpej 428: # Note that if the BINDIR is not /bin or /sbin, then we always use the
429: # non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
430: # and /sbin). See <bsd.shlib.mk>.
431: #
1.311 lukem 432: MKDYNAMICROOT?= yes
1.306 lukem 433:
1.341 lukem 434: #
1.287 lukem 435: # Where the system object and source trees are kept; can be configurable
436: # by the user in case they want them in ~/foosrc and ~/fooobj (for example).
437: #
438: BSDSRCDIR?= /usr/src
439: BSDOBJDIR?= /usr/obj
1.288 lukem 440: NETBSDSRCDIR?= ${BSDSRCDIR}
1.1 cgd 441:
1.61 lukem 442: BINGRP?= wheel
443: BINOWN?= root
1.1 cgd 444: BINMODE?= 555
1.4 mycroft 445: NONBINMODE?= 444
1.17 brezak 446:
1.646 pooka 447: # These are here mainly because we don't want suid root in case
448: # a Makefile defines BINMODE.
449: RUMPBINGRP?= wheel
450: RUMPBINOWN?= root
451: RUMPBINMODE?= 555
452: RUMPNONBINMODE?=444
453:
1.31 christos 454: MANDIR?= /usr/share/man
1.61 lukem 455: MANGRP?= wheel
456: MANOWN?= root
1.4 mycroft 457: MANMODE?= ${NONBINMODE}
1.524 lukem 458: MANINSTALL?= catinstall htmlinstall maninstall
1.115 tv 459:
460: INFODIR?= /usr/share/info
461: INFOGRP?= wheel
462: INFOOWN?= root
463: INFOMODE?= ${NONBINMODE}
1.4 mycroft 464:
465: LIBDIR?= /usr/lib
1.315 thorpej 466:
1.4 mycroft 467: LINTLIBDIR?= /usr/libdata/lint
468: LIBGRP?= ${BINGRP}
469: LIBOWN?= ${BINOWN}
470: LIBMODE?= ${NONBINMODE}
471:
1.135 simonb 472: DOCDIR?= /usr/share/doc
1.136 simonb 473: HTMLDOCDIR?= /usr/share/doc/html
1.61 lukem 474: DOCGRP?= wheel
475: DOCOWN?= root
1.135 simonb 476: DOCMODE?= ${NONBINMODE}
1.15 jtc 477:
478: NLSDIR?= /usr/share/nls
1.61 lukem 479: NLSGRP?= wheel
480: NLSOWN?= root
1.15 jtc 481: NLSMODE?= ${NONBINMODE}
1.25 explorer 482:
1.508 ad 483: KMODULEGRP?= wheel
484: KMODULEOWN?= root
485: KMODULEMODE?= ${NONBINMODE}
486:
1.155 itojun 487: LOCALEDIR?= /usr/share/locale
488: LOCALEGRP?= wheel
489: LOCALEOWN?= root
490: LOCALEMODE?= ${NONBINMODE}
1.1 cgd 491:
1.453 rpaulo 492: FIRMWAREDIR?= /libdata/firmware
493: FIRMWAREGRP?= wheel
494: FIRMWAREOWN?= root
495: FIRMWAREMODE?= ${NONBINMODE}
496:
1.465 lukem 497: DEBUGDIR?= /usr/libdata/debug
498: DEBUGGRP?= wheel
499: DEBUGOWN?= root
500: DEBUGMODE?= ${NONBINMODE}
501:
1.341 lukem 502: #
503: # Data-driven table using make variables to control how
1.264 thorpej 504: # toolchain-dependent targets and shared libraries are built
505: # for different platforms and object formats.
506: #
1.296 thorpej 507: # OBJECT_FMT: currently either "ELF" or "a.out".
1.264 thorpej 508: #
1.499 simonb 509: # All platforms are ELF.
1.341 lukem 510: #
1.264 thorpej 511: OBJECT_FMT= ELF
512:
1.341 lukem 513: #
1.310 thorpej 514: # If this platform's toolchain is missing, we obviously cannot build it.
1.341 lukem 515: #
1.406 lukem 516: .if ${TOOLCHAIN_MISSING} != "no"
1.572 skrll 517: MKBINUTILS:= no
1.310 thorpej 518: MKGDB:= no
519: MKGCC:= no
520: .endif
521:
1.341 lukem 522: #
1.310 thorpej 523: # If we are using an external toolchain, we can still build the target's
1.572 skrll 524: # binutils, but we cannot build GCC's support libraries, since those are
1.310 thorpej 525: # tightly-coupled to the version of GCC being used.
1.341 lukem 526: #
1.310 thorpej 527: .if defined(EXTERNAL_TOOLCHAIN)
528: MKGCC:= no
529: .endif
530:
1.341 lukem 531: #
1.165 fredette 532: # The m68000 port is incomplete.
1.341 lukem 533: #
1.165 fredette 534: .if ${MACHINE_ARCH} == "m68000"
1.230 tv 535: NOPIC= # defined
1.458 mrg 536: MKISCSI= no
537: # XXX GCC 4 outputs mcount() calling sequences that try to load values
538: # from over 64KB away and this fails to assemble.
1.519 gmcgarry 539: .if defined(HAVE_GCC) && (${HAVE_GCC} == 4)
1.458 mrg 540: NOPROFILE= # defined
541: .endif
1.32 thorpej 542: .endif
1.122 simonb 543:
1.341 lukem 544: #
1.441 skrll 545: # The ia64 port is incomplete.
546: #
547: .if ${MACHINE_ARCH} == "ia64"
548: MKLINT= no
1.472 skrll 549: MKGDB= no
1.441 skrll 550: .endif
551:
552: #
1.327 thorpej 553: # On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
554: # not just shared libraries, so don't build the _pic version.
1.341 lukem 555: #
1.598 uebayasi 556: .if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
557: ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
1.327 thorpej 558: MKPICLIB:= no
559: .endif
560:
1.341 lukem 561: #
1.327 thorpej 562: # On VAX using ELF, all objects are PIC, not just shared libraries,
1.613 matt 563: # so don't build the _pic version.
1.341 lukem 564: #
1.494 matt 565: .if ${MACHINE_ARCH} == "vax"
566: MKPICLIB= no
1.327 thorpej 567: .endif
568:
1.341 lukem 569: #
1.122 simonb 570: # Location of the file that contains the major and minor numbers of the
571: # version of a shared library. If this file exists a shared library
572: # will be built by <bsd.lib.mk>.
1.341 lukem 573: #
1.122 simonb 574: SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
1.69 tv 575:
1.341 lukem 576: #
1.69 tv 577: # GNU sources and packages sometimes see architecture names differently.
1.341 lukem 578: #
1.494 matt 579: GNU_ARCH.coldfire=m68k
1.560 drochner 580: GNU_ARCH.i386=i486
581: GCC_CONFIG_ARCH.i386=i486
1.563 ad 582: GCC_CONFIG_TUNE.i386=nocona
583: GCC_CONFIG_TUNE.x86_64=nocona
1.261 thorpej 584: GNU_ARCH.m68000=m68010
1.150 itojun 585: GNU_ARCH.sh3eb=sh
1.236 thorpej 586: GNU_ARCH.sh3el=shle
1.468 matt 587: GNU_ARCH.mips64eb=mips64
1.172 tv 588: MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
1.161 tv 589:
1.341 lukem 590: #
1.161 tv 591: # In order to identify NetBSD to GNU packages, we sometimes need
592: # an "elf" tag for historically a.out platforms.
1.341 lukem 593: #
1.633 mrg 594: .if (${MACHINE_GNU_ARCH} == "arm" || \
1.294 thorpej 595: ${MACHINE_GNU_ARCH} == "armeb" || \
1.168 matt 596: ${MACHINE_ARCH} == "i386" || \
1.494 matt 597: ${MACHINE_CPU} == "m68k" || \
1.235 thorpej 598: ${MACHINE_GNU_ARCH} == "sh" || \
1.236 thorpej 599: ${MACHINE_GNU_ARCH} == "shle" || \
1.168 matt 600: ${MACHINE_ARCH} == "sparc" || \
601: ${MACHINE_ARCH} == "vax")
1.318 thorpej 602: MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
1.161 tv 603: .else
1.318 thorpej 604: MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
1.161 tv 605: .endif
1.153 itojun 606:
1.553 pooka 607: #
608: # Determine if arch uses native kernel modules with rump
609: #
610: .if ${MACHINE_ARCH} == "i386" || \
611: ${MACHINE_ARCH} == "x86_64"
612: RUMPKMOD= # defined
613: .endif
614:
1.160 tv 615: TARGETS+= all clean cleandir depend dependall includes \
1.521 lukem 616: install lint obj regress tags html
1.485 dsl 617: PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
1.128 perry 618: install lint obj regress tags beforedepend afterdepend \
1.142 phil 619: beforeinstall afterinstall realinstall realdepend realall \
1.521 lukem 620: html subdir-all subdir-install subdir-depend
1.485 dsl 621: .PHONY: ${PHONY_NOTMAIN}
622: .NOTMAIN: ${PHONY_NOTMAIN}
1.58 agc 623:
1.406 lukem 624: .if ${NEED_OWN_INSTALL_TARGET} != "no"
1.56 drochner 625: .if !target(install)
1.485 dsl 626: install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
627: beforeinstall:
628: subdir-install:
629: realinstall:
630: afterinstall:
631: .endif
632: all: realall subdir-all
633: subdir-all:
634: realall:
635: depend: realdepend subdir-depend
636: subdir-depend:
637: realdepend:
638: distclean: cleandir
639: cleandir: clean
1.205 tv 640:
641: dependall: .NOTMAIN realdepend .MAKE
1.615 christos 642: @cd "${.CURDIR}"; ${MAKE} realall
1.132 mycroft 643: .endif
1.116 lukem 644:
1.341 lukem 645: #
1.116 lukem 646: # Define MKxxx variables (which are either yes or no) for users
1.350 lukem 647: # to set in /etc/mk.conf and override in the make environment.
1.116 lukem 648: # These should be tested with `== "no"' or `!= "no"'.
1.340 lukem 649: # The NOxxx variables should only be set by Makefiles.
1.116 lukem 650: #
1.466 lukem 651: # Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
652: # with changes to the MK* variables here.
653: #
1.116 lukem 654:
1.341 lukem 655: #
1.230 tv 656: # Supported NO* options (if defined, MK* will be forced to "no",
657: # regardless of user's mk.conf setting).
1.341 lukem 658: #
1.503 dholland 659: # Source makefiles should set NO*, and not MK*, and must do so before
660: # including bsd.own.mk.
661: #
1.422 lukem 662: .for var in \
1.534 apb 663: NOCRYPTO NODOC NOHTML NOINFO NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \
1.503 dholland 664: NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB
665: .if defined(${var})
666: MK${var:S/^NO//}:= no
1.230 tv 667: .endif
668: .endfor
1.268 ross 669:
1.341 lukem 670: #
671: # Older-style variables that enabled behaviour when set.
672: #
673: .for var in MANZ UNPRIVED UPDATE
674: .if defined(${var})
675: MK${var}:= yes
1.268 ross 676: .endif
1.341 lukem 677: .endfor
1.230 tv 678:
1.536 mrg 679: #
680: # MK* options which have variable defaults.
681: #
1.613 matt 682: .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" || \
683: ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
1.536 mrg 684: MKCOMPAT?= yes
685: .else
686: # Don't let this build where it really isn't supported.
687: MKCOMPAT:= no
688: .endif
689:
1.341 lukem 690: #
1.647 matt 691: # Default mips64 to softfloat now.
1.649 pooka 692: # emips is always softfloat.
1.647 matt 693: #
1.649 pooka 694: .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" || \
695: ${MACHINE} == "emips"
1.647 matt 696: MKSOFTFLOAT?= yes
697: .endif
698:
1.649 pooka 699: .if ${MACHINE} == "emips"
700: SOFTFLOAT_BITS= 32
701: .endif
702:
1.647 matt 703: #
1.572 skrll 704: # MK* backward compatibility.
705: #
706: .if defined(MKBFD)
707: MKBINUTILS?= ${MKBFD}
708: .endif
709:
710: #
1.603 uebayasi 711: # We want to build zfs only for i386 and amd64 by default for now.
712: #
713: .if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
1.621 he 714: MKZFS?= yes
1.603 uebayasi 715: .endif
716:
717: #
1.230 tv 718: # MK* options which default to "yes".
1.341 lukem 719: #
1.600 uebayasi 720: _MKVARS.yes= \
1.514 gmcgarry 721: MKATF \
1.572 skrll 722: MKBINUTILS \
1.613 matt 723: MKCATPAGES MKCRYPTO MKCOMPLEX MKCVS MKCXX \
1.504 lukem 724: MKDOC \
1.613 matt 725: MKGCC MKGCCCMDS MKGDB MKGROFF \
1.524 lukem 726: MKHESIOD MKHTML \
1.504 lukem 727: MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
728: MKKERBEROS \
1.570 dyoung 729: MKKMOD \
1.602 haad 730: MKLDAP MKLINKLIB MKLINT MKLVM \
1.504 lukem 731: MKMAN \
1.583 tsarna 732: MKMDNS \
1.525 christos 733: MKNLS \
1.640 rmind 734: MKNPF \
1.504 lukem 735: MKOBJ \
1.519 gmcgarry 736: MKPAM \
737: MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
1.504 lukem 738: MKSHARE MKSKEY MKSTATICLIB \
1.567 mrg 739: MKX11FONTS \
1.504 lukem 740: MKYP
1.600 uebayasi 741: .for var in ${_MKVARS.yes}
1.504 lukem 742: ${var}?= yes
1.230 tv 743: .endfor
744:
1.341 lukem 745: #
1.606 he 746: # Exceptions to the above:
747: #
748: .if ${MACHINE} == "evbppc"
749: MKKMOD= no
750: .endif
751:
752: #
1.623 mrg 753: # MK* options which default to "no". Note that MKZFS has a different
754: # default for some platforms, see above.
1.341 lukem 755: #
1.600 uebayasi 756: _MKVARS.no= \
1.625 joerg 757: MKBSDTAR MKCRYPTO_IDEA MKCRYPTO_MDC2 MKCRYPTO_RC5 MKDEBUG MKDEBUGLIB \
1.618 darran 758: MKDTRACE MKEXTSRC \
1.590 joerg 759: MKMANDOC MKMANZ MKOBJDIRS \
1.651 joerg 760: MKLLVM MKPCC MKPCCCMDS \
1.631 mrg 761: MKPIGZGZIP \
1.648 he 762: MKREPRO \
1.541 agc 763: MKSOFTFLOAT MKSTRIPIDENT \
1.623 mrg 764: MKUNPRIVED MKUPDATE MKX11 MKZFS
1.600 uebayasi 765: .for var in ${_MKVARS.no}
1.504 lukem 766: ${var}?=no
1.230 tv 767: .endfor
768:
1.341 lukem 769: #
1.544 mrg 770: # Do we default to XFree86 or Xorg for this platform?
771: #
1.637 tsutsui 772: .if \
773: ${MACHINE} == "acorn32" || \
774: ${MACHINE} == "alpha" || \
775: ${MACHINE} == "amiga" || \
776: ${MACHINE} == "ews4800mips" || \
777: ${MACHINE} == "mac68k" || \
778: ${MACHINE} == "newsmips" || \
779: ${MACHINE} == "pmax" || \
780: ${MACHINE} == "sun3" || \
781: ${MACHINE} == "x68k"
1.555 abs 782: X11FLAVOUR?= XFree86
783: .else
1.544 mrg 784: X11FLAVOUR?= Xorg
785: .endif
786:
787: #
1.230 tv 788: # Force some options off if their dependencies are off.
1.341 lukem 789: #
790:
1.613 matt 791: .if ${MKCXX} == "no"
792: MKATF:= no
793: MKGROFF:= no
794: .endif
795:
1.230 tv 796: .if ${MKCRYPTO} == "no"
797: MKKERBEROS:= no
1.634 mrg 798: MKLDAP:= no
1.340 lukem 799: .endif
800:
801: .if ${MKMAN} == "no"
1.341 lukem 802: MKCATPAGES:= no
1.340 lukem 803: MKHTML:= no
1.116 lukem 804: .endif
805:
1.117 lukem 806: .if ${MKLINKLIB} == "no"
1.507 lukem 807: MKLINT:= no
1.230 tv 808: MKPICINSTALL:= no
809: MKPROFILE:= no
1.327 thorpej 810: .endif
811:
812: .if ${MKPIC} == "no"
813: MKPICLIB:= no
1.116 lukem 814: .endif
815:
1.230 tv 816: .if ${MKOBJ} == "no"
817: MKOBJDIRS:= no
1.116 lukem 818: .endif
819:
1.117 lukem 820: .if ${MKSHARE} == "no"
1.230 tv 821: MKCATPAGES:= no
822: MKDOC:= no
823: MKINFO:= no
1.341 lukem 824: MKHTML:= no
1.230 tv 825: MKMAN:= no
826: MKNLS:= no
1.116 lukem 827: .endif
1.276 thorpej 828:
1.341 lukem 829: #
830: # install(1) parameters.
831: #
832: COPY?= -c
833: .if ${MKUPDATE} == "no"
834: PRESERVE?=
835: .else
836: PRESERVE?= -p
837: .endif
838: RENAME?= -r
839: HRDLINK?= -l h
1.444 christos 840: SYMLINK?= -l s
1.341 lukem 841:
842: METALOG?= ${DESTDIR}/METALOG
843: METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
844: .if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
845: .if ${MKUNPRIVED} != "no"
1.562 apb 846: INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha256
1.341 lukem 847: .else
848: INSTPRIV.unpriv=
849: .endif
850: INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
851: .endif
1.410 lukem 852: STRIPFLAG?=
1.341 lukem 853:
1.406 lukem 854: .if ${NEED_OWN_INSTALL_TARGET} != "no"
1.341 lukem 855: INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
856: INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
857: INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
858: INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
859: HOST_INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
1.440 dyoung 860: HOST_INSTALL_DIR?= ${INSTALL} -d
861: HOST_INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} ${RENAME}
1.341 lukem 862: .endif
863:
864: #
1.351 lukem 865: # Set defaults for the USE_xxx variables.
866: #
867:
868: #
1.433 lukem 869: # USE_* options which default to "no" and will be forced to "no" if their
870: # corresponding MK* variable is set to "no".
871: #
1.505 lukem 872: .for var in USE_SKEY
873: .if (${${var:S/USE_/MK/}} == "no")
874: ${var}:= no
875: .else
876: ${var}?= no
877: .endif
878: .endfor
1.433 lukem 879:
880: #
1.351 lukem 881: # USE_* options which default to "yes" unless their corresponding MK*
882: # variable is set to "no".
1.341 lukem 883: #
1.512 lukem 884: .for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP
1.504 lukem 885: .if (${${var:S/USE_/MK/}} == "no")
886: ${var}:= no
1.276 thorpej 887: .else
1.504 lukem 888: ${var}?= yes
1.276 thorpej 889: .endif
1.351 lukem 890: .endfor
891:
892: #
893: # USE_* options which default to "yes".
894: #
1.504 lukem 895: .for var in USE_JEMALLOC
896: ${var}?= yes
1.497 ad 897: .endfor
1.300 tron 898:
1.341 lukem 899: #
1.445 jmc 900: # USE_* options which default to "no".
901: #
1.639 mrg 902: # For now, disable pigz as compressor by default
1.641 ahoka 903: .for var in USE_PIGZGZIP USE_LIBTRE
1.639 mrg 904: ${var}?= no
905: .endfor
1.357 lukem 906:
907: #
1.522 mrg 908: # Where X11 sources are and where it is installed to.
1.357 lukem 909: #
1.587 apb 910: .if !defined(X11SRCDIR)
911: .if exists(${NETBSDSRCDIR}/../xsrc)
1.615 christos 912: X11SRCDIR!= cd "${NETBSDSRCDIR}/../xsrc" && pwd
1.587 apb 913: .else
914: X11SRCDIR= /usr/xsrc
915: .endif
916: .endif # !defined(X11SRCDIR)
917:
1.357 lukem 918: X11SRCDIR.xc?= ${X11SRCDIR}/xfree/xc
919: X11SRCDIR.local?= ${X11SRCDIR}/local
1.544 mrg 920: .if ${X11FLAVOUR} == "Xorg"
1.522 mrg 921: X11ROOTDIR?= /usr/X11R7
922: .else
1.357 lukem 923: X11ROOTDIR?= /usr/X11R6
1.522 mrg 924: .endif
1.357 lukem 925: X11BINDIR?= ${X11ROOTDIR}/bin
1.417 lukem 926: X11ETCDIR?= /etc/X11
1.357 lukem 927: X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
928: X11INCDIR?= ${X11ROOTDIR}/include
929: X11LIBDIR?= ${X11ROOTDIR}/lib/X11
930: X11MANDIR?= ${X11ROOTDIR}/man
1.635 mrg 931: X11SHAREDIR?= ${X11ROOTDIR}/share
1.357 lukem 932: X11USRLIBDIR?= ${X11ROOTDIR}/lib
1.417 lukem 933:
1.516 mrg 934: #
935: # New modular-xorg based builds
936: #
937: X11SRCDIRMIT?= ${X11SRCDIR}/external/mit
938: .for _lib in \
939: FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \
1.564 mrg 940: Xdmcp Xevie Xext Xfixes Xfont Xft Xi Xinerama Xmu Xpm \
1.516 mrg 941: Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \
1.635 mrg 942: fontenc xkbfile xkbui Xaw lbxutil Xfontcache pciaccess xcb
1.516 mrg 943: X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist
944: .endfor
945:
946: .for _proto in \
947: xcmisc xext xf86bigfont bigreqs input kb x fonts fixes scrnsaver \
1.565 mrg 948: xinerama dri2 render resource record video xf86dga xf86misc \
1.635 mrg 949: xf86vidmode composite damage trap gl randr fontcache xf86dri \
950: xcb-
1.516 mrg 951: X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist
952: .endfor
953:
954: .for _dir in \
955: xtrans fontconfig expat freetype evieext mkfontscale bdftopcf \
1.566 mrg 956: xkbcomp xorg-cf-files imake xorg-server xbiff xkbdata xkeyboard-config \
1.517 mrg 957: xbitmaps appres xeyes xev xedit sessreg pixman \
1.516 mrg 958: beforelight bitmap editres makedepend fonttosfnt fslsfonts \
1.546 cube 959: fstobdf MesaDemos MesaGLUT MesaLib ico iceauth lbxproxy listres lndir \
1.516 mrg 960: luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \
961: setxkbmap smproxy twm viewres x11perf xauth xcalc xclipboard \
962: xclock xcmsdb xconsole xcutsel xditview xdpyinfo xdriinfo xdm \
963: xfd xf86dga xfindproxy xfontsel xfwp xgamma xgc xhost xinit \
964: xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \
965: xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \
966: xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \
967: xwininfo xwud xprehashprinterlist xplsprinters xkbprint xkbevd \
968: xterm xwd xfs xfsinfo xphelloworld xtrap xkbutils xkbcomp \
1.635 mrg 969: xkeyboard-config xinput xcb-util \
1.516 mrg 970: font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \
971: font-adobe-utopia-75dpi font-adobe-utopia-type1 \
972: font-alias \
973: font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi \
974: font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 \
975: font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 \
976: font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 \
977: font-isas-misc font-jis-misc font-misc-misc font-mutt-misc \
1.554 tron 978: font-sony-misc font-util ttf-bitstream-vera encodings
1.516 mrg 979: X11SRCDIR.${_dir}?= ${X11SRCDIRMIT}/${_dir}/dist
980: .endfor
981:
1.518 mrg 982: .for _i in \
1.652 mrg 983: elographics keyboard mouse synaptics vmmouse void ws
1.518 mrg 984: X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist
985: .endfor
986:
987: .for _v in \
1.626 mrg 988: ag10e apm ark ast ati chips cirrus crime \
989: geode glint i128 i740 igs imstt intel mach64 mga \
990: neomagic newport nsc nv nvxbox openchrome pnozz \
991: r128 radeonhd rendition \
992: s3 s3virge savage siliconmotion sis suncg14 \
993: suncg6 sunffb sunleo suntcx \
994: tdfx tga trident tseng vesa vga via vmware wsfb
1.543 macallan 995:
1.518 mrg 996: X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist
997: .endfor
998:
1.544 mrg 999: .if ${X11FLAVOUR} == "Xorg"
1.516 mrg 1000: X11DRI?= yes
1001: .endif
1002:
1003: X11DRI?= no
1004: X11LOADABLE?= yes
1.374 lukem 1005:
1006:
1007: #
1.598 uebayasi 1008: # Where extsrc sources are and where it is installed to.
1009: #
1010: .if !defined(EXTSRCSRCDIR)
1011: .if exists(${NETBSDSRCDIR}/../extsrc)
1.615 christos 1012: EXTSRCSRCDIR!= cd "${NETBSDSRCDIR}/../extsrc" && pwd
1.598 uebayasi 1013: .else
1014: EXTSRCSRCDIR= /usr/extsrc
1015: .endif
1016: .endif # !defined(EXTSRCSRCDIR)
1017:
1018: EXTSRCROOTDIR?= /usr/ext
1019: EXTSRCBINDIR?= ${EXTSRCROOTDIR}/bin
1020: EXTSRCETCDIR?= /etc/ext
1021: EXTSRCINCDIR?= ${EXTSRCROOTDIR}/include
1022: EXTSRCLIBDIR?= ${EXTSRCROOTDIR}/lib/ext
1023: EXTSRCMANDIR?= ${EXTSRCROOTDIR}/man
1024: EXTSRCUSRLIBDIR?= ${EXTSRCROOTDIR}/lib
1025:
1026: #
1.414 lukem 1027: # MAKEDIRTARGET dir target [extra make(1) params]
1.612 mrg 1028: # run "cd $${dir} && ${MAKEDIRTARGETENV} ${MAKE} [params] $${target}", with a pretty message
1.414 lukem 1029: #
1.612 mrg 1030: MAKEDIRTARGETENV?=
1.414 lukem 1031: MAKEDIRTARGET=\
1032: @_makedirtarget() { \
1033: dir="$$1"; shift; \
1034: target="$$1"; shift; \
1035: case "$${dir}" in \
1036: /*) this="$${dir}/"; \
1037: real="$${dir}" ;; \
1038: .) this="${_THISDIR_}"; \
1039: real="${.CURDIR}" ;; \
1040: *) this="${_THISDIR_}$${dir}/"; \
1041: real="${.CURDIR}/$${dir}" ;; \
1042: esac; \
1043: show=$${this:-.}; \
1044: echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
1045: cd "$${real}" \
1.612 mrg 1046: && ${MAKEDIRTARGETENV} ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
1.414 lukem 1047: }; \
1048: _makedirtarget
1049:
1050: #
1.374 lukem 1051: # MAKEVERBOSE support. Levels are:
1.549 apb 1052: # 0 Minimal output ("quiet")
1053: # 1 Describe what is occurring
1054: # 2 Describe what is occurring and echo the actual command
1055: # 3 Ignore the effect of the "@" prefix in make commands
1056: # 4 Trace shell commands using the shell's -x flag
1.374 lukem 1057: #
1058: MAKEVERBOSE?= 2
1059:
1060: .if ${MAKEVERBOSE} == 0
1061: _MKMSG?= @\#
1062: _MKSHMSG?= : echo
1063: _MKSHECHO?= : echo
1.380 lukem 1064: .SILENT:
1.374 lukem 1065: .elif ${MAKEVERBOSE} == 1
1066: _MKMSG?= @echo ' '
1067: _MKSHMSG?= echo ' '
1068: _MKSHECHO?= : echo
1.380 lukem 1069: .SILENT:
1.549 apb 1070: .else # MAKEVERBOSE >= 2
1.374 lukem 1071: _MKMSG?= @echo '\# '
1072: _MKSHMSG?= echo '\# '
1073: _MKSHECHO?= echo
1.380 lukem 1074: .SILENT: __makeverbose_dummy_target__
1.549 apb 1075: .endif # MAKEVERBOSE >= 2
1076: .if ${MAKEVERBOSE} >= 3
1077: .MAKEFLAGS: -dl
1078: .endif # ${MAKEVERBOSE} >= 3
1079: .if ${MAKEVERBOSE} >= 4
1080: .MAKEFLAGS: -dx
1081: .endif # ${MAKEVERBOSE} >= 4
1.374 lukem 1082:
1083: _MKMSG_BUILD?= ${_MKMSG} " build "
1084: _MKMSG_CREATE?= ${_MKMSG} " create "
1085: _MKMSG_COMPILE?= ${_MKMSG} "compile "
1086: _MKMSG_FORMAT?= ${_MKMSG} " format "
1087: _MKMSG_INSTALL?= ${_MKMSG} "install "
1088: _MKMSG_LINK?= ${_MKMSG} " link "
1089: _MKMSG_LEX?= ${_MKMSG} " lex "
1090: _MKMSG_REMOVE?= ${_MKMSG} " remove "
1091: _MKMSG_YACC?= ${_MKMSG} " yacc "
1.391 lukem 1092:
1093: _MKSHMSG_CREATE?= ${_MKSHMSG} " create "
1094: _MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
1.374 lukem 1095:
1.394 lukem 1096: _MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
1097: _MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
1098: _MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
1099: _MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
1100: _MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
1101: _MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
1102: _MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
1103: _MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
1104: _MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
1.64 lukem 1105:
1.592 joerg 1106: .if ${MKMANDOC} == "yes"
1107: TARGETS+= lintmanpages
1108: .endif
1109:
1.638 jmmv 1110: TESTSBASE= /usr/tests
1111:
1.347 lukem 1112: .endif # !defined(_BSD_OWN_MK_)
CVSweb <webmaster@jp.NetBSD.org>