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

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

CVSweb <webmaster@jp.NetBSD.org>