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