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