[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.572

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

CVSweb <webmaster@jp.NetBSD.org>