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