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

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

CVSweb <webmaster@jp.NetBSD.org>