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

1.354   ! tron        1: #      $NetBSD: bsd.own.mk,v 1.353 2003/08/27 16:03:17 mrg Exp $
1.64      lukem       2:
                      3: .if !defined(_BSD_OWN_MK_)
                      4: _BSD_OWN_MK_=1
1.24      thorpej     5:
1.169     tv          6: MAKECONF?=     /etc/mk.conf
1.205     tv          7: .-include "${MAKECONF}"
1.13      mycroft     8:
1.341     lukem       9: #
1.310     thorpej    10: # CPU model, derived from MACHINE_ARCH
1.341     lukem      11: #
1.310     thorpej    12: MACHINE_CPU=   ${MACHINE_ARCH:C/mipse[bl]/mips/:C/sh3e[bl]/sh3/:C/sh5e[bl]/sh5/:S/m68000/m68k/:S/armeb/arm/}
                     13:
1.341     lukem      14: #
1.209     tv         15: # NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
                     16: # ensure that things defined by <bsd.own.mk> (default targets,
                     17: # INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
1.341     lukem      18: #
1.209     tv         19: NEED_OWN_INSTALL_TARGET?=      yes
                     20:
1.341     lukem      21: #
1.310     thorpej    22: # This lists the platforms which do not have working in-tree toolchains.
1.341     lukem      23: #
1.310     thorpej    24: .if ${MACHINE_CPU} == "hppa" || \
                     25:     ${MACHINE_CPU} == "ns32k" || \
                     26:     ${MACHINE_CPU} == "sh5" || \
                     27:     ${MACHINE_CPU} == "x86_64"
                     28: TOOLCHAIN_MISSING?=    yes
                     29: .else
                     30: TOOLCHAIN_MISSING=     no
1.221     thorpej    31: .endif
                     32:
1.341     lukem      33: #
1.346     mrg        34: # Transitional for toolchain upgrade to GCC3.3
                     35: #
1.353     mrg        36: # not working:
                     37: #
1.352     mrg        38: #    ${MACHINE_ARCH} == "m68000" ||
                     39: #    ${MACHINE_ARCH} == "sh3el" ||
                     40: #    ${MACHINE_ARCH} == "sh3eb" ||
                     41: #    ${MACHINE_ARCH} == "powerpc" ||
1.353     mrg        42: # mostly working,:
                     43: #    ${MACHINE_ARCH} == "arm" ||
                     44: #    ${MACHINE_ARCH} == "m68k" ||
                     45: #    ${MACHINE_ARCH} == "mipseb" ||
                     46: #    ${MACHINE_ARCH} == "mipsel" ||
1.352     mrg        47:
1.353     mrg        48: HAVE_GCC3?=    no
                     49: # these are ready to switch
1.352     mrg        50: .if ${MACHINE_ARCH} == "alpha" || \
                     51:     ${MACHINE_ARCH} == "i386" || \
1.346     mrg        52:     ${MACHINE_ARCH} == "sparc" || \
                     53:     ${MACHINE_ARCH} == "sparc64"
1.353     mrg        54: HAVE_GCC3?=    yes
1.346     mrg        55: .else
1.353     mrg        56: HAVE_GCC3?=    no
                     57: .endif
                     58:
                     59: # Do we want to use tools/toolchain or not?
                     60: .if ${HAVE_GCC3} == "yes"
                     61: USE_TOOLS_TOOLCHAIN=no
1.346     mrg        62: .endif
1.354   ! tron       63: USE_TOOLS_TOOLCHAIN?=yes
1.346     mrg        64:
                     65: #
1.310     thorpej    66: # XXX TEMPORARY: If ns32k and not using an external toolchain, then we have
                     67: # to use -idirafter rather than -isystem, because the compiler is too old
                     68: # to use -isystem.
1.341     lukem      69: #
1.310     thorpej    70: .if ${MACHINE_CPU} == "ns32k" && !defined(EXTERNAL_TOOLCHAIN)
                     71: CPPFLAG_ISYSTEM=       -idirafter
1.346     mrg        72: CPPFLAG_ISYSTEMXX=     -isystem
1.310     thorpej    73: .else
1.221     thorpej    74: CPPFLAG_ISYSTEM=       -isystem
1.346     mrg        75: .if ${USE_TOOLS_TOOLCHAIN} == "yes"
                     76: CPPFLAG_ISYSTEMXX=     -isystem
                     77: .else
1.352     mrg        78: CPPFLAG_ISYSTEMXX=     -isystem-cxx
1.346     mrg        79: .endif
1.184     tv         80: .endif
                     81:
1.222     perry      82: .if empty(.MAKEFLAGS:M-V*)
                     83: PRINTOBJDIR=   ${MAKE} -V .OBJDIR
                     84: .else
                     85: PRINTOBJDIR=   echo # prevent infinite recursion
                     86: .endif
                     87:
1.341     lukem      88: #
1.286     lukem      89: # Determine if running in the NetBSD source tree by checking for the
                     90: # existence of build.sh and tools/ in the current or a parent directory,
                     91: # and setting _SRC_TOP_ to the result.
                     92: #
1.287     lukem      93: .if !defined(_SRC_TOP_)                        # {
1.199     jmc        94: _SRC_TOP_!= cd ${.CURDIR}; while :; do \
1.200     jmc        95:                here=`pwd`; \
1.199     jmc        96:                [ -f build.sh  ] && [ -d tools ] && { echo $$here; break; }; \
                     97:                case $$here in /) echo ""; break;; esac; \
1.341     lukem      98:                cd ..; done
1.199     jmc        99:
                    100: .MAKEOVERRIDES+=       _SRC_TOP_
                    101:
1.287     lukem     102: .endif                                 # }
1.222     perry     103:
1.341     lukem     104: #
1.322     lukem     105: # If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
1.288     lukem     106: # defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
1.287     lukem     107: #
                    108: .if (${_SRC_TOP_} != "")               # {
                    109:
1.288     lukem     110: NETBSDSRCDIR?= ${_SRC_TOP_}
1.180     tv        111:
1.287     lukem     112: .if !defined(_SRC_TOP_OBJ_)
                    113: _SRC_TOP_OBJ_!=                cd ${_SRC_TOP_} && ${PRINTOBJDIR}
                    114: .MAKEOVERRIDES+=       _SRC_TOP_OBJ_
1.286     lukem     115: .endif
                    116:
1.322     lukem     117: .endif # _SRC_TOP_ != ""               # }
1.286     lukem     118:
                    119:
1.310     thorpej   120: .if (${_SRC_TOP_} != "") && \
                    121:     (${TOOLCHAIN_MISSING} != "yes" || defined(EXTERNAL_TOOLCHAIN))
1.287     lukem     122: USETOOLS?=     yes
1.286     lukem     123: .endif
1.287     lukem     124: USETOOLS?=     no
                    125:
1.286     lukem     126:
1.310     thorpej   127: .if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "sh3" || \
                    128:     ${MACHINE_ARCH} == "sh5"
1.180     tv        129: .BEGIN:
                    130:        @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
                    131:        @false
1.310     thorpej   132: .elif defined(REQUIRETOOLS) && \
                    133:       (${TOOLCHAIN_MISSING} != "yes" || defined(EXTERNAL_TOOLCHAIN)) && \
                    134:       ${USETOOLS} == "no"
1.180     tv        135: .BEGIN:
1.203     tv        136:        @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
1.180     tv        137:        @false
                    138: .endif
                    139:
1.341     lukem     140: #
1.204     tv        141: # Host platform information; may be overridden
1.341     lukem     142: #
1.204     tv        143: .if !defined(HOST_OSTYPE)
                    144: _HOST_OSNAME!= uname -s
                    145: _HOST_OSREL!=  uname -r
                    146: _HOST_ARCH!=   uname -p 2>/dev/null || uname -m
1.254     tv        147: HOST_OSTYPE:=  ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH}
1.204     tv        148: .MAKEOVERRIDES+= HOST_OSTYPE
                    149: .endif
1.333     christos  150: HOST_CYGWIN=   ${HOST_OSTYPE:MCYGWIN*}
1.204     tv        151:
1.275     lukem     152: .if ${USETOOLS} == "yes"                                               # {
                    153:
1.341     lukem     154: #
1.204     tv        155: # Provide a default for TOOLDIR.
1.341     lukem     156: #
1.199     jmc       157: .if !defined(TOOLDIR)
1.339     lukem     158: TOOLDIR:=      ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
1.204     tv        159: .MAKEOVERRIDES+= TOOLDIR
1.199     jmc       160: .endif
1.180     tv        161:
1.341     lukem     162: #
1.320     thorpej   163: # This is the prefix used for the NetBSD-sourced tools.
1.341     lukem     164: #
1.320     thorpej   165: _TOOL_PREFIX?= nb
                    166:
1.341     lukem     167: #
1.318     thorpej   168: # If an external toolchain base is specified, use it.
1.341     lukem     169: #
                    170: .if defined(EXTERNAL_TOOLCHAIN)                                                # {
1.318     thorpej   171: AR=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
                    172: AS=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
                    173: LD=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
                    174: NM=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
                    175: OBJCOPY=       ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
                    176: OBJDUMP=       ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
                    177: RANLIB=                ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
                    178: SIZE=          ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
                    179: STRIP=         ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
                    180:
                    181: CC=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
                    182: CPP=           ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
                    183: CXX=           ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
                    184: FC=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
                    185: OBJC=          ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
1.341     lukem     186: .else                                                                  # } {
1.204     tv        187: # Define default locations for common tools.
1.341     lukem     188: .if ${USETOOLS_BINUTILS:Uyes} == "yes"                                 #  {
1.232     tv        189: AR=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
                    190: AS=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
1.234     thorpej   191: LD=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
                    192: NM=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
                    193: OBJCOPY=       ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
                    194: OBJDUMP=       ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
                    195: RANLIB=                ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
                    196: SIZE=          ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
                    197: STRIP=         ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
1.341     lukem     198: .endif                                                                 #  }
1.234     thorpej   199:
1.341     lukem     200: .if ${USETOOLS_GCC:Uyes} == "yes"                                      #  {
1.234     thorpej   201: CC=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
                    202: CPP=           ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
                    203: CXX=           ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
                    204: FC=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
                    205: OBJC=          ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
1.341     lukem     206: .endif                                                                 #  }
                    207: .endif # EXTERNAL_TOOLCHAIN                                            # }
1.234     thorpej   208:
1.338     lukem     209: HOST_MKDEP=    ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
                    210:
1.210     thorpej   211: DBSYM=         ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
1.320     thorpej   212: ELF2ECOFF=     ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
                    213: INSTALL=       STRIP=${STRIP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}install
                    214: LEX=           ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
1.215     tv        215: LINT=          CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
1.338     lukem     216: LORDER=                NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
1.320     thorpej   217: MKDEP=         CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
                    218: TSORT=         ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
                    219: YACC=          ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
1.338     lukem     220:
                    221: TOOL_ASN1_COMPILE=     ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
                    222: TOOL_CAP_MKDB=         ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
                    223: TOOL_CAT=              ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
                    224: TOOL_CKSUM=            ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
                    225: TOOL_COMPILE_ET=       ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
                    226: TOOL_CONFIG=           ${TOOLDIR}/bin/${_TOOL_PREFIX}config
                    227: TOOL_CRUNCHGEN=                MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
                    228: TOOL_CTAGS=            ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
                    229: TOOL_DB=               ${TOOLDIR}/bin/${_TOOL_PREFIX}db
                    230: TOOL_EQN=              ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
                    231: TOOL_FGEN=             ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
                    232: TOOL_GENCAT=           ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
                    233: TOOL_GROFF=            PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
                    234: TOOL_HEXDUMP=          ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
                    235: TOOL_INDXBIB=          ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
                    236: TOOL_INSTALLBOOT=      ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
                    237: TOOL_INSTALL_INFO=     ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
                    238: TOOL_M4=               ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
                    239: TOOL_MAKEFS=           ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
                    240: TOOL_MAKEINFO=         ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
                    241: TOOL_MAKEWHATIS=       ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
                    242: TOOL_MDSETIMAGE=       ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
                    243: TOOL_MENUC=            MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
                    244: TOOL_MKCSMAPPER=       ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
                    245: TOOL_MKESDB=           ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
                    246: TOOL_MKLOCALE=         ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
                    247: TOOL_MKMAGIC=          ${TOOLDIR}/bin/${_TOOL_PREFIX}file
                    248: TOOL_MKTEMP=           ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
                    249: TOOL_MSGC=             MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
                    250: TOOL_MTREE=            ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
                    251: TOOL_PAX=              ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
                    252: TOOL_PIC=              ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
                    253: TOOL_PREPMKBOOTIMAGE=  ${TOOLDIR}/bin/${_TOOL_PREFIX}prep-mkbootimage
                    254: TOOL_PWD_MKDB=         ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
                    255: TOOL_REFER=            ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
                    256: TOOL_ROFF_ASCII=       PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
                    257: TOOL_ROFF_DVI=         ${TOOL_GROFF} -Tdvi
1.340     lukem     258: TOOL_ROFF_HTML=                ${TOOL_GROFF} -Tlatin1 -mdoc2html
1.338     lukem     259: TOOL_ROFF_PS=          ${TOOL_GROFF} -Tps
                    260: TOOL_ROFF_RAW=         ${TOOL_GROFF} -Z
                    261: TOOL_RPCGEN=           CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
                    262: TOOL_SOELIM=           ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
1.342     lukem     263: TOOL_STAT=             ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
1.338     lukem     264: TOOL_SUNLABEL=         ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
                    265: TOOL_TBL=              ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
                    266: TOOL_UUDECODE=         ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
                    267: TOOL_VGRIND=           ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
                    268: TOOL_ZIC=              ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
1.180     tv        269:
1.275     lukem     270: .endif # USETOOLS == yes                                               # }
1.272     lukem     271:
1.341     lukem     272: #
1.272     lukem     273: # Targets to check if DESTDIR or RELEASEDIR is provided
                    274: #
                    275: .if !target(check_DESTDIR)
                    276: check_DESTDIR: .PHONY .NOTMAIN
                    277: .if !defined(DESTDIR)
                    278:        @echo "setenv DESTDIR before doing that!"
                    279:        @false
                    280: .else
                    281:        @true
                    282: .endif
                    283: .endif
                    284:
                    285: .if !target(check_RELEASEDIR)
                    286: check_RELEASEDIR: .PHONY .NOTMAIN
                    287: .if !defined(RELEASEDIR)
                    288:        @echo "setenv RELEASEDIR before doing that!"
                    289:        @false
                    290: .else
                    291:        @true
                    292: .endif
                    293: .endif
                    294:
                    295:
1.341     lukem     296: .if ${USETOOLS} == "yes"                                               # {
                    297: #
1.180     tv        298: # Make sure DESTDIR is set, so that builds with these tools always
                    299: # get appropriate -nostdinc, -nostdlib, etc. handling.  The default is
                    300: # <empty string>, meaning start from /, the root directory.
1.341     lukem     301: #
1.180     tv        302: DESTDIR?=
1.341     lukem     303: .endif                                                                 # }
1.287     lukem     304:
1.341     lukem     305: #
1.306     lukem     306: # Build a dynamically linked /bin and /sbin, with the necessary shared
                    307: # libraries moved from /usr/lib to /lib and the shared linker moved
                    308: # from /usr/libexec to /lib
                    309: #
1.315     thorpej   310: # Note that if the BINDIR is not /bin or /sbin, then we always use the
                    311: # non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
                    312: # and /sbin).  See <bsd.shlib.mk>.
                    313: #
1.311     lukem     314: MKDYNAMICROOT?=        yes
1.306     lukem     315:
1.341     lukem     316: #
1.287     lukem     317: # Where the system object and source trees are kept; can be configurable
                    318: # by the user in case they want them in ~/foosrc and ~/fooobj (for example).
                    319: #
                    320: BSDSRCDIR?=    /usr/src
                    321: BSDOBJDIR?=    /usr/obj
1.288     lukem     322: NETBSDSRCDIR?= ${BSDSRCDIR}
1.1       cgd       323:
1.61      lukem     324: BINGRP?=       wheel
                    325: BINOWN?=       root
1.1       cgd       326: BINMODE?=      555
1.4       mycroft   327: NONBINMODE?=   444
1.17      brezak    328:
1.31      christos  329: MANDIR?=       /usr/share/man
1.61      lukem     330: MANGRP?=       wheel
                    331: MANOWN?=       root
1.4       mycroft   332: MANMODE?=      ${NONBINMODE}
1.52      mycroft   333: MANINSTALL?=   maninstall catinstall
1.115     tv        334:
                    335: INFODIR?=      /usr/share/info
                    336: INFOGRP?=      wheel
                    337: INFOOWN?=      root
                    338: INFOMODE?=     ${NONBINMODE}
1.4       mycroft   339:
                    340: LIBDIR?=       /usr/lib
1.315     thorpej   341:
1.4       mycroft   342: LINTLIBDIR?=   /usr/libdata/lint
                    343: LIBGRP?=       ${BINGRP}
                    344: LIBOWN?=       ${BINOWN}
                    345: LIBMODE?=      ${NONBINMODE}
                    346:
1.135     simonb    347: DOCDIR?=       /usr/share/doc
1.136     simonb    348: HTMLDOCDIR?=   /usr/share/doc/html
1.61      lukem     349: DOCGRP?=       wheel
                    350: DOCOWN?=       root
1.135     simonb    351: DOCMODE?=      ${NONBINMODE}
1.15      jtc       352:
                    353: NLSDIR?=       /usr/share/nls
1.61      lukem     354: NLSGRP?=       wheel
                    355: NLSOWN?=       root
1.15      jtc       356: NLSMODE?=      ${NONBINMODE}
1.25      explorer  357:
                    358: KMODDIR?=      /usr/lkm
1.61      lukem     359: KMODGRP?=      wheel
                    360: KMODOWN?=      root
1.25      explorer  361: KMODMODE?=     ${NONBINMODE}
1.155     itojun    362:
                    363: LOCALEDIR?=    /usr/share/locale
                    364: LOCALEGRP?=    wheel
                    365: LOCALEOWN?=    root
                    366: LOCALEMODE?=   ${NONBINMODE}
1.1       cgd       367:
1.341     lukem     368: #
                    369: # Data-driven table using make variables to control how
1.264     thorpej   370: # toolchain-dependent targets and shared libraries are built
                    371: # for different platforms and object formats.
                    372: #
1.296     thorpej   373: # OBJECT_FMT:          currently either "ELF" or "a.out".
1.264     thorpej   374: #
1.296     thorpej   375: # All platforms are ELF, except for ns32k (which does not yet have
                    376: # an ELF BFD back-end).
1.341     lukem     377: #
1.296     thorpej   378: .if ${MACHINE_ARCH} == "ns32k"
                    379: OBJECT_FMT?=   a.out           # allow overrides, to ease transition
                    380: .else
1.264     thorpej   381: OBJECT_FMT=    ELF
                    382: .endif
                    383:
1.341     lukem     384: #
1.310     thorpej   385: # If this platform's toolchain is missing, we obviously cannot build it.
1.341     lukem     386: #
1.310     thorpej   387: .if ${TOOLCHAIN_MISSING} == "yes"
                    388: MKBFD:= no
                    389: MKGDB:= no
                    390: MKGCC:= no
                    391: .endif
                    392:
1.341     lukem     393: #
1.310     thorpej   394: # If we are using an external toolchain, we can still build the target's
                    395: # BFD stuff, but we cannot build GCC's support libraries, since those are
                    396: # tightly-coupled to the version of GCC being used.
1.341     lukem     397: #
1.310     thorpej   398: .if defined(EXTERNAL_TOOLCHAIN)
                    399: MKGCC:= no
                    400: .endif
                    401:
1.341     lukem     402: #
1.141     msaitoh   403: # The sh3 port is incomplete.
1.341     lukem     404: #
1.337     marcus    405: .if ${MACHINE_CPU} == "sh3" && !defined(HAVE_GCC3)
1.230     tv        406: NOPIC=         # defined
1.266     thorpej   407: .endif
1.18      cgd       408:
1.341     lukem     409: #
1.301     scw       410: # The sh5 port is incomplete.
1.341     lukem     411: #
1.317     thorpej   412: .if ${MACHINE_CPU} == "sh5"
1.301     scw       413: NOPROFILE=     # defined
                    414: .endif
                    415:
1.341     lukem     416: #
1.165     fredette  417: # The m68000 port is incomplete.
1.341     lukem     418: #
1.165     fredette  419: .if ${MACHINE_ARCH} == "m68000"
1.230     tv        420: NOPIC=         # defined
1.32      thorpej   421: .endif
1.122     simonb    422:
1.341     lukem     423: #
1.297     fredette  424: # The hppa port is incomplete.
1.341     lukem     425: #
1.297     fredette  426: .if ${MACHINE_ARCH} == "hppa"
                    427: NOLINT=                # defined
                    428: NOPROFILE=     # defined
                    429: .endif
                    430:
1.341     lukem     431: #
1.327     thorpej   432: # On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
                    433: # not just shared libraries, so don't build the _pic version.
1.341     lukem     434: #
1.327     thorpej   435: .if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
                    436: MKPICLIB:=     no
                    437: .endif
                    438:
1.341     lukem     439: #
1.296     thorpej   440: # If the ns32k port is using an external toolchain, shared libraries
                    441: # are not yet supported.
1.341     lukem     442: #
1.310     thorpej   443: .if ${MACHINE_ARCH} == "ns32k" && defined(EXTERNAL_TOOLCHAIN)
1.296     thorpej   444: NOPIC=         # defined
                    445: .endif
                    446:
1.341     lukem     447: #
1.327     thorpej   448: # On VAX using ELF, all objects are PIC, not just shared libraries,
                    449: # so don't build the _pic version.
1.341     lukem     450: #
1.327     thorpej   451: .if ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
                    452: MKPICLIB:=     no
                    453: .endif
                    454:
1.341     lukem     455: #
1.122     simonb    456: # Location of the file that contains the major and minor numbers of the
                    457: # version of a shared library.  If this file exists a shared library
                    458: # will be built by <bsd.lib.mk>.
1.341     lukem     459: #
1.122     simonb    460: SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
1.69      tv        461:
1.341     lukem     462: #
1.69      tv        463: # GNU sources and packages sometimes see architecture names differently.
1.341     lukem     464: #
1.261     thorpej   465: GNU_ARCH.m68000=m68010
1.150     itojun    466: GNU_ARCH.sh3eb=sh
1.236     thorpej   467: GNU_ARCH.sh3el=shle
1.317     thorpej   468: GNU_ARCH.sh5eb=sh5
                    469: GNU_ARCH.sh5el=sh5le
1.172     tv        470: MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
1.161     tv        471:
1.341     lukem     472: #
1.161     tv        473: # In order to identify NetBSD to GNU packages, we sometimes need
                    474: # an "elf" tag for historically a.out platforms.
1.341     lukem     475: #
1.162     tv        476: .if ${OBJECT_FMT} == "ELF" && \
1.192     thorpej   477:     (${MACHINE_GNU_ARCH} == "arm" || \
1.294     thorpej   478:      ${MACHINE_GNU_ARCH} == "armeb" || \
1.296     thorpej   479:      ${MACHINE_ARCH} == "ns32k" || \
1.168     matt      480:      ${MACHINE_ARCH} == "i386" || \
1.161     tv        481:      ${MACHINE_ARCH} == "m68k" || \
1.260     thorpej   482:      ${MACHINE_ARCH} == "m68000" || \
1.235     thorpej   483:      ${MACHINE_GNU_ARCH} == "sh" || \
1.236     thorpej   484:      ${MACHINE_GNU_ARCH} == "shle" || \
1.317     thorpej   485:      ${MACHINE_GNU_ARCH} == "sh5" || \
                    486:      ${MACHINE_GNU_ARCH} == "sh5le" || \
1.168     matt      487:      ${MACHINE_ARCH} == "sparc" || \
                    488:      ${MACHINE_ARCH} == "vax")
1.318     thorpej   489: MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
1.161     tv        490: .else
1.318     thorpej   491: MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
1.161     tv        492: .endif
1.153     itojun    493:
1.160     tv        494: TARGETS+=      all clean cleandir depend dependall includes \
1.142     phil      495:                install lint obj regress tags html installhtml cleanhtml
1.128     perry     496: .PHONY:                all clean cleandir depend dependall distclean includes \
                    497:                install lint obj regress tags beforedepend afterdepend \
1.142     phil      498:                beforeinstall afterinstall realinstall realdepend realall \
1.257     reinoud   499:                html installhtml cleanhtml subdir-all subdir-install subdir-depend
1.58      agc       500:
1.116     lukem     501: .if ${NEED_OWN_INSTALL_TARGET} == "yes"
1.56      drochner  502: .if !target(install)
                    503: install:       .NOTMAIN beforeinstall subdir-install realinstall afterinstall
1.55      drochner  504: beforeinstall: .NOTMAIN
1.56      drochner  505: subdir-install:        .NOTMAIN beforeinstall
                    506: realinstall:   .NOTMAIN beforeinstall
                    507: afterinstall:  .NOTMAIN subdir-install realinstall
1.58      agc       508: .endif
1.131     mycroft   509: all:           .NOTMAIN realall subdir-all
                    510: subdir-all:    .NOTMAIN
                    511: realall:       .NOTMAIN
                    512: depend:                .NOTMAIN realdepend subdir-depend
                    513: subdir-depend: .NOTMAIN
                    514: realdepend:    .NOTMAIN
1.160     tv        515: distclean:     .NOTMAIN cleandir
1.171     tv        516: cleandir:      .NOTMAIN clean
1.205     tv        517:
                    518: dependall:     .NOTMAIN realdepend .MAKE
                    519:        @cd ${.CURDIR}; ${MAKE} realall
1.132     mycroft   520: .endif
1.116     lukem     521:
1.341     lukem     522: #
1.116     lukem     523: # Define MKxxx variables (which are either yes or no) for users
1.350     lukem     524: # to set in /etc/mk.conf and override in the make environment.
1.116     lukem     525: # These should be tested with `== "no"' or `!= "no"'.
1.340     lukem     526: # The NOxxx variables should only be set by Makefiles.
1.116     lukem     527: #
                    528:
1.341     lukem     529: #
1.230     tv        530: # Supported NO* options (if defined, MK* will be forced to "no",
                    531: # regardless of user's mk.conf setting).
1.341     lukem     532: #
1.340     lukem     533: .for var in CRYPTO DOC HTML LINKLIB LINT MAN NLS OBJ PIC PICINSTALL PROFILE \
                    534:        SHARE
1.230     tv        535: .if defined(NO${var})
                    536: MK${var}:=     no
                    537: .endif
                    538: .endfor
1.268     ross      539:
1.341     lukem     540: #
                    541: # Older-style variables that enabled behaviour when set.
                    542: #
                    543: .for var in MANZ UNPRIVED UPDATE
                    544: .if defined(${var})
                    545: MK${var}:=     yes
1.268     ross      546: .endif
1.341     lukem     547: .endfor
1.230     tv        548:
1.341     lukem     549: #
1.230     tv        550: # MK* options which default to "yes".
1.341     lukem     551: #
1.340     lukem     552: .for var in BFD CATPAGES CRYPTO DOC GCC GDB HESIOD HTML IEEEFP INFO KERBEROS \
1.344     itojun    553:        KERBEROS4 LINKLIB LINT MAN NLS OBJ PIC PICINSTALL PICLIB PROFILE \
                    554:        SHARE SKEY YP
1.230     tv        555: MK${var}?=     yes
                    556: .endfor
                    557:
1.341     lukem     558: #
1.230     tv        559: # MK* options which default to "no".
1.341     lukem     560: #
1.351     lukem     561: .for var in CRYPTO_IDEA CRYPTO_MDC2 CRYPTO_RC5 \
1.350     lukem     562:        MANZ OBJDIRS SOFTFLOAT UNPRIVED UPDATE
1.230     tv        563: MK${var}?=     no
                    564: .endfor
                    565:
1.341     lukem     566: #
1.230     tv        567: # Force some options off if their dependencies are off.
1.341     lukem     568: #
                    569:
1.230     tv        570: .if ${MKCRYPTO} == "no"
1.344     itojun    571: MKKERBEROS4:=  no
1.230     tv        572: MKKERBEROS:=   no
1.340     lukem     573: .endif
                    574:
                    575: .if ${MKMAN} == "no"
1.341     lukem     576: MKCATPAGES:=   no
1.340     lukem     577: MKHTML:=       no
1.116     lukem     578: .endif
                    579:
1.117     lukem     580: .if ${MKLINKLIB} == "no"
1.230     tv        581: MKPICINSTALL:= no
                    582: MKPROFILE:=    no
1.327     thorpej   583: .endif
                    584:
                    585: .if ${MKPIC} == "no"
                    586: MKPICLIB:=     no
1.116     lukem     587: .endif
                    588:
1.230     tv        589: .if ${MKOBJ} == "no"
                    590: MKOBJDIRS:=    no
1.116     lukem     591: .endif
                    592:
1.117     lukem     593: .if ${MKSHARE} == "no"
1.230     tv        594: MKCATPAGES:=   no
                    595: MKDOC:=                no
                    596: MKINFO:=       no
1.341     lukem     597: MKHTML:=       no
1.230     tv        598: MKMAN:=                no
                    599: MKNLS:=                no
1.116     lukem     600: .endif
1.276     thorpej   601:
1.341     lukem     602: #
                    603: # install(1) parameters.
                    604: #
                    605: COPY?=         -c
                    606: .if ${MKUPDATE} == "no"
                    607: PRESERVE?=
                    608: .else
                    609: PRESERVE?=     -p
                    610: .endif
                    611: RENAME?=       -r
                    612: HRDLINK?=      -l h
                    613: SYMLINK?=      -l s
                    614:
                    615: METALOG?=      ${DESTDIR}/METALOG
                    616: METALOG.add?=  ${TOOL_CAT} -l >> ${METALOG}
                    617: .if (${_SRC_TOP_} != "")       # only set INSTPRIV if inside ${NETBSDSRCDIR}
                    618: .if ${MKUNPRIVED} != "no"
                    619: INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR}
                    620: .else
                    621: INSTPRIV.unpriv=
                    622: .endif
                    623: INSTPRIV?=     ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
                    624: .endif
                    625: SYSPKGTAG?=    ${SYSPKG:D-T ${SYSPKG}_pkg}
                    626: SYSPKGDOCTAG?= ${SYSPKG:D-T ${SYSPKG}-doc_pkg}
                    627: STRIPFLAG?=    -s
                    628:
                    629: .if ${NEED_OWN_INSTALL_TARGET} == "yes"
                    630: INSTALL_DIR?=          ${INSTALL} ${INSTPRIV} -d
                    631: INSTALL_FILE?=         ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
                    632: INSTALL_LINK?=         ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
                    633: INSTALL_SYMLINK?=      ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
                    634: HOST_INSTALL_FILE?=    ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
                    635: .endif
                    636:
                    637: #
1.351     lukem     638: # Set defaults for the USE_xxx variables.
                    639: #
                    640:
                    641: #
                    642: # USE_* options which default to "yes" unless their corresponding MK*
                    643: # variable is set to "no".
1.341     lukem     644: #
1.344     itojun    645: .for var in HESIOD KERBEROS KERBEROS4 SKEY YP
1.276     thorpej   646: .if (${MK${var}} == "no")
                    647: USE_${var}:= no
                    648: .else
                    649: USE_${var}?= yes
                    650: .endif
1.351     lukem     651: .endfor
                    652:
                    653: #
                    654: # USE_* options which default to "yes".
                    655: #
                    656: .for var in LIBSTDCXX
                    657: USE_${var}?= yes
1.276     thorpej   658: .endfor
1.300     tron      659:
1.341     lukem     660: #
1.328     tron      661: # Use XFree86 4.x as default version on i386, amd64, macppc and cats.
1.341     lukem     662: #
1.329     fvdl      663: .if ${MACHINE_ARCH} == "i386" || ${MACHINE} == "amd64" || \
1.343     mrg       664:     ${MACHINE} == "macppc" || ${MACHINE} == "cats" || \
                    665:     ${MACHINE} == "sparc"
1.300     tron      666: USE_XF86_4?=   yes
                    667: .endif
1.64      lukem     668:
1.347     lukem     669: .endif # !defined(_BSD_OWN_MK_)

CVSweb <webmaster@jp.NetBSD.org>