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