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