Annotation of src/share/mk/bsd.own.mk, Revision 1.415
1.415 ! rtr 1: # $NetBSD: bsd.own.mk,v 1.414 2004/04/13 12:25:03 lukem Exp $
1.64 lukem 2:
3: .if !defined(_BSD_OWN_MK_)
4: _BSD_OWN_MK_=1
1.24 thorpej 5:
1.169 tv 6: MAKECONF?= /etc/mk.conf
1.205 tv 7: .-include "${MAKECONF}"
1.13 mycroft 8:
1.341 lukem 9: #
1.310 thorpej 10: # CPU model, derived from MACHINE_ARCH
1.341 lukem 11: #
1.310 thorpej 12: MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/sh3e[bl]/sh3/:C/sh5e[bl]/sh5/:S/m68000/m68k/:S/armeb/arm/}
13:
1.341 lukem 14: #
1.209 tv 15: # NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
16: # ensure that things defined by <bsd.own.mk> (default targets,
17: # INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
1.341 lukem 18: #
1.209 tv 19: NEED_OWN_INSTALL_TARGET?= yes
20:
1.341 lukem 21: #
1.310 thorpej 22: # This lists the platforms which do not have working in-tree toolchains.
1.403 scw 23: # For the in-tree gcc 3.3.2 toolchain, this list is empty.
24: # If some future port is not supported by the in-tree toolchain, this
25: # should be set to "yes" for that port only.
1.341 lukem 26: #
1.310 thorpej 27: TOOLCHAIN_MISSING= no
1.221 thorpej 28:
1.341 lukem 29: #
1.346 mrg 30: # Transitional for toolchain upgrade to GCC3.3
31: #
1.353 mrg 32: # not working:
33: #
1.411 uwe 34: .if ${MACHINE_ARCH} == "vax"
1.395 mrg 35: HAVE_GCC3?= no
36: .else
37: HAVE_GCC3?= yes
38: .endif
39:
1.353 mrg 40: # Do we want to use tools/toolchain or not?
1.406 lukem 41: .if ${HAVE_GCC3} != "no"
1.353 mrg 42: USE_TOOLS_TOOLCHAIN=no
1.346 mrg 43: .endif
1.354 tron 44: USE_TOOLS_TOOLCHAIN?=yes
1.346 mrg 45:
1.221 thorpej 46: CPPFLAG_ISYSTEM= -isystem
1.397 mrg 47: # GCC2 did not have -isystem-cxx
1.406 lukem 48: .if ${USE_TOOLS_TOOLCHAIN} != "no"
1.346 mrg 49: CPPFLAG_ISYSTEMXX= -isystem
50: .else
1.352 mrg 51: CPPFLAG_ISYSTEMXX= -isystem-cxx
1.346 mrg 52: .endif
1.184 tv 53:
1.222 perry 54: .if empty(.MAKEFLAGS:M-V*)
55: PRINTOBJDIR= ${MAKE} -V .OBJDIR
56: .else
57: PRINTOBJDIR= echo # prevent infinite recursion
58: .endif
59:
1.341 lukem 60: #
1.286 lukem 61: # Determine if running in the NetBSD source tree by checking for the
62: # existence of build.sh and tools/ in the current or a parent directory,
63: # and setting _SRC_TOP_ to the result.
64: #
1.287 lukem 65: .if !defined(_SRC_TOP_) # {
1.199 jmc 66: _SRC_TOP_!= cd ${.CURDIR}; while :; do \
1.200 jmc 67: here=`pwd`; \
1.199 jmc 68: [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
69: case $$here in /) echo ""; break;; esac; \
1.341 lukem 70: cd ..; done
1.199 jmc 71:
72: .MAKEOVERRIDES+= _SRC_TOP_
73:
1.287 lukem 74: .endif # }
1.222 perry 75:
1.341 lukem 76: #
1.322 lukem 77: # If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
1.288 lukem 78: # defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
1.287 lukem 79: #
80: .if (${_SRC_TOP_} != "") # {
81:
1.288 lukem 82: NETBSDSRCDIR?= ${_SRC_TOP_}
1.180 tv 83:
1.287 lukem 84: .if !defined(_SRC_TOP_OBJ_)
85: _SRC_TOP_OBJ_!= cd ${_SRC_TOP_} && ${PRINTOBJDIR}
86: .MAKEOVERRIDES+= _SRC_TOP_OBJ_
1.286 lukem 87: .endif
88:
1.322 lukem 89: .endif # _SRC_TOP_ != "" # }
1.286 lukem 90:
91:
1.310 thorpej 92: .if (${_SRC_TOP_} != "") && \
1.406 lukem 93: (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
1.287 lukem 94: USETOOLS?= yes
1.286 lukem 95: .endif
1.287 lukem 96: USETOOLS?= no
97:
1.286 lukem 98:
1.310 thorpej 99: .if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "sh3" || \
100: ${MACHINE_ARCH} == "sh5"
1.180 tv 101: .BEGIN:
102: @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
103: @false
1.310 thorpej 104: .elif defined(REQUIRETOOLS) && \
1.406 lukem 105: (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
1.310 thorpej 106: ${USETOOLS} == "no"
1.180 tv 107: .BEGIN:
1.203 tv 108: @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
1.180 tv 109: @false
110: .endif
111:
1.341 lukem 112: #
1.204 tv 113: # Host platform information; may be overridden
1.341 lukem 114: #
1.204 tv 115: .if !defined(HOST_OSTYPE)
116: _HOST_OSNAME!= uname -s
117: _HOST_OSREL!= uname -r
118: _HOST_ARCH!= uname -p 2>/dev/null || uname -m
1.254 tv 119: HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH}
1.204 tv 120: .MAKEOVERRIDES+= HOST_OSTYPE
121: .endif
1.333 christos 122: HOST_CYGWIN= ${HOST_OSTYPE:MCYGWIN*}
1.204 tv 123:
1.275 lukem 124: .if ${USETOOLS} == "yes" # {
125:
1.341 lukem 126: #
1.204 tv 127: # Provide a default for TOOLDIR.
1.341 lukem 128: #
1.199 jmc 129: .if !defined(TOOLDIR)
1.339 lukem 130: TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
1.204 tv 131: .MAKEOVERRIDES+= TOOLDIR
1.199 jmc 132: .endif
1.180 tv 133:
1.341 lukem 134: #
1.320 thorpej 135: # This is the prefix used for the NetBSD-sourced tools.
1.341 lukem 136: #
1.320 thorpej 137: _TOOL_PREFIX?= nb
138:
1.341 lukem 139: #
1.318 thorpej 140: # If an external toolchain base is specified, use it.
1.341 lukem 141: #
142: .if defined(EXTERNAL_TOOLCHAIN) # {
1.318 thorpej 143: AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
144: AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
145: LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
146: NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
147: OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
148: OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
149: RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
150: SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
151: STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
152:
153: CC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
154: CPP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
155: CXX= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
156: FC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
157: OBJC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
1.341 lukem 158: .else # } {
1.204 tv 159: # Define default locations for common tools.
1.341 lukem 160: .if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
1.232 tv 161: AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
162: AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
1.234 thorpej 163: LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
164: NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
165: OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
166: OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
167: RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
168: SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
169: STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
1.341 lukem 170: .endif # }
1.234 thorpej 171:
1.341 lukem 172: .if ${USETOOLS_GCC:Uyes} == "yes" # {
1.234 thorpej 173: CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
174: CPP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
175: CXX= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
176: FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
177: OBJC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
1.341 lukem 178: .endif # }
179: .endif # EXTERNAL_TOOLCHAIN # }
1.234 thorpej 180:
1.338 lukem 181: HOST_MKDEP= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
182:
1.210 thorpej 183: DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
1.320 thorpej 184: ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
185: INSTALL= STRIP=${STRIP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}install
186: LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
1.215 tv 187: LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
1.338 lukem 188: LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
1.320 thorpej 189: MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
190: TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
191: YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
1.338 lukem 192:
193: TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
194: TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
195: TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
196: TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
197: TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
198: TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
199: TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
200: TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
201: TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
202: TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
203: TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
204: TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
205: TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
206: TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
207: TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
208: TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
209: TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
210: TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
1.405 matt 211: TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
1.338 lukem 212: TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
213: TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
214: TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
215: TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
216: TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
217: TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
218: TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
219: TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
220: TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
221: TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
222: TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
223: TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
224: TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
225: TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
226: TOOL_PREPMKBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}prep-mkbootimage
227: TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
228: TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
229: TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
230: TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
1.340 lukem 231: TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
1.338 lukem 232: TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
233: TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
234: TOOL_RPCGEN= CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
235: TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
1.342 lukem 236: TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
1.338 lukem 237: TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
238: TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
239: TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
240: TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
241: TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
1.180 tv 242:
1.275 lukem 243: .endif # USETOOLS == yes # }
1.272 lukem 244:
1.341 lukem 245: #
1.272 lukem 246: # Targets to check if DESTDIR or RELEASEDIR is provided
247: #
248: .if !target(check_DESTDIR)
249: check_DESTDIR: .PHONY .NOTMAIN
250: .if !defined(DESTDIR)
251: @echo "setenv DESTDIR before doing that!"
252: @false
253: .else
254: @true
255: .endif
256: .endif
257:
258: .if !target(check_RELEASEDIR)
259: check_RELEASEDIR: .PHONY .NOTMAIN
260: .if !defined(RELEASEDIR)
261: @echo "setenv RELEASEDIR before doing that!"
262: @false
263: .else
264: @true
265: .endif
266: .endif
267:
268:
1.341 lukem 269: .if ${USETOOLS} == "yes" # {
270: #
1.180 tv 271: # Make sure DESTDIR is set, so that builds with these tools always
272: # get appropriate -nostdinc, -nostdlib, etc. handling. The default is
273: # <empty string>, meaning start from /, the root directory.
1.341 lukem 274: #
1.180 tv 275: DESTDIR?=
1.341 lukem 276: .endif # }
1.287 lukem 277:
1.341 lukem 278: #
1.306 lukem 279: # Build a dynamically linked /bin and /sbin, with the necessary shared
280: # libraries moved from /usr/lib to /lib and the shared linker moved
281: # from /usr/libexec to /lib
282: #
1.315 thorpej 283: # Note that if the BINDIR is not /bin or /sbin, then we always use the
284: # non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
285: # and /sbin). See <bsd.shlib.mk>.
286: #
1.311 lukem 287: MKDYNAMICROOT?= yes
1.306 lukem 288:
1.341 lukem 289: #
1.287 lukem 290: # Where the system object and source trees are kept; can be configurable
291: # by the user in case they want them in ~/foosrc and ~/fooobj (for example).
292: #
293: BSDSRCDIR?= /usr/src
294: BSDOBJDIR?= /usr/obj
1.288 lukem 295: NETBSDSRCDIR?= ${BSDSRCDIR}
1.1 cgd 296:
1.61 lukem 297: BINGRP?= wheel
298: BINOWN?= root
1.1 cgd 299: BINMODE?= 555
1.4 mycroft 300: NONBINMODE?= 444
1.17 brezak 301:
1.31 christos 302: MANDIR?= /usr/share/man
1.61 lukem 303: MANGRP?= wheel
304: MANOWN?= root
1.4 mycroft 305: MANMODE?= ${NONBINMODE}
1.52 mycroft 306: MANINSTALL?= maninstall catinstall
1.115 tv 307:
308: INFODIR?= /usr/share/info
309: INFOGRP?= wheel
310: INFOOWN?= root
311: INFOMODE?= ${NONBINMODE}
1.4 mycroft 312:
313: LIBDIR?= /usr/lib
1.315 thorpej 314:
1.4 mycroft 315: LINTLIBDIR?= /usr/libdata/lint
316: LIBGRP?= ${BINGRP}
317: LIBOWN?= ${BINOWN}
318: LIBMODE?= ${NONBINMODE}
319:
1.135 simonb 320: DOCDIR?= /usr/share/doc
1.136 simonb 321: HTMLDOCDIR?= /usr/share/doc/html
1.61 lukem 322: DOCGRP?= wheel
323: DOCOWN?= root
1.135 simonb 324: DOCMODE?= ${NONBINMODE}
1.15 jtc 325:
326: NLSDIR?= /usr/share/nls
1.61 lukem 327: NLSGRP?= wheel
328: NLSOWN?= root
1.15 jtc 329: NLSMODE?= ${NONBINMODE}
1.25 explorer 330:
331: KMODDIR?= /usr/lkm
1.61 lukem 332: KMODGRP?= wheel
333: KMODOWN?= root
1.25 explorer 334: KMODMODE?= ${NONBINMODE}
1.155 itojun 335:
336: LOCALEDIR?= /usr/share/locale
337: LOCALEGRP?= wheel
338: LOCALEOWN?= root
339: LOCALEMODE?= ${NONBINMODE}
1.1 cgd 340:
1.341 lukem 341: #
342: # Data-driven table using make variables to control how
1.264 thorpej 343: # toolchain-dependent targets and shared libraries are built
344: # for different platforms and object formats.
345: #
1.296 thorpej 346: # OBJECT_FMT: currently either "ELF" or "a.out".
1.264 thorpej 347: #
1.296 thorpej 348: # All platforms are ELF, except for ns32k (which does not yet have
349: # an ELF BFD back-end).
1.341 lukem 350: #
1.296 thorpej 351: .if ${MACHINE_ARCH} == "ns32k"
352: OBJECT_FMT?= a.out # allow overrides, to ease transition
353: .else
1.264 thorpej 354: OBJECT_FMT= ELF
355: .endif
356:
1.341 lukem 357: #
1.310 thorpej 358: # If this platform's toolchain is missing, we obviously cannot build it.
1.341 lukem 359: #
1.406 lukem 360: .if ${TOOLCHAIN_MISSING} != "no"
1.310 thorpej 361: MKBFD:= no
362: MKGDB:= no
363: MKGCC:= no
364: .endif
365:
1.341 lukem 366: #
1.310 thorpej 367: # If we are using an external toolchain, we can still build the target's
368: # BFD stuff, but we cannot build GCC's support libraries, since those are
369: # tightly-coupled to the version of GCC being used.
1.341 lukem 370: #
1.310 thorpej 371: .if defined(EXTERNAL_TOOLCHAIN)
372: MKGCC:= no
373: .endif
374:
1.341 lukem 375: #
1.356 uwe 376: # GCC can produce PIC code for sh3 only starting with gcc3.
1.341 lukem 377: #
1.406 lukem 378: .if ${MACHINE_CPU} == "sh3" && ${HAVE_GCC3} == "no"
1.230 tv 379: NOPIC= # defined
1.266 thorpej 380: .endif
1.18 cgd 381:
1.341 lukem 382: #
1.403 scw 383: # gcc3 and gdb on sh5 are not ready for prime-time.
1.341 lukem 384: #
1.317 thorpej 385: .if ${MACHINE_CPU} == "sh5"
1.301 scw 386: NOPROFILE= # defined
1.403 scw 387: NOPIC= # defined
388: MKGDB=no
1.301 scw 389: .endif
390:
1.341 lukem 391: #
1.165 fredette 392: # The m68000 port is incomplete.
1.341 lukem 393: #
1.165 fredette 394: .if ${MACHINE_ARCH} == "m68000"
1.230 tv 395: NOPIC= # defined
1.32 thorpej 396: .endif
1.122 simonb 397:
1.341 lukem 398: #
1.297 fredette 399: # The hppa port is incomplete.
1.341 lukem 400: #
1.297 fredette 401: .if ${MACHINE_ARCH} == "hppa"
402: NOLINT= # defined
403: NOPROFILE= # defined
404: .endif
405:
1.341 lukem 406: #
1.327 thorpej 407: # On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
408: # not just shared libraries, so don't build the _pic version.
1.341 lukem 409: #
1.327 thorpej 410: .if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
411: MKPICLIB:= no
412: .endif
413:
1.341 lukem 414: #
1.400 simonb 415: # Shared libraries are not supported on ns32k with current GNU tools.
1.404 simonb 416: # Disable native gdb too.
1.341 lukem 417: #
1.400 simonb 418: .if ${MACHINE_ARCH} == "ns32k"
1.296 thorpej 419: NOPIC= # defined
1.404 simonb 420: MKGDB= no
1.296 thorpej 421: .endif
422:
1.341 lukem 423: #
1.327 thorpej 424: # On VAX using ELF, all objects are PIC, not just shared libraries,
1.401 matt 425: # so don't build the _pic version. Unless we are using GCC3 which
426: # doesn't support PIC yet.
1.341 lukem 427: #
1.402 matt 428: .if ${MACHINE_ARCH} == "vax" && ${HAVE_GCC3} != "no"
1.401 matt 429: NOPIC= # defined
430: .endif
1.327 thorpej 431: .if ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
432: MKPICLIB:= no
433: .endif
434:
1.341 lukem 435: #
1.122 simonb 436: # Location of the file that contains the major and minor numbers of the
437: # version of a shared library. If this file exists a shared library
438: # will be built by <bsd.lib.mk>.
1.341 lukem 439: #
1.122 simonb 440: SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
1.69 tv 441:
1.341 lukem 442: #
1.69 tv 443: # GNU sources and packages sometimes see architecture names differently.
1.341 lukem 444: #
1.261 thorpej 445: GNU_ARCH.m68000=m68010
1.150 itojun 446: GNU_ARCH.sh3eb=sh
1.236 thorpej 447: GNU_ARCH.sh3el=shle
1.317 thorpej 448: GNU_ARCH.sh5eb=sh5
449: GNU_ARCH.sh5el=sh5le
1.172 tv 450: MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
1.161 tv 451:
1.341 lukem 452: #
1.161 tv 453: # In order to identify NetBSD to GNU packages, we sometimes need
454: # an "elf" tag for historically a.out platforms.
1.341 lukem 455: #
1.162 tv 456: .if ${OBJECT_FMT} == "ELF" && \
1.192 thorpej 457: (${MACHINE_GNU_ARCH} == "arm" || \
1.294 thorpej 458: ${MACHINE_GNU_ARCH} == "armeb" || \
1.296 thorpej 459: ${MACHINE_ARCH} == "ns32k" || \
1.168 matt 460: ${MACHINE_ARCH} == "i386" || \
1.161 tv 461: ${MACHINE_ARCH} == "m68k" || \
1.260 thorpej 462: ${MACHINE_ARCH} == "m68000" || \
1.235 thorpej 463: ${MACHINE_GNU_ARCH} == "sh" || \
1.236 thorpej 464: ${MACHINE_GNU_ARCH} == "shle" || \
1.168 matt 465: ${MACHINE_ARCH} == "sparc" || \
466: ${MACHINE_ARCH} == "vax")
1.318 thorpej 467: MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
1.161 tv 468: .else
1.318 thorpej 469: MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
1.161 tv 470: .endif
1.153 itojun 471:
1.160 tv 472: TARGETS+= all clean cleandir depend dependall includes \
1.142 phil 473: install lint obj regress tags html installhtml cleanhtml
1.128 perry 474: .PHONY: all clean cleandir depend dependall distclean includes \
475: install lint obj regress tags beforedepend afterdepend \
1.142 phil 476: beforeinstall afterinstall realinstall realdepend realall \
1.257 reinoud 477: html installhtml cleanhtml subdir-all subdir-install subdir-depend
1.58 agc 478:
1.406 lukem 479: .if ${NEED_OWN_INSTALL_TARGET} != "no"
1.56 drochner 480: .if !target(install)
481: install: .NOTMAIN beforeinstall subdir-install realinstall afterinstall
1.55 drochner 482: beforeinstall: .NOTMAIN
1.56 drochner 483: subdir-install: .NOTMAIN beforeinstall
484: realinstall: .NOTMAIN beforeinstall
485: afterinstall: .NOTMAIN subdir-install realinstall
1.58 agc 486: .endif
1.131 mycroft 487: all: .NOTMAIN realall subdir-all
488: subdir-all: .NOTMAIN
489: realall: .NOTMAIN
490: depend: .NOTMAIN realdepend subdir-depend
491: subdir-depend: .NOTMAIN
492: realdepend: .NOTMAIN
1.160 tv 493: distclean: .NOTMAIN cleandir
1.171 tv 494: cleandir: .NOTMAIN clean
1.205 tv 495:
496: dependall: .NOTMAIN realdepend .MAKE
497: @cd ${.CURDIR}; ${MAKE} realall
1.132 mycroft 498: .endif
1.116 lukem 499:
1.341 lukem 500: #
1.116 lukem 501: # Define MKxxx variables (which are either yes or no) for users
1.350 lukem 502: # to set in /etc/mk.conf and override in the make environment.
1.116 lukem 503: # These should be tested with `== "no"' or `!= "no"'.
1.340 lukem 504: # The NOxxx variables should only be set by Makefiles.
1.116 lukem 505: #
506:
1.341 lukem 507: #
1.230 tv 508: # Supported NO* options (if defined, MK* will be forced to "no",
509: # regardless of user's mk.conf setting).
1.341 lukem 510: #
1.340 lukem 511: .for var in CRYPTO DOC HTML LINKLIB LINT MAN NLS OBJ PIC PICINSTALL PROFILE \
1.358 lukem 512: SHARE STATICLIB
1.230 tv 513: .if defined(NO${var})
514: MK${var}:= no
515: .endif
516: .endfor
1.268 ross 517:
1.341 lukem 518: #
519: # Older-style variables that enabled behaviour when set.
520: #
521: .for var in MANZ UNPRIVED UPDATE
522: .if defined(${var})
523: MK${var}:= yes
1.268 ross 524: .endif
1.341 lukem 525: .endfor
1.230 tv 526:
1.341 lukem 527: #
1.230 tv 528: # MK* options which default to "yes".
1.341 lukem 529: #
1.373 matt 530: .for var in BFD BINUTILS \
531: CATPAGES CRYPTO CVS \
532: DOC \
533: GCC GCCCMDS GDB \
534: HESIOD HTML \
1.399 matt 535: IEEEFP INET6 INFO \
1.373 matt 536: KERBEROS KERBEROS4 \
537: LINKLIB LINT \
538: MAN \
539: NLS \
540: OBJ \
541: PIC PICINSTALL PICLIB POSTFIX PROFILE \
1.407 lukem 542: SENDMAIL SHARE SKEY STATICLIB \
1.373 matt 543: UUCP \
544: YP
1.230 tv 545: MK${var}?= yes
546: .endfor
547:
1.341 lukem 548: #
1.230 tv 549: # MK* options which default to "no".
1.341 lukem 550: #
1.351 lukem 551: .for var in CRYPTO_IDEA CRYPTO_MDC2 CRYPTO_RC5 \
1.408 lukem 552: MANZ OBJDIRS SOFTFLOAT UNPRIVED UPDATE X11
1.230 tv 553: MK${var}?= no
554: .endfor
555:
1.341 lukem 556: #
1.230 tv 557: # Force some options off if their dependencies are off.
1.341 lukem 558: #
559:
1.413 jmc 560: .if ${MKKERBEROS} == "no"
561: MKKERBEROS4:= no
562: .endif
563:
1.230 tv 564: .if ${MKCRYPTO} == "no"
1.344 itojun 565: MKKERBEROS4:= no
1.230 tv 566: MKKERBEROS:= no
1.340 lukem 567: .endif
568:
569: .if ${MKMAN} == "no"
1.341 lukem 570: MKCATPAGES:= no
1.340 lukem 571: MKHTML:= no
1.116 lukem 572: .endif
573:
1.117 lukem 574: .if ${MKLINKLIB} == "no"
1.230 tv 575: MKPICINSTALL:= no
576: MKPROFILE:= no
1.327 thorpej 577: .endif
578:
579: .if ${MKPIC} == "no"
580: MKPICLIB:= no
1.116 lukem 581: .endif
582:
1.230 tv 583: .if ${MKOBJ} == "no"
584: MKOBJDIRS:= no
1.116 lukem 585: .endif
586:
1.117 lukem 587: .if ${MKSHARE} == "no"
1.230 tv 588: MKCATPAGES:= no
589: MKDOC:= no
590: MKINFO:= no
1.341 lukem 591: MKHTML:= no
1.230 tv 592: MKMAN:= no
593: MKNLS:= no
1.116 lukem 594: .endif
1.276 thorpej 595:
1.341 lukem 596: #
597: # install(1) parameters.
598: #
599: COPY?= -c
600: .if ${MKUPDATE} == "no"
601: PRESERVE?=
602: .else
603: PRESERVE?= -p
604: .endif
605: RENAME?= -r
606: HRDLINK?= -l h
607: SYMLINK?= -l s
608:
609: METALOG?= ${DESTDIR}/METALOG
610: METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
611: .if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
612: .if ${MKUNPRIVED} != "no"
1.409 lukem 613: INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha1
1.341 lukem 614: .else
615: INSTPRIV.unpriv=
616: .endif
617: INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
618: .endif
619: SYSPKGTAG?= ${SYSPKG:D-T ${SYSPKG}_pkg}
620: SYSPKGDOCTAG?= ${SYSPKG:D-T ${SYSPKG}-doc_pkg}
1.410 lukem 621: STRIPFLAG?=
1.341 lukem 622:
1.406 lukem 623: .if ${NEED_OWN_INSTALL_TARGET} != "no"
1.341 lukem 624: INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
625: INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
626: INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
627: INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
628: HOST_INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
629: .endif
630:
631: #
1.351 lukem 632: # Set defaults for the USE_xxx variables.
633: #
634:
635: #
636: # USE_* options which default to "yes" unless their corresponding MK*
637: # variable is set to "no".
1.341 lukem 638: #
1.399 matt 639: .for var in HESIOD INET6 KERBEROS KERBEROS4 SKEY YP
1.276 thorpej 640: .if (${MK${var}} == "no")
641: USE_${var}:= no
642: .else
643: USE_${var}?= yes
644: .endif
1.351 lukem 645: .endfor
646:
647: #
648: # USE_* options which default to "yes".
649: #
650: .for var in LIBSTDCXX
651: USE_${var}?= yes
1.276 thorpej 652: .endfor
1.300 tron 653:
1.341 lukem 654: #
1.388 sekiya 655: # Use XFree86 4.x as default version on i386, amd64, macppc, cats, sgimips,
656: # and sparc*.
1.341 lukem 657: #
1.329 fvdl 658: .if ${MACHINE_ARCH} == "i386" || ${MACHINE} == "amd64" || \
1.343 mrg 659: ${MACHINE} == "macppc" || ${MACHINE} == "cats" || \
1.388 sekiya 660: ${MACHINE} == "sgimips" || \
1.355 martin 661: ${MACHINE} == "sparc" || ${MACHINE} == "sparc64"
1.300 tron 662: USE_XF86_4?= yes
663: .endif
1.357 lukem 664:
665: #
666: # Where X11R6 sources are and where it is installed to
667: #
668: X11SRCDIR?= /usr/xsrc
669: X11SRCDIR.xc?= ${X11SRCDIR}/xfree/xc
670: X11SRCDIR.local?= ${X11SRCDIR}/local
671: X11ROOTDIR?= /usr/X11R6
672: X11BINDIR?= ${X11ROOTDIR}/bin
673: X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
674: X11INCDIR?= ${X11ROOTDIR}/include
675: X11LIBDIR?= ${X11ROOTDIR}/lib/X11
676: X11MANDIR?= ${X11ROOTDIR}/man
677: X11USRLIBDIR?= ${X11ROOTDIR}/lib
1.412 rtr 678: X11DRI?= no
1.415 ! rtr 679: X11LOADABLE?= yes
1.374 lukem 680:
681:
682: #
1.414 lukem 683: # MAKEDIRTARGET dir target [extra make(1) params]
684: # run "cd $${dir} && ${MAKE} [params] $${target}", with a pretty message
685: #
686: MAKEDIRTARGET=\
687: @_makedirtarget() { \
688: dir="$$1"; shift; \
689: target="$$1"; shift; \
690: case "$${dir}" in \
691: /*) this="$${dir}/"; \
692: real="$${dir}" ;; \
693: .) this="${_THISDIR_}"; \
694: real="${.CURDIR}" ;; \
695: *) this="${_THISDIR_}$${dir}/"; \
696: real="${.CURDIR}/$${dir}" ;; \
697: esac; \
698: show=$${this:-.}; \
699: echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
700: cd "$${real}" \
701: && ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
702: }; \
703: _makedirtarget
704:
705: #
1.374 lukem 706: # MAKEVERBOSE support. Levels are:
1.380 lukem 707: # 0 No messages
708: # 1 Enable info messages, suppress command output
709: # 2 Enable info messages and command output
1.374 lukem 710: #
711: MAKEVERBOSE?= 2
712:
713: .if ${MAKEVERBOSE} == 0
714: _MKMSG?= @\#
715: _MKSHMSG?= : echo
716: _MKSHECHO?= : echo
1.380 lukem 717: .SILENT:
1.374 lukem 718: .elif ${MAKEVERBOSE} == 1
719: _MKMSG?= @echo ' '
720: _MKSHMSG?= echo ' '
721: _MKSHECHO?= : echo
1.380 lukem 722: .SILENT:
1.374 lukem 723: .else # MAKEVERBOSE == 2 ?
724: _MKMSG?= @echo '\# '
725: _MKSHMSG?= echo '\# '
726: _MKSHECHO?= echo
1.380 lukem 727: .SILENT: __makeverbose_dummy_target__
1.374 lukem 728: .endif
729:
730: _MKMSG_BUILD?= ${_MKMSG} " build "
731: _MKMSG_CREATE?= ${_MKMSG} " create "
732: _MKMSG_COMPILE?= ${_MKMSG} "compile "
733: _MKMSG_FORMAT?= ${_MKMSG} " format "
734: _MKMSG_INSTALL?= ${_MKMSG} "install "
735: _MKMSG_LINK?= ${_MKMSG} " link "
736: _MKMSG_LEX?= ${_MKMSG} " lex "
737: _MKMSG_REMOVE?= ${_MKMSG} " remove "
738: _MKMSG_YACC?= ${_MKMSG} " yacc "
1.391 lukem 739:
740: _MKSHMSG_CREATE?= ${_MKSHMSG} " create "
741: _MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
1.374 lukem 742:
1.394 lukem 743: _MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
744: _MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
745: _MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
746: _MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
747: _MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
748: _MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
749: _MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
750: _MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
751: _MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
1.64 lukem 752:
1.347 lukem 753: .endif # !defined(_BSD_OWN_MK_)
CVSweb <webmaster@jp.NetBSD.org>