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

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

CVSweb <webmaster@jp.NetBSD.org>