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

1.511   ! ad          1: #      $NetBSD: bsd.own.mk,v 1.510 2008/05/10 19:01:14 skrll Exp $
1.64      lukem       2:
                      3: .if !defined(_BSD_OWN_MK_)
                      4: _BSD_OWN_MK_=1
1.24      thorpej     5:
1.169     tv          6: MAKECONF?=     /etc/mk.conf
1.205     tv          7: .-include "${MAKECONF}"
1.13      mycroft     8:
1.341     lukem       9: #
1.310     thorpej    10: # CPU model, derived from MACHINE_ARCH
1.341     lukem      11: #
1.495     scw        12: MACHINE_CPU=   ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/}
1.310     thorpej    13:
1.341     lukem      14: #
1.418     cl         15: # Subdirectory used below ${RELEASEDIR} when building a release
                     16: #
                     17: RELEASEMACHINEDIR?=    ${MACHINE}
                     18:
                     19: #
                     20: # Subdirectory or path component used for the following paths:
                     21: #   distrib/${RELEASEMACHINE}
                     22: #   distrib/notes/${RELEASEMACHINE}
                     23: #   etc/etc.${RELEASEMACHINE}
                     24: # Used when building a release.
                     25: #
                     26: RELEASEMACHINE?=       ${MACHINE}
                     27:
                     28: #
1.209     tv         29: # NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
                     30: # ensure that things defined by <bsd.own.mk> (default targets,
                     31: # INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
1.341     lukem      32: #
1.209     tv         33: NEED_OWN_INSTALL_TARGET?=      yes
                     34:
1.341     lukem      35: #
1.310     thorpej    36: # This lists the platforms which do not have working in-tree toolchains.
1.403     scw        37: # For the in-tree gcc 3.3.2 toolchain, this list is empty.
                     38: # If some future port is not supported by the in-tree toolchain, this
                     39: # should be set to "yes" for that port only.
1.341     lukem      40: #
1.448     mrg        41: TOOLCHAIN_MISSING?=    no
1.221     thorpej    42:
1.477     matt       43: # default to GCC4
                     44: HAVE_GCC?=     4
1.395     mrg        45:
1.493     chs        46: # default to GDB6
1.476     christos   47: HAVE_GDB?=     6
1.456     christos   48:
1.221     thorpej    49: CPPFLAG_ISYSTEM=       -isystem
1.452     mrg        50: .if ${HAVE_GCC} == 3
1.352     mrg        51: CPPFLAG_ISYSTEMXX=     -isystem-cxx
1.452     mrg        52: .else  # GCC 4
1.450     mrg        53: CPPFLAG_ISYSTEMXX=     -cxx-isystem
1.346     mrg        54: .endif
1.184     tv         55:
1.222     perry      56: .if empty(.MAKEFLAGS:M-V*)
1.489     dsl        57: .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
                     58: PRINTOBJDIR=   ${MAKE} -r -V .OBJDIR -f /dev/null xxx
                     59: .else
1.488     drochner   60: PRINTOBJDIR=   ${MAKE} -V .OBJDIR
1.489     dsl        61: .endif
1.222     perry      62: .else
                     63: PRINTOBJDIR=   echo # prevent infinite recursion
                     64: .endif
                     65:
1.341     lukem      66: #
1.286     lukem      67: # Determine if running in the NetBSD source tree by checking for the
                     68: # existence of build.sh and tools/ in the current or a parent directory,
                     69: # and setting _SRC_TOP_ to the result.
                     70: #
1.287     lukem      71: .if !defined(_SRC_TOP_)                        # {
1.199     jmc        72: _SRC_TOP_!= cd ${.CURDIR}; while :; do \
1.200     jmc        73:                here=`pwd`; \
1.199     jmc        74:                [ -f build.sh  ] && [ -d tools ] && { echo $$here; break; }; \
                     75:                case $$here in /) echo ""; break;; esac; \
1.341     lukem      76:                cd ..; done
1.199     jmc        77:
                     78: .MAKEOVERRIDES+=       _SRC_TOP_
                     79:
1.287     lukem      80: .endif                                 # }
1.222     perry      81:
1.341     lukem      82: #
1.322     lukem      83: # If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
1.288     lukem      84: # defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
1.287     lukem      85: #
                     86: .if (${_SRC_TOP_} != "")               # {
                     87:
1.288     lukem      88: NETBSDSRCDIR?= ${_SRC_TOP_}
1.180     tv         89:
1.287     lukem      90: .if !defined(_SRC_TOP_OBJ_)
                     91: _SRC_TOP_OBJ_!=                cd ${_SRC_TOP_} && ${PRINTOBJDIR}
                     92: .MAKEOVERRIDES+=       _SRC_TOP_OBJ_
1.286     lukem      93: .endif
                     94:
1.322     lukem      95: .endif # _SRC_TOP_ != ""               # }
1.286     lukem      96:
                     97:
1.310     thorpej    98: .if (${_SRC_TOP_} != "") && \
1.406     lukem      99:     (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
1.287     lukem     100: USETOOLS?=     yes
1.286     lukem     101: .endif
1.287     lukem     102: USETOOLS?=     no
                    103:
1.286     lukem     104:
1.468     matt      105: .if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
1.495     scw       106:     ${MACHINE_ARCH} == "sh3"
1.180     tv        107: .BEGIN:
                    108:        @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
                    109:        @false
1.310     thorpej   110: .elif defined(REQUIRETOOLS) && \
1.406     lukem     111:       (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
1.310     thorpej   112:       ${USETOOLS} == "no"
1.180     tv        113: .BEGIN:
1.203     tv        114:        @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
1.180     tv        115:        @false
                    116: .endif
                    117:
1.341     lukem     118: #
1.204     tv        119: # Host platform information; may be overridden
1.341     lukem     120: #
1.204     tv        121: .if !defined(HOST_OSTYPE)
                    122: _HOST_OSNAME!= uname -s
                    123: _HOST_OSREL!=  uname -r
                    124: _HOST_ARCH!=   uname -p 2>/dev/null || uname -m
1.421     jmc       125: HOST_OSTYPE:=  ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g}
1.204     tv        126: .MAKEOVERRIDES+= HOST_OSTYPE
                    127: .endif
1.333     christos  128: HOST_CYGWIN=   ${HOST_OSTYPE:MCYGWIN*}
1.204     tv        129:
1.275     lukem     130: .if ${USETOOLS} == "yes"                                               # {
                    131:
1.341     lukem     132: #
1.204     tv        133: # Provide a default for TOOLDIR.
1.341     lukem     134: #
1.199     jmc       135: .if !defined(TOOLDIR)
1.339     lukem     136: TOOLDIR:=      ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
1.204     tv        137: .MAKEOVERRIDES+= TOOLDIR
1.199     jmc       138: .endif
1.180     tv        139:
1.341     lukem     140: #
1.320     thorpej   141: # This is the prefix used for the NetBSD-sourced tools.
1.341     lukem     142: #
1.320     thorpej   143: _TOOL_PREFIX?= nb
                    144:
1.341     lukem     145: #
1.318     thorpej   146: # If an external toolchain base is specified, use it.
1.341     lukem     147: #
                    148: .if defined(EXTERNAL_TOOLCHAIN)                                                # {
1.318     thorpej   149: AR=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
                    150: AS=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
                    151: LD=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
                    152: NM=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
                    153: OBJCOPY=       ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
                    154: OBJDUMP=       ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
                    155: RANLIB=                ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
                    156: SIZE=          ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
                    157: STRIP=         ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
                    158:
                    159: CC=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
                    160: CPP=           ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
                    161: CXX=           ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
                    162: FC=            ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
                    163: OBJC=          ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
1.341     lukem     164: .else                                                                  # } {
1.204     tv        165: # Define default locations for common tools.
1.341     lukem     166: .if ${USETOOLS_BINUTILS:Uyes} == "yes"                                 #  {
1.232     tv        167: AR=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
                    168: AS=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
1.234     thorpej   169: LD=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
                    170: NM=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
                    171: OBJCOPY=       ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
                    172: OBJDUMP=       ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
                    173: RANLIB=                ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
                    174: SIZE=          ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
                    175: STRIP=         ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
1.341     lukem     176: .endif                                                                 #  }
1.234     thorpej   177:
1.341     lukem     178: .if ${USETOOLS_GCC:Uyes} == "yes"                                      #  {
1.234     thorpej   179: CC=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
                    180: CPP=           ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
                    181: CXX=           ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
                    182: FC=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
                    183: OBJC=          ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
1.341     lukem     184: .endif                                                                 #  }
                    185: .endif # EXTERNAL_TOOLCHAIN                                            # }
1.234     thorpej   186:
1.338     lukem     187: HOST_MKDEP=    ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
                    188:
1.210     thorpej   189: DBSYM=         ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
1.320     thorpej   190: ELF2ECOFF=     ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
1.496     joerg     191: INSTALL=       ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
1.320     thorpej   192: LEX=           ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
1.215     tv        193: LINT=          CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
1.338     lukem     194: LORDER=                NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
1.320     thorpej   195: MKDEP=         CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
1.483     christos  196: PAXCTL=                ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
1.320     thorpej   197: TSORT=         ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
                    198: YACC=          ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
1.338     lukem     199:
1.426     jmc       200: TOOL_AMIGAAOUT2BB=     ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
                    201: TOOL_AMIGAELF2BB=      ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
                    202: TOOL_AMIGATXLT=                ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
1.338     lukem     203: TOOL_ASN1_COMPILE=     ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
1.498     jmmv      204: TOOL_ATF_COMPILE=      ${TOOLDIR}/bin/${_TOOL_PREFIX}atf-compile
1.425     jmc       205: TOOL_BEBOXELF2PEF=     ${TOOLDIR}/bin/${_TOOL_PREFIX}bebox-elf2pef
                    206: TOOL_BEBOXMKBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}bebox-mkbootimage
1.338     lukem     207: TOOL_CAP_MKDB=         ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
                    208: TOOL_CAT=              ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
                    209: TOOL_CKSUM=            ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
                    210: TOOL_COMPILE_ET=       ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
                    211: TOOL_CONFIG=           ${TOOLDIR}/bin/${_TOOL_PREFIX}config
                    212: TOOL_CRUNCHGEN=                MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
                    213: TOOL_CTAGS=            ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
                    214: TOOL_DB=               ${TOOLDIR}/bin/${_TOOL_PREFIX}db
                    215: TOOL_EQN=              ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
                    216: TOOL_FGEN=             ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
1.439     thorpej   217: TOOL_GENASSYM=         ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
1.338     lukem     218: TOOL_GENCAT=           ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
1.446     jmc       219: TOOL_GMAKE=            ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
1.338     lukem     220: TOOL_GROFF=            PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
                    221: TOOL_HEXDUMP=          ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
1.427     jmc       222: TOOL_HP300MKBOOT=      ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
1.510     skrll     223: TOOL_HP700MKBOOT=      ${TOOLDIR}/bin/${_TOOL_PREFIX}hp700-mkboot
1.338     lukem     224: TOOL_INDXBIB=          ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
                    225: TOOL_INSTALLBOOT=      ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
                    226: TOOL_INSTALL_INFO=     ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
1.492     apb       227: TOOL_JOIN=             ${TOOLDIR}/bin/${_TOOL_PREFIX}join
1.338     lukem     228: TOOL_M4=               ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
1.405     matt      229: TOOL_MACPPCFIXCOFF=    ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
1.338     lukem     230: TOOL_MAKEFS=           ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
                    231: TOOL_MAKEINFO=         ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
                    232: TOOL_MAKEWHATIS=       ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
                    233: TOOL_MDSETIMAGE=       ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
1.490     dyoung    234: TOOL_DISKLABEL=                ${TOOLDIR}/bin/nbdisklabel-${MAKEWRAPPERMACHINE}
1.440     dyoung    235: TOOL_FDISK=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
1.338     lukem     236: TOOL_MENUC=            MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
1.425     jmc       237: TOOL_MIPSELF2ECOFF=    ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
1.338     lukem     238: TOOL_MKCSMAPPER=       ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
                    239: TOOL_MKESDB=           ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
                    240: TOOL_MKLOCALE=         ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
                    241: TOOL_MKMAGIC=          ${TOOLDIR}/bin/${_TOOL_PREFIX}file
                    242: TOOL_MKTEMP=           ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
                    243: TOOL_MSGC=             MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
                    244: TOOL_MTREE=            ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
                    245: TOOL_PAX=              ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
                    246: TOOL_PIC=              ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
1.506     garbled   247: TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
1.338     lukem     248: TOOL_PWD_MKDB=         ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
                    249: TOOL_REFER=            ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
                    250: TOOL_ROFF_ASCII=       PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
                    251: TOOL_ROFF_DVI=         ${TOOL_GROFF} -Tdvi
1.340     lukem     252: TOOL_ROFF_HTML=                ${TOOL_GROFF} -Tlatin1 -mdoc2html
1.338     lukem     253: TOOL_ROFF_PS=          ${TOOL_GROFF} -Tps
                    254: TOOL_ROFF_RAW=         ${TOOL_GROFF} -Z
1.501     nakayama  255: TOOL_RPCGEN=           RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
1.454     gdamore   256: TOOL_SED=              ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
1.338     lukem     257: TOOL_SOELIM=           ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
1.342     lukem     258: TOOL_STAT=             ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
1.420     abs       259: TOOL_SPARKCRC=         ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
1.338     lukem     260: TOOL_SUNLABEL=         ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
                    261: TOOL_TBL=              ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
                    262: TOOL_UUDECODE=         ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
                    263: TOOL_VGRIND=           ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
                    264: TOOL_ZIC=              ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
1.180     tv        265:
1.275     lukem     266: .endif # USETOOLS == yes                                               # }
1.272     lukem     267:
1.341     lukem     268: #
1.272     lukem     269: # Targets to check if DESTDIR or RELEASEDIR is provided
                    270: #
                    271: .if !target(check_DESTDIR)
                    272: check_DESTDIR: .PHONY .NOTMAIN
                    273: .if !defined(DESTDIR)
                    274:        @echo "setenv DESTDIR before doing that!"
                    275:        @false
                    276: .else
                    277:        @true
                    278: .endif
                    279: .endif
                    280:
                    281: .if !target(check_RELEASEDIR)
                    282: check_RELEASEDIR: .PHONY .NOTMAIN
                    283: .if !defined(RELEASEDIR)
                    284:        @echo "setenv RELEASEDIR before doing that!"
                    285:        @false
                    286: .else
                    287:        @true
                    288: .endif
                    289: .endif
                    290:
                    291:
1.341     lukem     292: .if ${USETOOLS} == "yes"                                               # {
                    293: #
1.180     tv        294: # Make sure DESTDIR is set, so that builds with these tools always
                    295: # get appropriate -nostdinc, -nostdlib, etc. handling.  The default is
                    296: # <empty string>, meaning start from /, the root directory.
1.341     lukem     297: #
1.180     tv        298: DESTDIR?=
1.341     lukem     299: .endif                                                                 # }
1.287     lukem     300:
1.341     lukem     301: #
1.306     lukem     302: # Build a dynamically linked /bin and /sbin, with the necessary shared
                    303: # libraries moved from /usr/lib to /lib and the shared linker moved
                    304: # from /usr/libexec to /lib
                    305: #
1.315     thorpej   306: # Note that if the BINDIR is not /bin or /sbin, then we always use the
                    307: # non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
                    308: # and /sbin).  See <bsd.shlib.mk>.
                    309: #
1.311     lukem     310: MKDYNAMICROOT?=        yes
1.306     lukem     311:
1.341     lukem     312: #
1.287     lukem     313: # Where the system object and source trees are kept; can be configurable
                    314: # by the user in case they want them in ~/foosrc and ~/fooobj (for example).
                    315: #
                    316: BSDSRCDIR?=    /usr/src
                    317: BSDOBJDIR?=    /usr/obj
1.288     lukem     318: NETBSDSRCDIR?= ${BSDSRCDIR}
1.1       cgd       319:
1.61      lukem     320: BINGRP?=       wheel
                    321: BINOWN?=       root
1.1       cgd       322: BINMODE?=      555
1.4       mycroft   323: NONBINMODE?=   444
1.17      brezak    324:
1.31      christos  325: MANDIR?=       /usr/share/man
1.61      lukem     326: MANGRP?=       wheel
                    327: MANOWN?=       root
1.4       mycroft   328: MANMODE?=      ${NONBINMODE}
1.52      mycroft   329: MANINSTALL?=   maninstall catinstall
1.115     tv        330:
                    331: INFODIR?=      /usr/share/info
                    332: INFOGRP?=      wheel
                    333: INFOOWN?=      root
                    334: INFOMODE?=     ${NONBINMODE}
1.4       mycroft   335:
                    336: LIBDIR?=       /usr/lib
1.315     thorpej   337:
1.4       mycroft   338: LINTLIBDIR?=   /usr/libdata/lint
                    339: LIBGRP?=       ${BINGRP}
                    340: LIBOWN?=       ${BINOWN}
                    341: LIBMODE?=      ${NONBINMODE}
                    342:
1.135     simonb    343: DOCDIR?=       /usr/share/doc
1.136     simonb    344: HTMLDOCDIR?=   /usr/share/doc/html
1.61      lukem     345: DOCGRP?=       wheel
                    346: DOCOWN?=       root
1.135     simonb    347: DOCMODE?=      ${NONBINMODE}
1.15      jtc       348:
                    349: NLSDIR?=       /usr/share/nls
1.61      lukem     350: NLSGRP?=       wheel
                    351: NLSOWN?=       root
1.15      jtc       352: NLSMODE?=      ${NONBINMODE}
1.25      explorer  353:
                    354: KMODDIR?=      /usr/lkm
1.61      lukem     355: KMODGRP?=      wheel
                    356: KMODOWN?=      root
1.25      explorer  357: KMODMODE?=     ${NONBINMODE}
1.155     itojun    358:
1.508     ad        359: KMODULEGRP?=   wheel
                    360: KMODULEOWN?=   root
                    361: KMODULEMODE?=  ${NONBINMODE}
                    362:
1.155     itojun    363: LOCALEDIR?=    /usr/share/locale
                    364: LOCALEGRP?=    wheel
                    365: LOCALEOWN?=    root
                    366: LOCALEMODE?=   ${NONBINMODE}
1.1       cgd       367:
1.453     rpaulo    368: FIRMWAREDIR?=  /libdata/firmware
                    369: FIRMWAREGRP?=  wheel
                    370: FIRMWAREOWN?=  root
                    371: FIRMWAREMODE?= ${NONBINMODE}
                    372:
1.465     lukem     373: DEBUGDIR?=     /usr/libdata/debug
                    374: DEBUGGRP?=     wheel
                    375: DEBUGOWN?=     root
                    376: DEBUGMODE?=    ${NONBINMODE}
                    377:
1.341     lukem     378: #
                    379: # Data-driven table using make variables to control how
1.264     thorpej   380: # toolchain-dependent targets and shared libraries are built
                    381: # for different platforms and object formats.
                    382: #
1.296     thorpej   383: # OBJECT_FMT:          currently either "ELF" or "a.out".
1.264     thorpej   384: #
1.499     simonb    385: # All platforms are ELF.
1.341     lukem     386: #
1.264     thorpej   387: OBJECT_FMT=    ELF
                    388:
1.341     lukem     389: #
1.310     thorpej   390: # If this platform's toolchain is missing, we obviously cannot build it.
1.341     lukem     391: #
1.406     lukem     392: .if ${TOOLCHAIN_MISSING} != "no"
1.310     thorpej   393: MKBFD:= no
                    394: MKGDB:= no
                    395: MKGCC:= no
                    396: .endif
                    397:
1.341     lukem     398: #
1.310     thorpej   399: # If we are using an external toolchain, we can still build the target's
                    400: # BFD stuff, but we cannot build GCC's support libraries, since those are
                    401: # tightly-coupled to the version of GCC being used.
1.341     lukem     402: #
1.310     thorpej   403: .if defined(EXTERNAL_TOOLCHAIN)
                    404: MKGCC:= no
                    405: .endif
                    406:
1.341     lukem     407: #
1.165     fredette  408: # The m68000 port is incomplete.
1.341     lukem     409: #
1.165     fredette  410: .if ${MACHINE_ARCH} == "m68000"
1.230     tv        411: NOPIC=         # defined
1.458     mrg       412: MKISCSI=       no
                    413: # XXX GCC 4 outputs mcount() calling sequences that try to load values
                    414: # from over 64KB away and this fails to assemble.
                    415: .if ${HAVE_GCC} == 4
                    416: NOPROFILE=     # defined
                    417: .endif
1.32      thorpej   418: .endif
1.122     simonb    419:
1.341     lukem     420: #
1.441     skrll     421: # The ia64 port is incomplete.
                    422: #
                    423: .if ${MACHINE_ARCH} == "ia64"
                    424: MKLINT=                no
1.472     skrll     425: MKGDB=         no
1.441     skrll     426: .endif
                    427:
                    428: #
1.327     thorpej   429: # On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
                    430: # not just shared libraries, so don't build the _pic version.
1.341     lukem     431: #
1.327     thorpej   432: .if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
                    433: MKPICLIB:=     no
                    434: .endif
                    435:
1.341     lukem     436: #
1.327     thorpej   437: # On VAX using ELF, all objects are PIC, not just shared libraries,
1.401     matt      438: # so don't build the _pic version.  Unless we are using GCC3 which
                    439: # doesn't support PIC yet.
1.341     lukem     440: #
1.494     matt      441: .if ${MACHINE_ARCH} == "vax"
                    442: MKPICLIB=      no
1.327     thorpej   443: .endif
                    444:
1.341     lukem     445: #
1.122     simonb    446: # Location of the file that contains the major and minor numbers of the
                    447: # version of a shared library.  If this file exists a shared library
                    448: # will be built by <bsd.lib.mk>.
1.341     lukem     449: #
1.122     simonb    450: SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
1.69      tv        451:
1.341     lukem     452: #
1.69      tv        453: # GNU sources and packages sometimes see architecture names differently.
1.341     lukem     454: #
1.494     matt      455: GNU_ARCH.coldfire=m68k
1.261     thorpej   456: GNU_ARCH.m68000=m68010
1.150     itojun    457: GNU_ARCH.sh3eb=sh
1.236     thorpej   458: GNU_ARCH.sh3el=shle
1.468     matt      459: GNU_ARCH.mips64eb=mips64
1.172     tv        460: MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
1.161     tv        461:
1.341     lukem     462: #
1.161     tv        463: # In order to identify NetBSD to GNU packages, we sometimes need
                    464: # an "elf" tag for historically a.out platforms.
1.341     lukem     465: #
1.162     tv        466: .if ${OBJECT_FMT} == "ELF" && \
1.192     thorpej   467:     (${MACHINE_GNU_ARCH} == "arm" || \
1.294     thorpej   468:      ${MACHINE_GNU_ARCH} == "armeb" || \
1.168     matt      469:      ${MACHINE_ARCH} == "i386" || \
1.494     matt      470:      ${MACHINE_CPU} == "m68k" || \
1.235     thorpej   471:      ${MACHINE_GNU_ARCH} == "sh" || \
1.236     thorpej   472:      ${MACHINE_GNU_ARCH} == "shle" || \
1.168     matt      473:      ${MACHINE_ARCH} == "sparc" || \
                    474:      ${MACHINE_ARCH} == "vax")
1.318     thorpej   475: MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
1.161     tv        476: .else
1.318     thorpej   477: MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
1.161     tv        478: .endif
1.153     itojun    479:
1.160     tv        480: TARGETS+=      all clean cleandir depend dependall includes \
1.142     phil      481:                install lint obj regress tags html installhtml cleanhtml
1.485     dsl       482: PHONY_NOTMAIN =        all clean cleandir depend dependall distclean includes \
1.128     perry     483:                install lint obj regress tags beforedepend afterdepend \
1.142     phil      484:                beforeinstall afterinstall realinstall realdepend realall \
1.257     reinoud   485:                html installhtml cleanhtml subdir-all subdir-install subdir-depend
1.485     dsl       486: .PHONY:                ${PHONY_NOTMAIN}
                    487: .NOTMAIN:      ${PHONY_NOTMAIN}
1.58      agc       488:
1.406     lukem     489: .if ${NEED_OWN_INSTALL_TARGET} != "no"
1.56      drochner  490: .if !target(install)
1.485     dsl       491: install:       beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
                    492: beforeinstall:
                    493: subdir-install:
                    494: realinstall:
                    495: afterinstall:
                    496: .endif
                    497: all:           realall subdir-all
                    498: subdir-all:
                    499: realall:
                    500: depend:                realdepend subdir-depend
                    501: subdir-depend:
                    502: realdepend:
                    503: distclean:     cleandir
                    504: cleandir:      clean
1.205     tv        505:
                    506: dependall:     .NOTMAIN realdepend .MAKE
                    507:        @cd ${.CURDIR}; ${MAKE} realall
1.132     mycroft   508: .endif
1.116     lukem     509:
1.341     lukem     510: #
1.116     lukem     511: # Define MKxxx variables (which are either yes or no) for users
1.350     lukem     512: # to set in /etc/mk.conf and override in the make environment.
1.116     lukem     513: # These should be tested with `== "no"' or `!= "no"'.
1.340     lukem     514: # The NOxxx variables should only be set by Makefiles.
1.116     lukem     515: #
1.466     lukem     516: # Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
                    517: # with changes to the MK* variables here.
                    518: #
1.116     lukem     519:
1.341     lukem     520: #
1.230     tv        521: # Supported NO* options (if defined, MK* will be forced to "no",
                    522: # regardless of user's mk.conf setting).
1.341     lukem     523: #
1.503     dholland  524: # Source makefiles should set NO*, and not MK*, and must do so before
                    525: # including bsd.own.mk.
                    526: #
1.422     lukem     527: .for var in \
1.503     dholland  528:        NOCRYPTO NODOC NOHTML NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \
                    529:        NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB
                    530: .if defined(${var})
                    531: MK${var:S/^NO//}:=     no
1.230     tv        532: .endif
                    533: .endfor
1.268     ross      534:
1.341     lukem     535: #
                    536: # Older-style variables that enabled behaviour when set.
                    537: #
                    538: .for var in MANZ UNPRIVED UPDATE
                    539: .if defined(${var})
                    540: MK${var}:=     yes
1.268     ross      541: .endif
1.341     lukem     542: .endfor
1.230     tv        543:
1.341     lukem     544: #
1.230     tv        545: # MK* options which default to "yes".
1.341     lukem     546: #
1.422     lukem     547: .for var in \
1.504     lukem     548:        MKBFD MKBINUTILS \
                    549:        MKCATPAGES MKCRYPTO MKCVS \
                    550:        MKDOC \
                    551:        MKGCC MKGCCCMDS MKGDB \
                    552:        MKHESIOD MKHTML \
                    553:        MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
                    554:        MKKERBEROS \
                    555:        MKLINKLIB MKLINT \
                    556:        MKMAN \
                    557:        MKNLS \
                    558:        MKOBJ \
                    559:        MKPAM MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
                    560:        MKSHARE MKSKEY MKSTATICLIB \
                    561:        MKYP
                    562: ${var}?=       yes
1.230     tv        563: .endfor
                    564:
1.341     lukem     565: #
1.230     tv        566: # MK* options which default to "no".
1.341     lukem     567: #
1.422     lukem     568: .for var in \
1.504     lukem     569:        MKCRYPTO_IDEA MKCRYPTO_MDC2 MKCRYPTO_RC5 MKDEBUG MKDEBUGLIB \
1.509     lukem     570:        MKMANZ MKMODULAR MKOBJDIRS MKPUFFS MKSOFTFLOAT \
1.504     lukem     571:        MKUNPRIVED MKUPDATE MKX11
                    572: ${var}?=no
1.230     tv        573: .endfor
                    574:
1.341     lukem     575: #
1.230     tv        576: # Force some options off if their dependencies are off.
1.341     lukem     577: #
                    578:
1.230     tv        579: .if ${MKCRYPTO} == "no"
                    580: MKKERBEROS:=   no
1.340     lukem     581: .endif
                    582:
                    583: .if ${MKMAN} == "no"
1.341     lukem     584: MKCATPAGES:=   no
1.340     lukem     585: MKHTML:=       no
1.116     lukem     586: .endif
                    587:
1.117     lukem     588: .if ${MKLINKLIB} == "no"
1.507     lukem     589: MKLINT:=       no
1.230     tv        590: MKPICINSTALL:= no
                    591: MKPROFILE:=    no
1.327     thorpej   592: .endif
                    593:
                    594: .if ${MKPIC} == "no"
                    595: MKPICLIB:=     no
1.116     lukem     596: .endif
                    597:
1.230     tv        598: .if ${MKOBJ} == "no"
                    599: MKOBJDIRS:=    no
1.116     lukem     600: .endif
                    601:
1.117     lukem     602: .if ${MKSHARE} == "no"
1.230     tv        603: MKCATPAGES:=   no
                    604: MKDOC:=                no
                    605: MKINFO:=       no
1.341     lukem     606: MKHTML:=       no
1.230     tv        607: MKMAN:=                no
                    608: MKNLS:=                no
1.116     lukem     609: .endif
1.276     thorpej   610:
1.341     lukem     611: #
                    612: # install(1) parameters.
                    613: #
                    614: COPY?=         -c
                    615: .if ${MKUPDATE} == "no"
                    616: PRESERVE?=
                    617: .else
                    618: PRESERVE?=     -p
                    619: .endif
                    620: RENAME?=       -r
                    621: HRDLINK?=      -l h
1.444     christos  622: SYMLINK?=      -l s
1.341     lukem     623:
                    624: METALOG?=      ${DESTDIR}/METALOG
                    625: METALOG.add?=  ${TOOL_CAT} -l >> ${METALOG}
                    626: .if (${_SRC_TOP_} != "")       # only set INSTPRIV if inside ${NETBSDSRCDIR}
                    627: .if ${MKUNPRIVED} != "no"
1.409     lukem     628: INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha1
1.341     lukem     629: .else
                    630: INSTPRIV.unpriv=
                    631: .endif
                    632: INSTPRIV?=     ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
                    633: .endif
1.410     lukem     634: STRIPFLAG?=
1.341     lukem     635:
1.406     lukem     636: .if ${NEED_OWN_INSTALL_TARGET} != "no"
1.341     lukem     637: INSTALL_DIR?=          ${INSTALL} ${INSTPRIV} -d
                    638: INSTALL_FILE?=         ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
                    639: INSTALL_LINK?=         ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
                    640: INSTALL_SYMLINK?=      ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
                    641: HOST_INSTALL_FILE?=    ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
1.440     dyoung    642: HOST_INSTALL_DIR?=     ${INSTALL} -d
                    643: HOST_INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} ${RENAME}
1.341     lukem     644: .endif
                    645:
                    646: #
1.351     lukem     647: # Set defaults for the USE_xxx variables.
                    648: #
                    649:
                    650: #
1.433     lukem     651: # USE_* options which default to "no" and will be forced to "no" if their
                    652: # corresponding MK* variable is set to "no".
                    653: #
1.505     lukem     654: .for var in USE_SKEY
                    655: .if (${${var:S/USE_/MK/}} == "no")
                    656: ${var}:= no
                    657: .else
                    658: ${var}?= no
                    659: .endif
                    660: .endfor
1.433     lukem     661:
                    662: #
1.351     lukem     663: # USE_* options which default to "yes" unless their corresponding MK*
                    664: # variable is set to "no".
1.341     lukem     665: #
1.505     lukem     666: .for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_PAM USE_YP
1.504     lukem     667: .if (${${var:S/USE_/MK/}} == "no")
                    668: ${var}:= no
1.276     thorpej   669: .else
1.504     lukem     670: ${var}?= yes
1.276     thorpej   671: .endif
1.351     lukem     672: .endfor
                    673:
                    674: #
                    675: # USE_* options which default to "yes".
                    676: #
1.504     lukem     677: .for var in USE_JEMALLOC
                    678: ${var}?= yes
1.497     ad        679: .endfor
1.300     tron      680:
1.341     lukem     681: #
1.445     jmc       682: # USE_* options which default to "no".
                    683: #
1.480     mrg       684: #.for var in
1.504     lukem     685: #${var}?= no
1.480     mrg       686: #.endfor
1.357     lukem     687:
                    688: #
1.422     lukem     689: # Where X11R6 sources are and where it is installed to.
1.357     lukem     690: #
                    691: X11SRCDIR?=            /usr/xsrc
                    692: X11SRCDIR.xc?=         ${X11SRCDIR}/xfree/xc
                    693: X11SRCDIR.local?=      ${X11SRCDIR}/local
                    694: X11ROOTDIR?=           /usr/X11R6
                    695: X11BINDIR?=            ${X11ROOTDIR}/bin
1.417     lukem     696: X11ETCDIR?=            /etc/X11
1.357     lukem     697: X11FONTDIR?=           ${X11ROOTDIR}/lib/X11/fonts
                    698: X11INCDIR?=            ${X11ROOTDIR}/include
                    699: X11LIBDIR?=            ${X11ROOTDIR}/lib/X11
                    700: X11MANDIR?=            ${X11ROOTDIR}/man
                    701: X11USRLIBDIR?=         ${X11ROOTDIR}/lib
1.417     lukem     702:
1.412     rtr       703: X11DRI?=               no
1.415     rtr       704: X11LOADABLE?=          yes
1.374     lukem     705:
                    706:
                    707: #
1.414     lukem     708: # MAKEDIRTARGET dir target [extra make(1) params]
                    709: #      run "cd $${dir} && ${MAKE} [params] $${target}", with a pretty message
                    710: #
                    711: MAKEDIRTARGET=\
                    712:        @_makedirtarget() { \
                    713:                dir="$$1"; shift; \
                    714:                target="$$1"; shift; \
                    715:                case "$${dir}" in \
                    716:                /*)     this="$${dir}/"; \
                    717:                        real="$${dir}" ;; \
                    718:                .)      this="${_THISDIR_}"; \
                    719:                        real="${.CURDIR}" ;; \
                    720:                *)      this="${_THISDIR_}$${dir}/"; \
                    721:                        real="${.CURDIR}/$${dir}" ;; \
                    722:                esac; \
                    723:                show=$${this:-.}; \
                    724:                echo "$${target} ===> $${show%/}$${1:+  (with: $$@)}"; \
                    725:                cd "$${real}" \
                    726:                && ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
                    727:        }; \
                    728:        _makedirtarget
                    729:
                    730: #
1.374     lukem     731: # MAKEVERBOSE support.  Levels are:
1.380     lukem     732: #      0       No messages
                    733: #      1       Enable info messages, suppress command output
                    734: #      2       Enable info messages and command output
1.374     lukem     735: #
                    736: MAKEVERBOSE?=          2
                    737:
                    738: .if ${MAKEVERBOSE} == 0
                    739: _MKMSG?=       @\#
                    740: _MKSHMSG?=     : echo
                    741: _MKSHECHO?=    : echo
1.380     lukem     742: .SILENT:
1.374     lukem     743: .elif ${MAKEVERBOSE} == 1
                    744: _MKMSG?=       @echo '   '
                    745: _MKSHMSG?=     echo '   '
                    746: _MKSHECHO?=    : echo
1.380     lukem     747: .SILENT:
1.374     lukem     748: .else  # MAKEVERBOSE == 2 ?
                    749: _MKMSG?=       @echo '\#  '
                    750: _MKSHMSG?=     echo '\#  '
                    751: _MKSHECHO?=    echo
1.380     lukem     752: .SILENT: __makeverbose_dummy_target__
1.374     lukem     753: .endif
                    754:
                    755: _MKMSG_BUILD?=         ${_MKMSG} "  build "
                    756: _MKMSG_CREATE?=                ${_MKMSG} " create "
                    757: _MKMSG_COMPILE?=       ${_MKMSG} "compile "
                    758: _MKMSG_FORMAT?=                ${_MKMSG} " format "
                    759: _MKMSG_INSTALL?=       ${_MKMSG} "install "
                    760: _MKMSG_LINK?=          ${_MKMSG} "   link "
                    761: _MKMSG_LEX?=           ${_MKMSG} "    lex "
                    762: _MKMSG_REMOVE?=                ${_MKMSG} " remove "
                    763: _MKMSG_YACC?=          ${_MKMSG} "   yacc "
1.391     lukem     764:
                    765: _MKSHMSG_CREATE?=      ${_MKSHMSG} " create "
                    766: _MKSHMSG_INSTALL?=     ${_MKSHMSG} "install "
1.374     lukem     767:
1.394     lukem     768: _MKTARGET_BUILD?=      ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
                    769: _MKTARGET_CREATE?=     ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
                    770: _MKTARGET_COMPILE?=    ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
                    771: _MKTARGET_FORMAT?=     ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
                    772: _MKTARGET_INSTALL?=    ${_MKMSG_INSTALL} ${.TARGET}
                    773: _MKTARGET_LINK?=       ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
                    774: _MKTARGET_LEX?=                ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
                    775: _MKTARGET_REMOVE?=     ${_MKMSG_REMOVE} ${.TARGET}
                    776: _MKTARGET_YACC?=       ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
1.64      lukem     777:
1.347     lukem     778: .endif # !defined(_BSD_OWN_MK_)

CVSweb <webmaster@jp.NetBSD.org>