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