Mon Dec 14 06:35:02 2009 UTC ()
pullup from -current:
>revision 1.612
>date: 2009/12/13 09:10:16;  author: mrg;  state: Exp;  lines: +4 -3
>enable MAKEDIRTARGET to be called with a separate environment,
>called $MAKEDIRTARGETENV, defaulting to nothing.
>----------------------------
>revision 1.611
>date: 2009/12/13 09:01:46;  author: mrg;  state: Exp;  lines: +6 -1
>if BSD_MK_COMPAT_FILE is defined, .include it.


(mrg)
diff -r1.542.2.9.4.3 -r1.542.2.9.4.4 src/share/mk/bsd.own.mk

cvs diff -r1.542.2.9.4.3 -r1.542.2.9.4.4 src/share/mk/bsd.own.mk (switch to unified diff)

--- src/share/mk/bsd.own.mk 2009/09/13 22:24:40 1.542.2.9.4.3
+++ src/share/mk/bsd.own.mk 2009/12/14 06:35:01 1.542.2.9.4.4
@@ -1,964 +1,970 @@ @@ -1,964 +1,970 @@
1# $NetBSD: bsd.own.mk,v 1.542.2.9.4.3 2009/09/13 22:24:40 matt Exp $ 1# $NetBSD: bsd.own.mk,v 1.542.2.9.4.4 2009/12/14 06:35:01 mrg Exp $
 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
2 7
3.if !defined(_BSD_OWN_MK_) 8.if !defined(_BSD_OWN_MK_)
4_BSD_OWN_MK_=1 9_BSD_OWN_MK_=1
5 10
6MAKECONF?= /etc/mk.conf 11MAKECONF?= /etc/mk.conf
7.-include "${MAKECONF}" 12.-include "${MAKECONF}"
8 13
9# 14#
10# CPU model, derived from MACHINE_ARCH 15# CPU model, derived from MACHINE_ARCH
11# 16#
12MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/} 17MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/}
13 18
14# 19#
15# Subdirectory used below ${RELEASEDIR} when building a release 20# Subdirectory used below ${RELEASEDIR} when building a release
16# 21#
17RELEASEMACHINEDIR?= ${MACHINE} 22RELEASEMACHINEDIR?= ${MACHINE}
18 23
19# 24#
20# Subdirectory or path component used for the following paths: 25# Subdirectory or path component used for the following paths:
21# distrib/${RELEASEMACHINE} 26# distrib/${RELEASEMACHINE}
22# distrib/notes/${RELEASEMACHINE} 27# distrib/notes/${RELEASEMACHINE}
23# etc/etc.${RELEASEMACHINE} 28# etc/etc.${RELEASEMACHINE}
24# Used when building a release. 29# Used when building a release.
25# 30#
26RELEASEMACHINE?= ${MACHINE} 31RELEASEMACHINE?= ${MACHINE}
27 32
28# 33#
29# NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to 34# NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
30# ensure that things defined by <bsd.own.mk> (default targets, 35# ensure that things defined by <bsd.own.mk> (default targets,
31# INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk. 36# INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
32# 37#
33NEED_OWN_INSTALL_TARGET?= yes 38NEED_OWN_INSTALL_TARGET?= yes
34 39
35# 40#
36# This lists the platforms which do not have working in-tree toolchains. 41# This lists the platforms which do not have working in-tree toolchains.
37# For the in-tree gcc 3.3.2 toolchain, this list is empty. 42# For the in-tree gcc 3.3.2 toolchain, this list is empty.
38# If some future port is not supported by the in-tree toolchain, this 43# If some future port is not supported by the in-tree toolchain, this
39# should be set to "yes" for that port only. 44# should be set to "yes" for that port only.
40# 45#
41TOOLCHAIN_MISSING?= no 46TOOLCHAIN_MISSING?= no
42 47
43# default to GCC4 48# default to GCC4
44.if !defined(HAVE_GCC) && !defined(HAVE_PCC) 49.if !defined(HAVE_GCC) && !defined(HAVE_PCC)
45HAVE_GCC= 4 50HAVE_GCC= 4
46.endif 51.endif
47 52
48# default to GDB6 53# default to GDB6
49HAVE_GDB?= 6 54HAVE_GDB?= 6
50 55
51CPPFLAG_ISYSTEM= -isystem 56CPPFLAG_ISYSTEM= -isystem
52.if defined(HAVE_GCC) 57.if defined(HAVE_GCC)
53.if ${HAVE_GCC} == 3 58.if ${HAVE_GCC} == 3
54CPPFLAG_ISYSTEMXX= -isystem-cxx 59CPPFLAG_ISYSTEMXX= -isystem-cxx
55.else # GCC 4 60.else # GCC 4
56CPPFLAG_ISYSTEMXX= -cxx-isystem 61CPPFLAG_ISYSTEMXX= -cxx-isystem
57.endif 62.endif
58.endif 63.endif
59 64
60.if empty(.MAKEFLAGS:M-V*) 65.if empty(.MAKEFLAGS:M-V*)
61.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR) 66.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
62PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx 67PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx
63.else 68.else
64PRINTOBJDIR= ${MAKE} -V .OBJDIR 69PRINTOBJDIR= ${MAKE} -V .OBJDIR
65.endif 70.endif
66.else 71.else
67PRINTOBJDIR= echo # prevent infinite recursion 72PRINTOBJDIR= echo # prevent infinite recursion
68.endif 73.endif
69 74
70# 75#
71# Determine if running in the NetBSD source tree by checking for the 76# Determine if running in the NetBSD source tree by checking for the
72# existence of build.sh and tools/ in the current or a parent directory, 77# existence of build.sh and tools/ in the current or a parent directory,
73# and setting _SRC_TOP_ to the result. 78# and setting _SRC_TOP_ to the result.
74# 79#
75.if !defined(_SRC_TOP_) # { 80.if !defined(_SRC_TOP_) # {
76_SRC_TOP_!= cd ${.CURDIR}; while :; do \ 81_SRC_TOP_!= cd ${.CURDIR}; while :; do \
77 here=`pwd`; \ 82 here=`pwd`; \
78 [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \ 83 [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
79 case $$here in /) echo ""; break;; esac; \ 84 case $$here in /) echo ""; break;; esac; \
80 cd ..; done 85 cd ..; done
81 86
82.MAKEOVERRIDES+= _SRC_TOP_ 87.MAKEOVERRIDES+= _SRC_TOP_
83 88
84.endif # } 89.endif # }
85 90
86# 91#
87# If _SRC_TOP_ != "", we're within the NetBSD source tree, so set 92# If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
88# defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_. 93# defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
89# 94#
90.if (${_SRC_TOP_} != "") # { 95.if (${_SRC_TOP_} != "") # {
91 96
92NETBSDSRCDIR?= ${_SRC_TOP_} 97NETBSDSRCDIR?= ${_SRC_TOP_}
93 98
94.if !defined(_SRC_TOP_OBJ_) 99.if !defined(_SRC_TOP_OBJ_)
95_SRC_TOP_OBJ_!= cd ${_SRC_TOP_} && ${PRINTOBJDIR} 100_SRC_TOP_OBJ_!= cd ${_SRC_TOP_} && ${PRINTOBJDIR}
96.MAKEOVERRIDES+= _SRC_TOP_OBJ_ 101.MAKEOVERRIDES+= _SRC_TOP_OBJ_
97.endif 102.endif
98 103
99.endif # _SRC_TOP_ != "" # } 104.endif # _SRC_TOP_ != "" # }
100 105
101 106
102.if (${_SRC_TOP_} != "") && \ 107.if (${_SRC_TOP_} != "") && \
103 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) 108 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
104USETOOLS?= yes 109USETOOLS?= yes
105.endif 110.endif
106USETOOLS?= no 111USETOOLS?= no
107 112
108 113
109.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \ 114.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
110 ${MACHINE_ARCH} == "sh3" 115 ${MACHINE_ARCH} == "sh3"
111.BEGIN: 116.BEGIN:
112 @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el" 117 @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
113 @false 118 @false
114.elif defined(REQUIRETOOLS) && \ 119.elif defined(REQUIRETOOLS) && \
115 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \ 120 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
116 ${USETOOLS} == "no" 121 ${USETOOLS} == "no"
117.BEGIN: 122.BEGIN:
118 @echo "USETOOLS=no, but this component requires a version-specific host toolchain" 123 @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
119 @false 124 @false
120.endif 125.endif
121 126
122# 127#
123# Host platform information; may be overridden 128# Host platform information; may be overridden
124# 129#
125.if !defined(HOST_OSTYPE) 130.if !defined(HOST_OSTYPE)
126_HOST_OSNAME!= uname -s 131_HOST_OSNAME!= uname -s
127_HOST_OSREL!= uname -r 132_HOST_OSREL!= uname -r
128# For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints 133# For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints
129# something that does not look like an identifier, then use uname -m. 134# something that does not look like an identifier, then use uname -m.
130_HOST_ARCH!= uname -p 2>/dev/null 135_HOST_ARCH!= uname -p 2>/dev/null
131_HOST_ARCH:= ${HOST_ARCH:tW:C/.*[^-_A-Za-z0-9].*//:S/unknown//} 136_HOST_ARCH:= ${HOST_ARCH:tW:C/.*[^-_A-Za-z0-9].*//:S/unknown//}
132.if empty(_HOST_ARCH) 137.if empty(_HOST_ARCH)
133_HOST_ARCH!= uname -m 138_HOST_ARCH!= uname -m
134.endif 139.endif
135HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g} 140HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g}
136.MAKEOVERRIDES+= HOST_OSTYPE 141.MAKEOVERRIDES+= HOST_OSTYPE
137.endif # !defined(HOST_OSTYPE) 142.endif # !defined(HOST_OSTYPE)
138 143
139.if ${USETOOLS} == "yes" # { 144.if ${USETOOLS} == "yes" # {
140 145
141# 146#
142# Provide a default for TOOLDIR. 147# Provide a default for TOOLDIR.
143# 148#
144.if !defined(TOOLDIR) 149.if !defined(TOOLDIR)
145TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE} 150TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
146.MAKEOVERRIDES+= TOOLDIR 151.MAKEOVERRIDES+= TOOLDIR
147.endif 152.endif
148 153
149# 154#
150# This is the prefix used for the NetBSD-sourced tools. 155# This is the prefix used for the NetBSD-sourced tools.
151# 156#
152_TOOL_PREFIX?= nb 157_TOOL_PREFIX?= nb
153 158
154# 159#
155# If an external toolchain base is specified, use it. 160# If an external toolchain base is specified, use it.
156# 161#
157.if defined(EXTERNAL_TOOLCHAIN) # { 162.if defined(EXTERNAL_TOOLCHAIN) # {
158AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar 163AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
159AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as 164AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
160LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld 165LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
161NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm 166NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
162OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy 167OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
163OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump 168OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
164RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib 169RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
165SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size 170SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
166STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip 171STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
167 172
168CC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc 173CC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
169CPP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp 174CPP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
170CXX= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++ 175CXX= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
171FC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77 176FC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
172OBJC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc 177OBJC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
173.else # } { 178.else # } {
174# Define default locations for common tools. 179# Define default locations for common tools.
175.if ${USETOOLS_BINUTILS:Uyes} == "yes" # { 180.if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
176AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar 181AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
177AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as 182AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
178LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld 183LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
179NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm 184NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
180OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy 185OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
181OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump 186OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
182RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib 187RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
183SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size 188SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
184STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip 189STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
185.endif # } 190.endif # }
186 191
187.if defined(HAVE_GCC) && ${USETOOLS_GCC:Uyes} == "yes" # { 192.if defined(HAVE_GCC) && ${USETOOLS_GCC:Uyes} == "yes" # {
188CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc 193CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
189CPP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp 194CPP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
190CXX= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++ 195CXX= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
191FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77 196FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
192OBJC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc 197OBJC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
193.endif # } 198.endif # }
194 199
195.if defined(HAVE_PCC) && ${USETOOLS_PCC:Uyes} == "yes" 200.if defined(HAVE_PCC) && ${USETOOLS_PCC:Uyes} == "yes"
196CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc 201CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
197CPP= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-cpp 202CPP= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-cpp
198CXX= false 203CXX= false
199FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-f77 204FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-f77
200OBJC= false 205OBJC= false
201.endif 206.endif
202 207
203.endif # EXTERNAL_TOOLCHAIN # } 208.endif # EXTERNAL_TOOLCHAIN # }
204 209
205HOST_MKDEP= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep 210HOST_MKDEP= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
206 211
207DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym 212DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
208ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff 213ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
209INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install 214INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
210LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex 215LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
211LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint 216LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
212LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder 217LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
213MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep 218MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
214PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl 219PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
215TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q 220TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
216YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc 221YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
217 222
218TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb 223TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
219TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb 224TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
220TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt 225TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
221TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile 226TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
222TOOL_ATF_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}atf-compile 227TOOL_ATF_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}atf-compile
223TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk 228TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk
224TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb 229TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
225TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat 230TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
226TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum 231TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
227TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et 232TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
228TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config 233TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
229TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen 234TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
230TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags 235TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
231TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db 236TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
232TOOL_DISKLABEL= ${TOOLDIR}/bin/nbdisklabel-${MAKEWRAPPERMACHINE} 237TOOL_DISKLABEL= ${TOOLDIR}/bin/nbdisklabel-${MAKEWRAPPERMACHINE}
233TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn 238TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
234TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk 239TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
235TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen 240TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
236TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym 241TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
237TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat 242TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
238TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake 243TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
239TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff 244TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
240TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump 245TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
241TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot 246TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
242TOOL_HP700MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp700-mkboot 247TOOL_HP700MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp700-mkboot
243TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib 248TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
244TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot 249TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
245TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info 250TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
246TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join 251TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join
247TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4 252TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
248TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff 253TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
249TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs 254TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
250TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo 255TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
251TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis 256TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
252TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage 257TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
253TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc 258TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
254TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff 259TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
255TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper 260TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
256TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb 261TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
257TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale 262TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
258TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file 263TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
259TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp 264TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
260TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc 265TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
261TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree 266TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
262TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax 267TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
263TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic 268TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
264TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage 269TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
265TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb 270TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
266TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer 271TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
267TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff 272TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
268TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi 273TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
269TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html 274TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
270TOOL_ROFF_PS= ${TOOL_GROFF} -Tps 275TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
271TOOL_ROFF_RAW= ${TOOL_GROFF} -Z 276TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
272TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen 277TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
273TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed 278TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
274TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim 279TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
275TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc 280TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
276TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat 281TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
277TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile 282TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile
278TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel 283TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
279TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl 284TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
280TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode 285TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
281TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f 286TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
282TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic 287TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
283 288
284.else # USETOOLS != yes # } { 289.else # USETOOLS != yes # } {
285 290
286TOOL_AMIGAAOUT2BB= amiga-aout2bb 291TOOL_AMIGAAOUT2BB= amiga-aout2bb
287TOOL_AMIGAELF2BB= amiga-elf2bb 292TOOL_AMIGAELF2BB= amiga-elf2bb
288TOOL_AMIGATXLT= amiga-txlt 293TOOL_AMIGATXLT= amiga-txlt
289TOOL_ASN1_COMPILE= asn1_compile 294TOOL_ASN1_COMPILE= asn1_compile
290TOOL_ATF_COMPILE= atf-compile 295TOOL_ATF_COMPILE= atf-compile
291TOOL_AWK= awk 296TOOL_AWK= awk
292TOOL_CAP_MKDB= cap_mkdb 297TOOL_CAP_MKDB= cap_mkdb
293TOOL_CAT= cat 298TOOL_CAT= cat
294TOOL_CKSUM= cksum 299TOOL_CKSUM= cksum
295TOOL_COMPILE_ET= compile_et 300TOOL_COMPILE_ET= compile_et
296TOOL_CONFIG= config 301TOOL_CONFIG= config
297TOOL_CRUNCHGEN= crunchgen 302TOOL_CRUNCHGEN= crunchgen
298TOOL_CTAGS= ctags 303TOOL_CTAGS= ctags
299TOOL_DB= db 304TOOL_DB= db
300TOOL_DISKLABEL= disklabel 305TOOL_DISKLABEL= disklabel
301TOOL_EQN= eqn 306TOOL_EQN= eqn
302TOOL_FDISK= fdisk 307TOOL_FDISK= fdisk
303TOOL_FGEN= fgen 308TOOL_FGEN= fgen
304TOOL_GENASSYM= genassym 309TOOL_GENASSYM= genassym
305TOOL_GENCAT= gencat 310TOOL_GENCAT= gencat
306TOOL_GMAKE= gmake 311TOOL_GMAKE= gmake
307TOOL_GROFF= groff 312TOOL_GROFF= groff
308TOOL_HEXDUMP= hexdump 313TOOL_HEXDUMP= hexdump
309TOOL_HP300MKBOOT= hp300-mkboot 314TOOL_HP300MKBOOT= hp300-mkboot
310TOOL_HP700MKBOOT= hp700-mkboot 315TOOL_HP700MKBOOT= hp700-mkboot
311TOOL_INDXBIB= indxbib 316TOOL_INDXBIB= indxbib
312TOOL_INSTALLBOOT= installboot 317TOOL_INSTALLBOOT= installboot
313TOOL_INSTALL_INFO= install-info 318TOOL_INSTALL_INFO= install-info
314TOOL_JOIN= join 319TOOL_JOIN= join
315TOOL_M4= m4 320TOOL_M4= m4
316TOOL_MACPPCFIXCOFF= macppc-fixcoff 321TOOL_MACPPCFIXCOFF= macppc-fixcoff
317TOOL_MAKEFS= makefs 322TOOL_MAKEFS= makefs
318TOOL_MAKEINFO= makeinfo 323TOOL_MAKEINFO= makeinfo
319TOOL_MAKEWHATIS= /usr/libexec/makewhatis 324TOOL_MAKEWHATIS= /usr/libexec/makewhatis
320TOOL_MDSETIMAGE= mdsetimage 325TOOL_MDSETIMAGE= mdsetimage
321TOOL_MENUC= menuc 326TOOL_MENUC= menuc
322TOOL_MIPSELF2ECOFF= mips-elf2ecoff 327TOOL_MIPSELF2ECOFF= mips-elf2ecoff
323TOOL_MKCSMAPPER= mkcsmapper 328TOOL_MKCSMAPPER= mkcsmapper
324TOOL_MKESDB= mkesdb 329TOOL_MKESDB= mkesdb
325TOOL_MKLOCALE= mklocale 330TOOL_MKLOCALE= mklocale
326TOOL_MKMAGIC= file 331TOOL_MKMAGIC= file
327TOOL_MKTEMP= mktemp 332TOOL_MKTEMP= mktemp
328TOOL_MSGC= msgc 333TOOL_MSGC= msgc
329TOOL_MTREE= mtree 334TOOL_MTREE= mtree
330TOOL_PAX= pax 335TOOL_PAX= pax
331TOOL_PIC= pic 336TOOL_PIC= pic
332TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage 337TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage
333TOOL_PWD_MKDB= pwd_mkdb 338TOOL_PWD_MKDB= pwd_mkdb
334TOOL_REFER= refer 339TOOL_REFER= refer
335TOOL_ROFF_ASCII= nroff 340TOOL_ROFF_ASCII= nroff
336TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi 341TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
337TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html 342TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
338TOOL_ROFF_PS= ${TOOL_GROFF} -Tps 343TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
339TOOL_ROFF_RAW= ${TOOL_GROFF} -Z 344TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
340TOOL_RPCGEN= rpcgen 345TOOL_RPCGEN= rpcgen
341TOOL_SED= sed 346TOOL_SED= sed
342TOOL_SOELIM= soelim 347TOOL_SOELIM= soelim
343TOOL_SPARKCRC= sparkcrc 348TOOL_SPARKCRC= sparkcrc
344TOOL_STAT= stat 349TOOL_STAT= stat
345TOOL_STRFILE= strfile 350TOOL_STRFILE= strfile
346TOOL_SUNLABEL= sunlabel 351TOOL_SUNLABEL= sunlabel
347TOOL_TBL= tbl 352TOOL_TBL= tbl
348TOOL_UUDECODE= uudecode 353TOOL_UUDECODE= uudecode
349TOOL_VGRIND= vgrind -f 354TOOL_VGRIND= vgrind -f
350TOOL_ZIC= zic 355TOOL_ZIC= zic
351 356
352.endif # USETOOLS != yes # } 357.endif # USETOOLS != yes # }
353 358
354# 359#
355# Targets to check if DESTDIR or RELEASEDIR is provided 360# Targets to check if DESTDIR or RELEASEDIR is provided
356# 361#
357.if !target(check_DESTDIR) 362.if !target(check_DESTDIR)
358check_DESTDIR: .PHONY .NOTMAIN 363check_DESTDIR: .PHONY .NOTMAIN
359.if !defined(DESTDIR) 364.if !defined(DESTDIR)
360 @echo "setenv DESTDIR before doing that!" 365 @echo "setenv DESTDIR before doing that!"
361 @false 366 @false
362.else 367.else
363 @true 368 @true
364.endif 369.endif
365.endif 370.endif
366 371
367.if !target(check_RELEASEDIR) 372.if !target(check_RELEASEDIR)
368check_RELEASEDIR: .PHONY .NOTMAIN 373check_RELEASEDIR: .PHONY .NOTMAIN
369.if !defined(RELEASEDIR) 374.if !defined(RELEASEDIR)
370 @echo "setenv RELEASEDIR before doing that!" 375 @echo "setenv RELEASEDIR before doing that!"
371 @false 376 @false
372.else 377.else
373 @true 378 @true
374.endif 379.endif
375.endif 380.endif
376 381
377 382
378.if ${USETOOLS} == "yes" # { 383.if ${USETOOLS} == "yes" # {
379# 384#
380# Make sure DESTDIR is set, so that builds with these tools always 385# Make sure DESTDIR is set, so that builds with these tools always
381# get appropriate -nostdinc, -nostdlib, etc. handling. The default is 386# get appropriate -nostdinc, -nostdlib, etc. handling. The default is
382# <empty string>, meaning start from /, the root directory. 387# <empty string>, meaning start from /, the root directory.
383# 388#
384DESTDIR?= 389DESTDIR?=
385.endif # } 390.endif # }
386 391
387# 392#
388# Build a dynamically linked /bin and /sbin, with the necessary shared 393# Build a dynamically linked /bin and /sbin, with the necessary shared
389# libraries moved from /usr/lib to /lib and the shared linker moved 394# libraries moved from /usr/lib to /lib and the shared linker moved
390# from /usr/libexec to /lib 395# from /usr/libexec to /lib
391# 396#
392# Note that if the BINDIR is not /bin or /sbin, then we always use the 397# Note that if the BINDIR is not /bin or /sbin, then we always use the
393# non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin 398# non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
394# and /sbin). See <bsd.shlib.mk>. 399# and /sbin). See <bsd.shlib.mk>.
395# 400#
396MKDYNAMICROOT?= yes 401MKDYNAMICROOT?= yes
397 402
398# 403#
399# Where the system object and source trees are kept; can be configurable 404# Where the system object and source trees are kept; can be configurable
400# by the user in case they want them in ~/foosrc and ~/fooobj (for example). 405# by the user in case they want them in ~/foosrc and ~/fooobj (for example).
401# 406#
402BSDSRCDIR?= /usr/src 407BSDSRCDIR?= /usr/src
403BSDOBJDIR?= /usr/obj 408BSDOBJDIR?= /usr/obj
404NETBSDSRCDIR?= ${BSDSRCDIR} 409NETBSDSRCDIR?= ${BSDSRCDIR}
405 410
406BINGRP?= wheel 411BINGRP?= wheel
407BINOWN?= root 412BINOWN?= root
408BINMODE?= 555 413BINMODE?= 555
409NONBINMODE?= 444 414NONBINMODE?= 444
410 415
411MANDIR?= /usr/share/man 416MANDIR?= /usr/share/man
412MANGRP?= wheel 417MANGRP?= wheel
413MANOWN?= root 418MANOWN?= root
414MANMODE?= ${NONBINMODE} 419MANMODE?= ${NONBINMODE}
415MANINSTALL?= catinstall htmlinstall maninstall 420MANINSTALL?= catinstall htmlinstall maninstall
416 421
417INFODIR?= /usr/share/info 422INFODIR?= /usr/share/info
418INFOGRP?= wheel 423INFOGRP?= wheel
419INFOOWN?= root 424INFOOWN?= root
420INFOMODE?= ${NONBINMODE} 425INFOMODE?= ${NONBINMODE}
421 426
422LIBDIR?= /usr/lib 427LIBDIR?= /usr/lib
423 428
424LINTLIBDIR?= /usr/libdata/lint 429LINTLIBDIR?= /usr/libdata/lint
425LIBGRP?= ${BINGRP} 430LIBGRP?= ${BINGRP}
426LIBOWN?= ${BINOWN} 431LIBOWN?= ${BINOWN}
427LIBMODE?= ${NONBINMODE} 432LIBMODE?= ${NONBINMODE}
428 433
429DOCDIR?= /usr/share/doc 434DOCDIR?= /usr/share/doc
430HTMLDOCDIR?= /usr/share/doc/html 435HTMLDOCDIR?= /usr/share/doc/html
431DOCGRP?= wheel 436DOCGRP?= wheel
432DOCOWN?= root 437DOCOWN?= root
433DOCMODE?= ${NONBINMODE} 438DOCMODE?= ${NONBINMODE}
434 439
435NLSDIR?= /usr/share/nls 440NLSDIR?= /usr/share/nls
436NLSGRP?= wheel 441NLSGRP?= wheel
437NLSOWN?= root 442NLSOWN?= root
438NLSMODE?= ${NONBINMODE} 443NLSMODE?= ${NONBINMODE}
439 444
440KMODDIR?= /usr/lkm 445KMODDIR?= /usr/lkm
441KMODGRP?= wheel 446KMODGRP?= wheel
442KMODOWN?= root 447KMODOWN?= root
443KMODMODE?= ${NONBINMODE} 448KMODMODE?= ${NONBINMODE}
444 449
445KMODULEGRP?= wheel 450KMODULEGRP?= wheel
446KMODULEOWN?= root 451KMODULEOWN?= root
447KMODULEMODE?= ${NONBINMODE} 452KMODULEMODE?= ${NONBINMODE}
448 453
449LOCALEDIR?= /usr/share/locale 454LOCALEDIR?= /usr/share/locale
450LOCALEGRP?= wheel 455LOCALEGRP?= wheel
451LOCALEOWN?= root 456LOCALEOWN?= root
452LOCALEMODE?= ${NONBINMODE} 457LOCALEMODE?= ${NONBINMODE}
453 458
454FIRMWAREDIR?= /libdata/firmware 459FIRMWAREDIR?= /libdata/firmware
455FIRMWAREGRP?= wheel 460FIRMWAREGRP?= wheel
456FIRMWAREOWN?= root 461FIRMWAREOWN?= root
457FIRMWAREMODE?= ${NONBINMODE} 462FIRMWAREMODE?= ${NONBINMODE}
458 463
459DEBUGDIR?= /usr/libdata/debug 464DEBUGDIR?= /usr/libdata/debug
460DEBUGGRP?= wheel 465DEBUGGRP?= wheel
461DEBUGOWN?= root 466DEBUGOWN?= root
462DEBUGMODE?= ${NONBINMODE} 467DEBUGMODE?= ${NONBINMODE}
463 468
464# 469#
465# Data-driven table using make variables to control how 470# Data-driven table using make variables to control how
466# toolchain-dependent targets and shared libraries are built 471# toolchain-dependent targets and shared libraries are built
467# for different platforms and object formats. 472# for different platforms and object formats.
468# 473#
469# OBJECT_FMT: currently either "ELF" or "a.out". 474# OBJECT_FMT: currently either "ELF" or "a.out".
470# 475#
471# All platforms are ELF. 476# All platforms are ELF.
472# 477#
473OBJECT_FMT= ELF 478OBJECT_FMT= ELF
474 479
475# 480#
476# If this platform's toolchain is missing, we obviously cannot build it. 481# If this platform's toolchain is missing, we obviously cannot build it.
477# 482#
478.if ${TOOLCHAIN_MISSING} != "no" 483.if ${TOOLCHAIN_MISSING} != "no"
479MKBFD:= no 484MKBFD:= no
480MKGDB:= no 485MKGDB:= no
481MKGCC:= no 486MKGCC:= no
482.endif 487.endif
483 488
484# 489#
485# If we are using an external toolchain, we can still build the target's 490# If we are using an external toolchain, we can still build the target's
486# BFD stuff, but we cannot build GCC's support libraries, since those are 491# BFD stuff, but we cannot build GCC's support libraries, since those are
487# tightly-coupled to the version of GCC being used. 492# tightly-coupled to the version of GCC being used.
488# 493#
489.if defined(EXTERNAL_TOOLCHAIN) 494.if defined(EXTERNAL_TOOLCHAIN)
490MKGCC:= no 495MKGCC:= no
491.endif 496.endif
492 497
493# 498#
494# The m68000 port is incomplete. 499# The m68000 port is incomplete.
495# 500#
496.if ${MACHINE_ARCH} == "m68000" 501.if ${MACHINE_ARCH} == "m68000"
497NOPIC= # defined 502NOPIC= # defined
498MKISCSI= no 503MKISCSI= no
499# XXX GCC 4 outputs mcount() calling sequences that try to load values 504# XXX GCC 4 outputs mcount() calling sequences that try to load values
500# from over 64KB away and this fails to assemble. 505# from over 64KB away and this fails to assemble.
501.if defined(HAVE_GCC) && (${HAVE_GCC} == 4) 506.if defined(HAVE_GCC) && (${HAVE_GCC} == 4)
502NOPROFILE= # defined 507NOPROFILE= # defined
503.endif 508.endif
504.endif 509.endif
505 510
506# 511#
507# The ia64 port is incomplete. 512# The ia64 port is incomplete.
508# 513#
509.if ${MACHINE_ARCH} == "ia64" 514.if ${MACHINE_ARCH} == "ia64"
510MKLINT= no 515MKLINT= no
511MKGDB= no 516MKGDB= no
512.endif 517.endif
513 518
514# 519#
515# On the MIPS, all libs are compiled with ABIcalls (and are thus PIC), 520# On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
516# not just shared libraries, so don't build the _pic version. 521# not just shared libraries, so don't build the _pic version.
517# 522#
518.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" 523.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
519# .${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb" 524# .${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
520MKPICLIB:= no 525MKPICLIB:= no
521.endif 526.endif
522 527
523# 528#
524# On VAX using ELF, all objects are PIC, not just shared libraries, 529# On VAX using ELF, all objects are PIC, not just shared libraries,
525# so don't build the _pic version. 530# so don't build the _pic version.
526# 531#
527.if ${MACHINE_ARCH} == "vax" 532.if ${MACHINE_ARCH} == "vax"
528MKPICLIB= no 533MKPICLIB= no
529.endif 534.endif
530 535
531# 536#
532# Location of the file that contains the major and minor numbers of the 537# Location of the file that contains the major and minor numbers of the
533# version of a shared library. If this file exists a shared library 538# version of a shared library. If this file exists a shared library
534# will be built by <bsd.lib.mk>. 539# will be built by <bsd.lib.mk>.
535# 540#
536SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version 541SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
537 542
538# 543#
539# GNU sources and packages sometimes see architecture names differently. 544# GNU sources and packages sometimes see architecture names differently.
540# 545#
541GNU_ARCH.coldfire=m68k 546GNU_ARCH.coldfire=m68k
542GNU_ARCH.m68000=m68010 547GNU_ARCH.m68000=m68010
543GNU_ARCH.sh3eb=sh 548GNU_ARCH.sh3eb=sh
544GNU_ARCH.sh3el=shle 549GNU_ARCH.sh3el=shle
545GNU_ARCH.mips64eb=mips64 550GNU_ARCH.mips64eb=mips64
546MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}} 551MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
547 552
548# 553#
549# In order to identify NetBSD to GNU packages, we sometimes need 554# In order to identify NetBSD to GNU packages, we sometimes need
550# an "elf" tag for historically a.out platforms. 555# an "elf" tag for historically a.out platforms.
551# 556#
552.if ${OBJECT_FMT} == "ELF" && \ 557.if ${OBJECT_FMT} == "ELF" && \
553 (${MACHINE_GNU_ARCH} == "arm" || \ 558 (${MACHINE_GNU_ARCH} == "arm" || \
554 ${MACHINE_GNU_ARCH} == "armeb" || \ 559 ${MACHINE_GNU_ARCH} == "armeb" || \
555 ${MACHINE_ARCH} == "i386" || \ 560 ${MACHINE_ARCH} == "i386" || \
556 ${MACHINE_CPU} == "m68k" || \ 561 ${MACHINE_CPU} == "m68k" || \
557 ${MACHINE_GNU_ARCH} == "sh" || \ 562 ${MACHINE_GNU_ARCH} == "sh" || \
558 ${MACHINE_GNU_ARCH} == "shle" || \ 563 ${MACHINE_GNU_ARCH} == "shle" || \
559 ${MACHINE_ARCH} == "sparc" || \ 564 ${MACHINE_ARCH} == "sparc" || \
560 ${MACHINE_ARCH} == "vax") 565 ${MACHINE_ARCH} == "vax")
561MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf 566MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
562.else 567.else
563MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd 568MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
564.endif 569.endif
565 570
566TARGETS+= all clean cleandir depend dependall includes \ 571TARGETS+= all clean cleandir depend dependall includes \
567 install lint obj regress tags html 572 install lint obj regress tags html
568PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \ 573PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
569 install lint obj regress tags beforedepend afterdepend \ 574 install lint obj regress tags beforedepend afterdepend \
570 beforeinstall afterinstall realinstall realdepend realall \ 575 beforeinstall afterinstall realinstall realdepend realall \
571 html subdir-all subdir-install subdir-depend 576 html subdir-all subdir-install subdir-depend
572.PHONY: ${PHONY_NOTMAIN} 577.PHONY: ${PHONY_NOTMAIN}
573.NOTMAIN: ${PHONY_NOTMAIN} 578.NOTMAIN: ${PHONY_NOTMAIN}
574 579
575.if ${NEED_OWN_INSTALL_TARGET} != "no" 580.if ${NEED_OWN_INSTALL_TARGET} != "no"
576.if !target(install) 581.if !target(install)
577install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall 582install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
578beforeinstall: 583beforeinstall:
579subdir-install: 584subdir-install:
580realinstall: 585realinstall:
581afterinstall: 586afterinstall:
582.endif 587.endif
583all: realall subdir-all 588all: realall subdir-all
584subdir-all: 589subdir-all:
585realall: 590realall:
586depend: realdepend subdir-depend 591depend: realdepend subdir-depend
587subdir-depend: 592subdir-depend:
588realdepend: 593realdepend:
589distclean: cleandir 594distclean: cleandir
590cleandir: clean 595cleandir: clean
591 596
592dependall: .NOTMAIN realdepend .MAKE 597dependall: .NOTMAIN realdepend .MAKE
593 @cd ${.CURDIR}; ${MAKE} realall 598 @cd ${.CURDIR}; ${MAKE} realall
594.endif 599.endif
595 600
596# 601#
597# Define MKxxx variables (which are either yes or no) for users 602# Define MKxxx variables (which are either yes or no) for users
598# to set in /etc/mk.conf and override in the make environment. 603# to set in /etc/mk.conf and override in the make environment.
599# These should be tested with `== "no"' or `!= "no"'. 604# These should be tested with `== "no"' or `!= "no"'.
600# The NOxxx variables should only be set by Makefiles. 605# The NOxxx variables should only be set by Makefiles.
601# 606#
602# Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync 607# Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
603# with changes to the MK* variables here. 608# with changes to the MK* variables here.
604# 609#
605 610
606# 611#
607# Supported NO* options (if defined, MK* will be forced to "no", 612# Supported NO* options (if defined, MK* will be forced to "no",
608# regardless of user's mk.conf setting). 613# regardless of user's mk.conf setting).
609# 614#
610# Source makefiles should set NO*, and not MK*, and must do so before 615# Source makefiles should set NO*, and not MK*, and must do so before
611# including bsd.own.mk. 616# including bsd.own.mk.
612# 617#
613.for var in \ 618.for var in \
614 NOCRYPTO NODOC NOHTML NOINFO NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \ 619 NOCRYPTO NODOC NOHTML NOINFO NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \
615 NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB 620 NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB
616.if defined(${var}) 621.if defined(${var})
617MK${var:S/^NO//}:= no 622MK${var:S/^NO//}:= no
618.endif 623.endif
619.endfor 624.endfor
620 625
621# 626#
622# Older-style variables that enabled behaviour when set. 627# Older-style variables that enabled behaviour when set.
623# 628#
624.for var in MANZ UNPRIVED UPDATE 629.for var in MANZ UNPRIVED UPDATE
625.if defined(${var}) 630.if defined(${var})
626MK${var}:= yes 631MK${var}:= yes
627.endif 632.endif
628.endfor 633.endfor
629 634
630# 635#
631# MK* options which have variable defaults. 636# MK* options which have variable defaults.
632# 637#
633.if ${MACHINE} == "amd64" || ${MACHINE} == "sparc64" || \ 638.if ${MACHINE} == "amd64" || ${MACHINE} == "sparc64" || \
634 ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" 639 ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
635MKCOMPAT?= yes 640MKCOMPAT?= yes
636.else 641.else
637# Don't let this build where it really isn't supported. 642# Don't let this build where it really isn't supported.
638MKCOMPAT:= no 643MKCOMPAT:= no
639.endif 644.endif
640 645
641# 646#
642# MK* options which default to "yes". 647# MK* options which default to "yes".
643# 648#
644.for var in \ 649.for var in \
645 MKATF \ 650 MKATF \
646 MKBFD MKBINUTILS \ 651 MKBFD MKBINUTILS \
647 MKCATPAGES MKCOMPLEX MKCRYPTO MKCVS MKCXX \ 652 MKCATPAGES MKCOMPLEX MKCRYPTO MKCVS MKCXX \
648 MKDOC \ 653 MKDOC \
649 MKGCC MKGCCCMDS MKGDB MKGROFF \ 654 MKGCC MKGCCCMDS MKGDB MKGROFF \
650 MKHESIOD MKHTML \ 655 MKHESIOD MKHTML \
651 MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \ 656 MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
652 MKKERBEROS \ 657 MKKERBEROS \
653 MKLDAP MKLINKLIB MKLINT \ 658 MKLDAP MKLINKLIB MKLINT \
654 MKMAN \ 659 MKMAN \
655 MKNLS \ 660 MKNLS \
656 MKOBJ \ 661 MKOBJ \
657 MKPAM \ 662 MKPAM \
658 MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \ 663 MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
659 MKSHARE MKSKEY MKSTATICLIB \ 664 MKSHARE MKSKEY MKSTATICLIB \
660 MKYP 665 MKYP
661${var}?= yes 666${var}?= yes
662.endfor 667.endfor
663 668
664# 669#
665# MK* options which default to "no". 670# MK* options which default to "no".
666# 671#
667.for var in \ 672.for var in \
668 MKCRYPTO_IDEA MKCRYPTO_MDC2 MKCRYPTO_RC5 MKDEBUG MKDEBUGLIB \ 673 MKCRYPTO_IDEA MKCRYPTO_MDC2 MKCRYPTO_RC5 MKDEBUG MKDEBUGLIB \
669 MKMANZ MKMODULAR MKOBJDIRS \ 674 MKMANZ MKMODULAR MKOBJDIRS \
670 MKPCC MKPCCCMDS \ 675 MKPCC MKPCCCMDS \
671 MKSOFTFLOAT MKSTRIPIDENT \ 676 MKSOFTFLOAT MKSTRIPIDENT \
672 MKUNPRIVED MKUPDATE MKX11 677 MKUNPRIVED MKUPDATE MKX11
673${var}?=no 678${var}?=no
674.endfor 679.endfor
675 680
676# 681#
677# Do we default to XFree86 or Xorg for this platform? 682# Do we default to XFree86 or Xorg for this platform?
678# 683#
679.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" || \ 684.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" || \
680 ${MACHINE} == "macppc" || ${MACHINE} == "sgimips" || \ 685 ${MACHINE} == "macppc" || ${MACHINE} == "sgimips" || \
681 ${MACHINE} == "shark" || ${MACHINE} == "sparc64" 686 ${MACHINE} == "shark" || ${MACHINE} == "sparc64"
682X11FLAVOUR?= Xorg 687X11FLAVOUR?= Xorg
683.else 688.else
684X11FLAVOUR?= XFree86 689X11FLAVOUR?= XFree86
685.endif 690.endif
686 691
687# 692#
688# Force some options off if their dependencies are off. 693# Force some options off if their dependencies are off.
689# 694#
690 695
691.if ${MKCXX} == "no" 696.if ${MKCXX} == "no"
692MKATF:= no 697MKATF:= no
693MKGROFF:= no 698MKGROFF:= no
694.endif 699.endif
695 700
696.if ${MKCRYPTO} == "no" 701.if ${MKCRYPTO} == "no"
697MKKERBEROS:= no 702MKKERBEROS:= no
698.endif 703.endif
699 704
700.if ${MKMAN} == "no" 705.if ${MKMAN} == "no"
701MKCATPAGES:= no 706MKCATPAGES:= no
702MKHTML:= no 707MKHTML:= no
703.endif 708.endif
704 709
705.if ${MKLINKLIB} == "no" 710.if ${MKLINKLIB} == "no"
706MKLINT:= no 711MKLINT:= no
707MKPICINSTALL:= no 712MKPICINSTALL:= no
708MKPROFILE:= no 713MKPROFILE:= no
709.endif 714.endif
710 715
711.if ${MKPIC} == "no" 716.if ${MKPIC} == "no"
712MKPICLIB:= no 717MKPICLIB:= no
713.endif 718.endif
714 719
715.if ${MKOBJ} == "no" 720.if ${MKOBJ} == "no"
716MKOBJDIRS:= no 721MKOBJDIRS:= no
717.endif 722.endif
718 723
719.if ${MKSHARE} == "no" 724.if ${MKSHARE} == "no"
720MKCATPAGES:= no 725MKCATPAGES:= no
721MKDOC:= no 726MKDOC:= no
722MKINFO:= no 727MKINFO:= no
723MKHTML:= no 728MKHTML:= no
724MKMAN:= no 729MKMAN:= no
725MKNLS:= no 730MKNLS:= no
726.endif 731.endif
727 732
728# 733#
729# install(1) parameters. 734# install(1) parameters.
730# 735#
731COPY?= -c 736COPY?= -c
732.if ${MKUPDATE} == "no" 737.if ${MKUPDATE} == "no"
733PRESERVE?=  738PRESERVE?=
734.else 739.else
735PRESERVE?= -p 740PRESERVE?= -p
736.endif 741.endif
737RENAME?= -r 742RENAME?= -r
738HRDLINK?= -l h 743HRDLINK?= -l h
739SYMLINK?= -l s 744SYMLINK?= -l s
740 745
741METALOG?= ${DESTDIR}/METALOG 746METALOG?= ${DESTDIR}/METALOG
742METALOG.add?= ${TOOL_CAT} -l >> ${METALOG} 747METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
743.if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR} 748.if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
744.if ${MKUNPRIVED} != "no" 749.if ${MKUNPRIVED} != "no"
745INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha1 750INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha1
746.else 751.else
747INSTPRIV.unpriv= 752INSTPRIV.unpriv=
748.endif 753.endif
749INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc 754INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
750.endif 755.endif
751STRIPFLAG?=  756STRIPFLAG?=
752 757
753.if ${NEED_OWN_INSTALL_TARGET} != "no" 758.if ${NEED_OWN_INSTALL_TARGET} != "no"
754INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d 759INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
755INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME} 760INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
756INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME} 761INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
757INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME} 762INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
758HOST_INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME} 763HOST_INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
759HOST_INSTALL_DIR?= ${INSTALL} -d 764HOST_INSTALL_DIR?= ${INSTALL} -d
760HOST_INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} ${RENAME} 765HOST_INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} ${RENAME}
761.endif 766.endif
762 767
763# 768#
764# Set defaults for the USE_xxx variables. 769# Set defaults for the USE_xxx variables.
765# 770#
766 771
767# 772#
768# USE_* options which default to "no" and will be forced to "no" if their 773# USE_* options which default to "no" and will be forced to "no" if their
769# corresponding MK* variable is set to "no". 774# corresponding MK* variable is set to "no".
770# 775#
771.for var in USE_SKEY 776.for var in USE_SKEY
772.if (${${var:S/USE_/MK/}} == "no") 777.if (${${var:S/USE_/MK/}} == "no")
773${var}:= no 778${var}:= no
774.else 779.else
775${var}?= no 780${var}?= no
776.endif 781.endif
777.endfor 782.endfor
778 783
779# 784#
780# USE_* options which default to "yes" unless their corresponding MK* 785# USE_* options which default to "yes" unless their corresponding MK*
781# variable is set to "no". 786# variable is set to "no".
782# 787#
783.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP 788.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP
784.if (${${var:S/USE_/MK/}} == "no") 789.if (${${var:S/USE_/MK/}} == "no")
785${var}:= no 790${var}:= no
786.else 791.else
787${var}?= yes 792${var}?= yes
788.endif 793.endif
789.endfor 794.endfor
790 795
791# 796#
792# USE_* options which default to "yes". 797# USE_* options which default to "yes".
793# 798#
794.for var in USE_JEMALLOC 799.for var in USE_JEMALLOC
795${var}?= yes 800${var}?= yes
796.endfor 801.endfor
797 802
798# 803#
799# USE_* options which default to "no". 804# USE_* options which default to "no".
800# 805#
801#.for var in 806#.for var in
802#${var}?= no 807#${var}?= no
803#.endfor 808#.endfor
804 809
805# 810#
806# Where X11 sources are and where it is installed to. 811# Where X11 sources are and where it is installed to.
807# 812#
808X11SRCDIR?= /usr/xsrc 813X11SRCDIR?= /usr/xsrc
809X11SRCDIR.xc?= ${X11SRCDIR}/xfree/xc 814X11SRCDIR.xc?= ${X11SRCDIR}/xfree/xc
810X11SRCDIR.local?= ${X11SRCDIR}/local 815X11SRCDIR.local?= ${X11SRCDIR}/local
811.if ${X11FLAVOUR} == "Xorg" 816.if ${X11FLAVOUR} == "Xorg"
812X11ROOTDIR?= /usr/X11R7 817X11ROOTDIR?= /usr/X11R7
813.else 818.else
814X11ROOTDIR?= /usr/X11R6 819X11ROOTDIR?= /usr/X11R6
815.endif 820.endif
816X11BINDIR?= ${X11ROOTDIR}/bin 821X11BINDIR?= ${X11ROOTDIR}/bin
817X11ETCDIR?= /etc/X11 822X11ETCDIR?= /etc/X11
818X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts 823X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
819X11INCDIR?= ${X11ROOTDIR}/include 824X11INCDIR?= ${X11ROOTDIR}/include
820X11LIBDIR?= ${X11ROOTDIR}/lib/X11 825X11LIBDIR?= ${X11ROOTDIR}/lib/X11
821X11MANDIR?= ${X11ROOTDIR}/man 826X11MANDIR?= ${X11ROOTDIR}/man
822X11USRLIBDIR?= ${X11ROOTDIR}/lib 827X11USRLIBDIR?= ${X11ROOTDIR}/lib
823 828
824# 829#
825# New modular-xorg based builds 830# New modular-xorg based builds
826# 831#
827X11SRCDIRMIT?= ${X11SRCDIR}/external/mit 832X11SRCDIRMIT?= ${X11SRCDIR}/external/mit
828.for _lib in \ 833.for _lib in \
829 FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \ 834 FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \
830 Xdmcp Xevie Xext Xfixes Xfont Xft Xi Xinerama Xmu Xp Xpm XprintUtil \ 835 Xdmcp Xevie Xext Xfixes Xfont Xft Xi Xinerama Xmu Xp Xpm XprintUtil \
831 Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \ 836 Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \
832 fontenc xkbfile xkbui Xaw lbxutil Xfontcache XprintAppUtil 837 fontenc xkbfile xkbui Xaw lbxutil Xfontcache XprintAppUtil
833X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist 838X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist
834.endfor 839.endfor
835 840
836.for _proto in \ 841.for _proto in \
837 xcmisc xext xf86bigfont bigreqs input kb x fonts fixes scrnsaver \ 842 xcmisc xext xf86bigfont bigreqs input kb x fonts fixes scrnsaver \
838 xinerama print render resource record video xf86dga xf86misc \ 843 xinerama print render resource record video xf86dga xf86misc \
839 xf86vidmode composite damage trap gl randr fontcache xf86dri 844 xf86vidmode composite damage trap gl randr fontcache xf86dri
840X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist 845X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist
841.endfor 846.endfor
842 847
843.for _dir in \ 848.for _dir in \
844 xtrans fontconfig expat freetype evieext mkfontscale bdftopcf \ 849 xtrans fontconfig expat freetype evieext mkfontscale bdftopcf \
845 xkbcomp xorg-cf-files imake xorg-server xbiff xkbdata \ 850 xkbcomp xorg-cf-files imake xorg-server xbiff xkbdata \
846 xbitmaps appres xeyes xev xedit sessreg pixman \ 851 xbitmaps appres xeyes xev xedit sessreg pixman \
847 beforelight bitmap editres makedepend fonttosfnt fslsfonts \ 852 beforelight bitmap editres makedepend fonttosfnt fslsfonts \
848 fstobdf MesaDemos MesaGLUT MesaLib ico iceauth lbxproxy listres lndir \ 853 fstobdf MesaDemos MesaGLUT MesaLib ico iceauth lbxproxy listres lndir \
849 luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \ 854 luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \
850 setxkbmap smproxy twm viewres x11perf xauth xcalc xclipboard \ 855 setxkbmap smproxy twm viewres x11perf xauth xcalc xclipboard \
851 xclock xcmsdb xconsole xcutsel xditview xdpyinfo xdriinfo xdm \ 856 xclock xcmsdb xconsole xcutsel xditview xdpyinfo xdriinfo xdm \
852 xfd xf86dga xfindproxy xfontsel xfwp xgamma xgc xhost xinit \ 857 xfd xf86dga xfindproxy xfontsel xfwp xgamma xgc xhost xinit \
853 xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \ 858 xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \
854 xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \ 859 xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \
855 xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \ 860 xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \
856 xwininfo xwud xprehashprinterlist xplsprinters xkbprint xkbevd \ 861 xwininfo xwud xprehashprinterlist xplsprinters xkbprint xkbevd \
857 xterm xwd xfs xfsinfo xphelloworld xtrap xkbutils xkbcomp \ 862 xterm xwd xfs xfsinfo xphelloworld xtrap xkbutils xkbcomp \
858 xkeyboard-config xinput \ 863 xkeyboard-config xinput \
859 font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \ 864 font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \
860 font-adobe-utopia-75dpi font-adobe-utopia-type1 \ 865 font-adobe-utopia-75dpi font-adobe-utopia-type1 \
861 font-alias \ 866 font-alias \
862 font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi \ 867 font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi \
863 font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 \ 868 font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 \
864 font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 \ 869 font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 \
865 font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 \ 870 font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 \
866 font-isas-misc font-jis-misc font-misc-misc font-mutt-misc \ 871 font-isas-misc font-jis-misc font-misc-misc font-mutt-misc \
867 font-sony-misc font-util ttf-bitstream-vera encodings 872 font-sony-misc font-util ttf-bitstream-vera encodings
868X11SRCDIR.${_dir}?= ${X11SRCDIRMIT}/${_dir}/dist 873X11SRCDIR.${_dir}?= ${X11SRCDIRMIT}/${_dir}/dist
869.endfor 874.endfor
870 875
871.for _i in \ 876.for _i in \
872 keyboard mouse vmmouse void 877 keyboard mouse vmmouse void
873X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist 878X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist
874.endfor 879.endfor
875 880
876.for _v in \ 881.for _v in \
877 agten apm ark ast ati chips cirrus crime cyrix glint i128 i740 imstt \ 882 agten apm ark ast ati chips cirrus crime cyrix glint i128 i740 imstt \
878 intel mach64 mga neomagic newport nsc nv nvxbox pnozz r128 radeonhd \ 883 intel mach64 mga neomagic newport nsc nv nvxbox pnozz r128 radeonhd \
879 rendition s3 s3virge savage siliconmotion sis sunffb suncg6 tdfx tga \ 884 rendition s3 s3virge savage siliconmotion sis sunffb suncg6 tdfx tga \
880 trident tseng vesa vga via vmware wsfb 885 trident tseng vesa vga via vmware wsfb
881  886
882X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist 887X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist
883.endfor 888.endfor
884 889
885.if ${X11FLAVOUR} == "Xorg" 890.if ${X11FLAVOUR} == "Xorg"
886X11DRI?= yes 891X11DRI?= yes
887.endif 892.endif
888 893
889X11DRI?= no 894X11DRI?= no
890X11LOADABLE?= yes 895X11LOADABLE?= yes
891 896
892 897
893# 898#
894# MAKEDIRTARGET dir target [extra make(1) params] 899# MAKEDIRTARGET dir target [extra make(1) params]
895# run "cd $${dir} && ${MAKE} [params] $${target}", with a pretty message 900# run "cd $${dir} && ${MAKEDIRTARGETENV} ${MAKE} [params] $${target}", with a pretty message
896# 901#
 902MAKEDIRTARGETENV?=
897MAKEDIRTARGET=\ 903MAKEDIRTARGET=\
898 @_makedirtarget() { \ 904 @_makedirtarget() { \
899 dir="$$1"; shift; \ 905 dir="$$1"; shift; \
900 target="$$1"; shift; \ 906 target="$$1"; shift; \
901 case "$${dir}" in \ 907 case "$${dir}" in \
902 /*) this="$${dir}/"; \ 908 /*) this="$${dir}/"; \
903 real="$${dir}" ;; \ 909 real="$${dir}" ;; \
904 .) this="${_THISDIR_}"; \ 910 .) this="${_THISDIR_}"; \
905 real="${.CURDIR}" ;; \ 911 real="${.CURDIR}" ;; \
906 *) this="${_THISDIR_}$${dir}/"; \ 912 *) this="${_THISDIR_}$${dir}/"; \
907 real="${.CURDIR}/$${dir}" ;; \ 913 real="${.CURDIR}/$${dir}" ;; \
908 esac; \ 914 esac; \
909 show=$${this:-.}; \ 915 show=$${this:-.}; \
910 echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \ 916 echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
911 cd "$${real}" \ 917 cd "$${real}" \
912 && ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \ 918 && ${MAKEDIRTARGETENV} ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
913 }; \ 919 }; \
914 _makedirtarget 920 _makedirtarget
915 921
916# 922#
917# MAKEVERBOSE support. Levels are: 923# MAKEVERBOSE support. Levels are:
918# 0 No messages 924# 0 No messages
919# 1 Enable info messages, suppress command output 925# 1 Enable info messages, suppress command output
920# 2 Enable info messages and command output 926# 2 Enable info messages and command output
921#  927#
922MAKEVERBOSE?= 2 928MAKEVERBOSE?= 2
923 929
924.if ${MAKEVERBOSE} == 0 930.if ${MAKEVERBOSE} == 0
925_MKMSG?= @\# 931_MKMSG?= @\#
926_MKSHMSG?= : echo 932_MKSHMSG?= : echo
927_MKSHECHO?= : echo 933_MKSHECHO?= : echo
928.SILENT: 934.SILENT:
929.elif ${MAKEVERBOSE} == 1 935.elif ${MAKEVERBOSE} == 1
930_MKMSG?= @echo ' ' 936_MKMSG?= @echo ' '
931_MKSHMSG?= echo ' ' 937_MKSHMSG?= echo ' '
932_MKSHECHO?= : echo 938_MKSHECHO?= : echo
933.SILENT: 939.SILENT:
934.else # MAKEVERBOSE == 2 ? 940.else # MAKEVERBOSE == 2 ?
935_MKMSG?= @echo '\# ' 941_MKMSG?= @echo '\# '
936_MKSHMSG?= echo '\# ' 942_MKSHMSG?= echo '\# '
937_MKSHECHO?= echo 943_MKSHECHO?= echo
938.SILENT: __makeverbose_dummy_target__ 944.SILENT: __makeverbose_dummy_target__
939.endif 945.endif
940 946
941_MKMSG_BUILD?= ${_MKMSG} " build " 947_MKMSG_BUILD?= ${_MKMSG} " build "
942_MKMSG_CREATE?= ${_MKMSG} " create " 948_MKMSG_CREATE?= ${_MKMSG} " create "
943_MKMSG_COMPILE?= ${_MKMSG} "compile " 949_MKMSG_COMPILE?= ${_MKMSG} "compile "
944_MKMSG_FORMAT?= ${_MKMSG} " format " 950_MKMSG_FORMAT?= ${_MKMSG} " format "
945_MKMSG_INSTALL?= ${_MKMSG} "install " 951_MKMSG_INSTALL?= ${_MKMSG} "install "
946_MKMSG_LINK?= ${_MKMSG} " link " 952_MKMSG_LINK?= ${_MKMSG} " link "
947_MKMSG_LEX?= ${_MKMSG} " lex " 953_MKMSG_LEX?= ${_MKMSG} " lex "
948_MKMSG_REMOVE?= ${_MKMSG} " remove " 954_MKMSG_REMOVE?= ${_MKMSG} " remove "
949_MKMSG_YACC?= ${_MKMSG} " yacc " 955_MKMSG_YACC?= ${_MKMSG} " yacc "
950 956
951_MKSHMSG_CREATE?= ${_MKSHMSG} " create " 957_MKSHMSG_CREATE?= ${_MKSHMSG} " create "
952_MKSHMSG_INSTALL?= ${_MKSHMSG} "install " 958_MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
953 959
954_MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET} 960_MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
955_MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET} 961_MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
956_MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET} 962_MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
957_MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET} 963_MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
958_MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET} 964_MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
959_MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET} 965_MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
960_MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET} 966_MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
961_MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET} 967_MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
962_MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET} 968_MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
963 969
964.endif # !defined(_BSD_OWN_MK_) 970.endif # !defined(_BSD_OWN_MK_)