[BACK]Return to bsd.own.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / mk

Annotation of src/share/mk/bsd.own.mk, Revision 1.670

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

CVSweb <webmaster@jp.NetBSD.org>