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