NetBSD re-synchronization of the source tree

This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
This commit is contained in:
2016-01-13 20:32:14 +01:00
parent 8933525b85
commit 0a6a1f1d05
32425 changed files with 2998492 additions and 1342217 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.47 2012/11/15 23:51:53 joerg Exp $
# $NetBSD: Makefile,v 1.49 2014/01/16 01:15:33 christos Exp $
# @(#)Makefile 8.1 (Berkeley) 6/8/93
NOOBJ= # defined
@@ -7,13 +7,13 @@ NOOBJ= # defined
.if ${MKSHARE} != "no"
FILES= bsd.README bsd.buildinstall.mk bsd.clang-analyze.mk bsd.clean.mk \
bsd.dep.mk bsd.doc.mk bsd.endian.mk bsd.files.mk \
bsd.gcc.mk bsd.hostlib.mk bsd.hostprog.mk bsd.inc.mk bsd.info.mk \
bsd.dep.mk bsd.doc.mk bsd.endian.mk bsd.files.mk bsd.gcc.mk \
bsd.host.mk bsd.hostlib.mk bsd.hostprog.mk bsd.inc.mk bsd.info.mk \
bsd.init.mk bsd.ioconf.mk bsd.kernobj.mk bsd.kinc.mk bsd.klinks.mk \
bsd.kmodule.mk bsd.lib.mk bsd.links.mk bsd.lua.mk \
bsd.man.mk bsd.nls.mk \
bsd.obj.mk bsd.own.mk bsd.prog.mk bsd.rpc.mk bsd.shlib.mk \
bsd.subdir.mk bsd.sys.mk bsd.test.mk bsd.x11.mk sys.mk
bsd.subdir.mk bsd.sys.mk bsd.syscall.mk bsd.test.mk bsd.x11.mk sys.mk
.if defined(__MINIX)
# MINIX-specific files
+257 -156
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.README,v 1.322 2013/11/11 10:24:53 joerg Exp $
# $NetBSD: bsd.README,v 1.346 2015/07/23 08:03:26 mrg Exp $
# @(#)bsd.README 8.2 (Berkeley) 4/2/94
This is the README file for the make "include" files for the NetBSD
@@ -136,6 +136,14 @@ MKCATPAGES If "no", don't build or install the catman pages.
MKCOMPAT If "no", don't build or install the src/compat.
Default: yes on amd64/mips64/sparc64, no elsewhere.
MKCOMPATTESTS If "yes", build and install the NetBSD test suite when
building and installing src/compat.
Default: no
MKCOMPATX11 If "yes", build and install the X11 libraries when
building and installing src/compat.
Default: no
MKCOMPLEX If "no", don't build libm support for <complex.h>
Default: yes
@@ -146,6 +154,11 @@ MKCRYPTO If "no", no cryptography support will be built into the system,
MKCRYPTO_RC5 If not "no", RC5 support will be built into libcrypto_rc5
Default: no
MKCTF If "no", do not build and install CTF tools, and also
don't generate and manipulate CTF data of ELF binaries
during build.
Default: no
MKCVS If "no", don't build or install cvs(1).
Default: yes
@@ -193,6 +206,12 @@ MKGCCCMDS If "no", don't build gcc(1), but do build the GCC-related
MKGDB If "no", don't build gdb(1).
Default: yes
MKGROFFHTMLDOC If "no", avoid trying to use groff to generate html for
miscellaneous articles, as this seems to sometimes want
to run software not in base. Does not affect html man
pages.
Default: no
MKHESIOD If "no", disables building of Hesiod infrastructure
(libraries and support programs).
Default: yes
@@ -229,6 +248,10 @@ MKISCSI If "no", don't build or install iSCSI library or applications
(depends on libpthread.)
Default: yes
MKKDEBUG If "yes", force building of kernel symbol info and creation
of netbsd.gdb in all kernel builds, independently of the
settings for "makeoptions DEBUG" in the kernel config file.
MKKERBEROS If "no", disables building of Kerberos v5
infrastructure (libraries and support programs).
Default: yes
@@ -380,31 +403,33 @@ MKUPDATE If not "no", 'make install' only installs targets that are
installed counterparts.
Default: no
MKX11 If not "no", depending on the value of ${X11FLAVOUR},
'make build' also descends into either src/x11 (XFree86) or
src/external/mit/xorg (modular Xorg) to cross-build X11 and
automatically enables creation of X sets.
MKX11 If not "no", 'make build' also descends into
src/external/mit/xorg to cross-build X11 and automatically
enables creation of X sets.
Default: no
MKX11FONTS If not "no", if ${X11FLAVOUR} is "Xorg", do not build or
install the X fonts. The xfont set is still created but
will be empty.
MKX11FONTS If not "no", do not build or install the X fonts. The xfont
set is still created but will be empty.
Default: yes
MKX11MOTIF: If "yes" and ${X11FLAVOUR} is "Xorg", build the native X11
libGLw with Motif stubs. If Motif is not installed in the
default location /usr/pkg, the location can be specified
using the X11MOTIFPATH variable.
MKX11MOTIF: If "yes", build the native X11 libGLw with Motif stubs. If
Motif is not installed in the default location /usr/pkg, the
location can be specified using the X11MOTIFPATH variable.
Default: no
MKRADEONFIRMWARE If "no", install the /libdata/firmware/radeon directory,
which is necessary for the radeon DRM driver.
Default: yes on i386 and amd64, no elsewhere.
MKYP If "no", disables building of YP (NIS)
infrastructure (libraries and support programs).
Default: yes
MKZFS If "no", do not build and install utilities and libraries
used to manage ZFS file system. Do not build zfs and solaris
compatibility kernel modules.
Default: yes on i386/amd64, no elsewhere.
compatibility kernel modules. Note: ZFS requires 64bit
atomic operations.
Default: yes on amd64, no elsewhere.
MKRUMP If "no", do not build and install rump related headers,
libraries, and programs.
@@ -463,15 +488,10 @@ USE_YP If "no", disables building YP (NIS) support into
If ${MKYP} is "no", USE_YP will also be forced to "no".
USE_PIGZGZIP If "no", use the host "gzip" program to compress things.
Otherwise, build tools/pigz and use nbpigz to compress
things.
Otherwise, build tools/pigz, set TOOL_GZIP=${TOOL_PIGZ},
and use nbpigz to compress things.
Default: "no".
X11FLAVOUR Set to "Xorg" or "XFree86", depending on whether to build
XFree86 or modular Xorg. Only matters if MKX11!=no.
Default: "Xorg" on amd64, i386, macppc, shark and sparc64,
"XFree86" on everything else.
COPTS.lib<lib>
OBJCOPTS.lib<lib>
LDADD.lib<lib>
@@ -600,15 +620,16 @@ LIBMODE Library mode. [${NONBINMODE}]
DOCDIR Base path for system documentation (e.g. PSD, USD, etc.)
installation. [/usr/share/doc]
HTMLDOCDIR Base path for html system documentation installation.
[/usr/share/doc/html]
DOCGRP Documentation group. [wheel]
DOCOWN Documentation owner. [root]
DOCMODE Documentation mode. [${NONBINMODE}]
GZIP_N_FLAG Flags to pass to TOOL_GZIP to prevent it from inserting
file names or timestamps in the compressed output.
[-n, or -nT when TOOL_GZIP is really TOOL_PIGZ]
NLSDIR Base path for Native Language Support files installation.
[/usr/share/nls]
@@ -621,8 +642,6 @@ NLSMODE Native Language Support files mode. [${NONBINMODE}]
X11SRCDIR The path to the xsrc tree. [${NETBSDSRCDIR}/../xsrc,
if that exists; otherwise /usr/xsrc]
X11SRCDIR.xc The path to the (old) X11 xc src tree. [${X11SRCDIR}/xfree/xc]
X11SRCDIR.local The path to the local X11 src tree. [${X11SRCDIR}/local]
X11SRCDIR.lib<package>
@@ -786,11 +805,18 @@ TOOL_GREP Print lines matching a pattern. [grep]
TOOL_GROFF Front end for groff document formatting system. [groff]
TOOL_GZIP Compression/decompression tool. [gzip]
TOOL_GZIP_N Same as TOOL_GZIP, plus a command line option to
prevent it from inserting file names or timestamps
into the compressed output.
[${TOOL_GZIP} ${GZIP_N_FLAG}]
TOOL_HEXDUMP Ascii, decimal, hexadecimal, octal dump. [hexdump]
TOOL_HP300MKBOOT Make bootable image for hp300. [hp300-mkboot]
TOOL_HP700MKBOOT Make bootable image for hp700. [hp700-mkboot]
TOOL_HPPAMKBOOT Make bootable image for hppa. [hppa-mkboot]
TOOL_INDXBIB Make bibliographic database's inverted index. [indxbib]
@@ -833,6 +859,8 @@ TOOL_MSGC Simple message list compiler. [msgc]
TOOL_MTREE Map a directory hierarchy. [mtree]
TOOL_NCDCS Turn ELF kernel into a NCD firmware image. [ncdcs]
TOOL_PAX Manipulate file archives and copy directories. [pax]
TOOL_PIC Compile pictures for groff. [pic]
@@ -880,6 +908,10 @@ TOOL_VGRIND Grind nice listings of programs. [vgrind -f]
TOOL_ZIC Time zone compiler. [zic]
For each possible value of MACHINE_CPU, MACHINES.${MACHINE_CPU} contain a
list of what ports can be built for it. This keeps those definitions in
centralized place.
<bsd.own.mk> is generally useful when building your own Makefiles so that
they use the same default owners etc. as the rest of the tree.
@@ -1119,6 +1151,11 @@ kernel Makefiles. It uses similar variables to <bsd.inc.mk>.
Please see <bsd.kinc.mk> for more details, and keep the documentation
in that file up to date.
=-=-=-=-= bsd.syscall.mk =-=-=-=-=
The include file <bsd.syscall.mk> contains the logic to create syscall
files for various emulations. It includes <bsd.kinc.mk> to handle the
rest of the targets.
=-=-=-=-= bsd.lib.mk =-=-=-=-=
@@ -1139,7 +1176,8 @@ LIBDIR Target directory for libraries.
MKARZERO Normally, ar(1) sets the timestamps, uid, gid and
permissions in files inside its archives to those of
the file it was fed. This leads to non-reproduceable
builds. If MKARZERO is set to "yes" (default is "no")
builds. If MKARZERO is set to "yes" (default is the
same as MKREPRO, or "no" if MKREPRO is not defined),
then the "D" flag is passed to ar, causing the
timestamp, uid and gid to be zeroed and the file
permissions to be set to 644. This allows .a files
@@ -1401,6 +1439,8 @@ CLEANDIRFILES Additional files to remove for the cleandir target.
CLEANFILES Additional files to remove for the clean and cleandir targets.
CONFIGOPTS Additional flags to config(1) when building kernels.
COPTS Additional flags to the compiler when creating C objects.
COPTS.<fn> Additional flags to the compiler when creating the
@@ -1740,137 +1780,12 @@ SUBDIR For all of the directories listed in ${SUBDIR}, the
and other special sources.
=-=-=-=-= bsd.sys.mk =-=-=-=-=
The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
<bsd.lib.mk>. It contains overrides that are used when building
the NetBSD source tree.
The following variables control how various files are compiled/built.
(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
AR Create, modify, and extract from archives. [ar]
ARFLAGS Options to ${AR}. [rl]
AS Assembler. [as]
AFLAGS Options to ${CC} when compiling or linking .s or .S
assembly source files. []
BUILDSEED GCC uses random numbers when compiling C++ code.
If this option is present, seed the random number
generator based on the value, source file names and
the output file name to make builds more deterministic.
Additional information is available in the GCC
documentation of -frandom-seed.
CC C compiler. [cc]
CFLAGS Options to ${CC}. [Usually -O or -O2]
CPP C Pre-Processor. [cpp]
CPPFLAGS Options to ${CPP}. []
CPUFLAGS Optimization flags for ${CC}. []
CXX C++ compiler. [c++]
CXXFLAGS Options to ${CXX}. [${CFLAGS}]
ELF2ECOFF Convert ELF-format executable to ECOFF. [elf2ecoff]
FC Fortran compiler. [f77]
FFLAGS Options to {$FC}. [-O]
HOST_SH Shell. This must be an absolute path, because it may be
substituted into "#!" lines in scripts. [/bin/sh]
INSTALL install(1) command. [install]
LEX Lexical analyzer. [lex]
LFLAGS Options to ${LEX}. []
LPREFIX Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
LD Linker. [ld]
LDFLAGS Options to ${CC} during the link process. []
LINT C program verifier. [lint]
LINTFLAGS Options to ${LINT}. [-chapbxzFS]
LORDER List dependencies for object files. [lorder]
MAKE make(1). [make]
MKDEP Construct Makefile dependency list. [mkdep]
MKDEPCXX Construct Makefile dependency list for C++ files. [mkdep]
NM List symbols from object files. [nm]
PC Pascal compiler. [pc] (Not present)
PFLAGS Options to ${PC}. []
OBJC Objective C compiler. [${CC}]
OBJCFLAGS Options to ${OBJC}. [${CFLAGS}]
OBJCOPY Copy and translate object files. [objcopy]
OBJCOPYLIBFLAGS Flags to pass to objcopy when library objects are
being built. [${.TARGET} =~ "*.po" ? -X : -x]
OBJDUMP Display information from object files. [objdump]
RANLIB Generate index to archive. [ranlib]
SIZE List section sizes and total size. [size]
STRIP Discard symbols from object files. [strip]
TSORT Topological sort of a directed graph. [tsort -q]
YACC LALR(1) parser generator. [yacc]
YFLAGS Options to ${YACC}. []
YHEADER If defined, add "-d" to YFLAGS, and add dependencies
from <file>.y to <file>.h and <file>.c, and add
<foo>.h to CLEANFILES.
YPREFIX If defined, add "-p ${YPREFIX}" to YFLAGS.
Other variables of note (incomplete list):
NOGCCERROR If defined, prevents passing certain ${CFLAGS} to GCC
that cause warnings to be fatal, such as:
-Werror -Wa,--fatal-warnings
(The latter being for as(1).)
NOCLANGERROR If defined and clang is used as C compiler, -Werror is not
passed to it.
WARNS Crank up compiler warning options; the distinct levels are:
WARNS=1
WARNS=2
WARNS=3
WARNS=4
WARNS=5
=-=-=-=-= bsd.x11.mk =-=-=-=-=
The include file <bsd.x11.mk> contains parameters and targets for
cross-building X11 from ${X11SRCDIR.xc} / ${X11MITSRCDIR.*}.
It should be included after the general Makefile contents but before
the include files such as <bsd.prog.mk> and <bsd.lib.mk>.
cross-building X11 from ${X11SRCDIR.<package>}. It should be included
after the general Makefile contents but before the include files such as
<bsd.prog.mk> and <bsd.lib.mk>.
It provides the following targets:
.man.1 .man.3 .man.4 .man.5 .man.7:
@@ -1928,4 +1843,190 @@ CPPSCRIPTFLAGS Additional flags to cpp(1) when building CPPSCRIPTS.
CPPSCRIPTFLAGS_<fn> Additional flags to cpp(1) when building CPPSCRIPT <fn>.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following files are described here for completion, but they are not
supposed to be included directly from other Makefiles; they are used
internally by other system files.
=-=-=-=-= bsd.sys.mk =-=-=-=-=
The include file <bsd.sys.mk> is used by other system mk files and
it is not intended to be included standalone. It contains rules and
system build variables. It requires bsd.own.mk to be included first.
It contains overrides that are used when building the NetBSD source tree.
The following variables control how various files are compiled/built.
(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
AR Create, modify, and extract from archives. [ar]
ARFLAGS Options to ${AR}. [rl]
AS Assembler. [as]
AFLAGS Options to ${CC} when compiling or linking .s or .S
assembly source files. []
BUILDSEED GCC uses random numbers when compiling C++ code.
If this option is present, seed the random number
generator based on the value, source file names and
the output file name to make builds more deterministic.
Additional information is available in the GCC
documentation of -frandom-seed.
CC C compiler. [cc]
CFLAGS Options to ${CC}. [Usually -O or -O2]
CPP C Pre-Processor. [cpp]
CPPFLAGS Options to ${CPP}. []
CPUFLAGS Optimization flags for ${CC}. []
CXX C++ compiler. [c++]
CXXFLAGS Options to ${CXX}. [${CFLAGS}]
ELF2ECOFF Convert ELF-format executable to ECOFF. [elf2ecoff]
FC Fortran compiler. [f77]
FFLAGS Options to {$FC}. [-O]
HOST_SH Shell. This must be an absolute path, because it may be
substituted into "#!" lines in scripts. [/bin/sh]
INSTALL install(1) command. [install]
LEX Lexical analyzer. [lex]
LFLAGS Options to ${LEX}. []
LPREFIX Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
LD Linker. [ld]
LDFLAGS Options to ${CC} during the link process. []
LINT C program verifier. [lint]
LINTFLAGS Options to ${LINT}. [-chapbxzgFS]
LORDER List dependencies for object files. [lorder]
MAKE make(1). [make]
MKDEP Construct Makefile dependency list. [mkdep]
MKDEPCXX Construct Makefile dependency list for C++ files. [mkdep]
NM List symbols from object files. [nm]
PC Pascal compiler. [pc] (Not present)
PFLAGS Options to ${PC}. []
OBJC Objective C compiler. [${CC}]
OBJCFLAGS Options to ${OBJC}. [${CFLAGS}]
OBJCOPY Copy and translate object files. [objcopy]
OBJCOPYLIBFLAGS Flags to pass to objcopy when library objects are
being built. [${.TARGET} =~ "*.po" ? -X : -x]
OBJDUMP Display information from object files. [objdump]
RANLIB Generate index to archive. [ranlib]
READELF Display information from ELF object files. [readelf]
SIZE List section sizes and total size. [size]
STRINGS Display printable character sequences in files. [strings]
STRIP Discard symbols from object files. [strip]
TSORT Topological sort of a directed graph. [tsort -q]
YACC LALR(1) parser generator. [yacc]
YFLAGS Options to ${YACC}. []
YHEADER If defined, add "-d" to YFLAGS, and add dependencies
from <file>.y to <file>.h and <file>.c, and add
<foo>.h to CLEANFILES.
YPREFIX If defined, add "-p ${YPREFIX}" to YFLAGS.
Other variables of note (incomplete list):
NOGCCERROR If defined, prevents passing certain ${CFLAGS} to GCC
that cause warnings to be fatal, such as:
-Werror -Wa,--fatal-warnings
(The latter being for as(1).)
NOCLANGERROR If defined and clang is used as C compiler, -Werror is not
passed to it.
WARNS Crank up compiler warning options; the distinct levels are:
WARNS=1
WARNS=2
WARNS=3
WARNS=4
WARNS=5
WARNS=6
=-=-=-=-= bsd.host.mk =-=-=-=-=
This file is automatically included from bsd.own.mk. It contains settings
for all the HOST_* variables that are used in host programs and libraries.
HOST_AR The host archive processing command
HOST_CC The host c compiler
HOST_CFLAGS The host c compiler flags
HOST_COMPILE.c The host c compiler line with flags
HOST_COMPILE.cc The host c++ compiler line with flags
HOST_CPP The host c pre-processor
HOST_CPPFLAGS The cost c pre-processor flags
HOST_CXX The host c++ compiler
HOST_CXXFLAGS The host c++ compiler flags
HOST_INSTALL_DIR The host command to install a directory
HOST_INSTALL_FILE The host command to install a file
HOST_INSTALL_SYMLINK The host command to install a symlink
HOST_LD The host linker command
HOST_LDFLAGS The host linker flags
HOST_LINK.c The host c linker line with flags
HOST_LINK.cc The host c++ linker line with flags
HOST_LN The host command to link two files
HOST_MKDEP The host command to create dependencies for c programs
HOST_MKDEPCXX The host command to create dependencies for c++ programs
HOST_OSTYPE The host OSNAME-RELEASE-ARCH tupple
HOST_RANLIB The host command to create random access archives
HOST_SH The host Bourne shell interpreter name (absolute path)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+21 -6
View File
@@ -1,4 +1,18 @@
# $NetBSD: bsd.dep.mk,v 1.79 2013/10/31 01:55:03 mrg Exp $
# $NetBSD: bsd.dep.mk,v 1.82 2014/12/01 01:34:30 erh Exp $
.if defined(__MINIX)
#LSC: Be a bit smarter about the default compiler
.if exists(/usr/pkg/bin/clang) || exists(/usr/bin/clang)
CC?= clang
.endif
.if exists(/usr/pkg/bin/gcc) || exists(/usr/bin/gcc)
CC?= gcc
.endif
MKDEP?= CC=${CC:Q} mkdep
MKDEPCXX?= CC=${CXX:Q} mkdep
.endif # defined(__MINIX)
##### Basic targets
realdepend: beforedepend .depend afterdepend
@@ -7,9 +21,9 @@ realdepend: beforedepend .depend afterdepend
beforedepend .depend afterdepend: # ensure existence
##### Default values
MKDEP?= CC=${CC:Q} mkdep
MKDEPCXX?= CC=${CXX:Q} mkdep
MKDEP_SUFFIXES?= .o
MKDEP?= mkdep
MKDEPCXX?= mkdep
MKDEP_SUFFIXES?= .o .d
##### Build rules
# some of the rules involve .h sources, so remove them from mkdep line
@@ -78,7 +92,7 @@ _MKDEP_FILEFLAGS=
.c.d:
${_MKTARGET_CREATE}
${MKDEP} -f ${.TARGET}.tmp ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CFLAGS:M-std=*} ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \
${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} && \
mv ${.TARGET}.tmp ${.TARGET}
@@ -102,7 +116,7 @@ _MKDEP_FILEFLAGS=
.C.d .cc.d .cpp.d .cxx.d:
${_MKTARGET_CREATE}
${MKDEPCXX} -f ${.TARGET}.tmp ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CXXFLAGS:M-std=*} ${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \
${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} && \
mv ${.TARGET}.tmp ${.TARGET}
@@ -118,6 +132,7 @@ CLEANDIRFILES+= .depend ${__DPSRCS.d} ${__DPSRCS.d:.d=.d.tmp} ${.CURDIR}/tags ${
.if !target(tags)
tags: ${SRCS}
.if defined(SRCS) && !empty(SRCS)
${_MKTARGET_CREATE}
-cd "${.CURDIR}"; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
${TOOL_SED} "s;\${.CURDIR}/;;" > tags
.endif
+194 -48
View File
@@ -1,72 +1,218 @@
# $NetBSD: bsd.doc.mk,v 1.64 2006/03/16 18:43:34 jwise Exp $
# $NetBSD: bsd.doc.mk,v 1.68 2015/08/04 08:36:14 dholland Exp $
# @(#)bsd.doc.mk 8.1 (Berkeley) 8/14/93
.include <bsd.init.mk>
##### Basic targets
clean: cleandoc
realinstall: docinstall
# The makefile should set these:
# SECTION one of usd, smm, or psd (lower-case)
# ARTICLE name of this document
# SRCS roff source files
# DEPSRCS additional roff source files implicitly included
# MACROS name(s) of roff macro packages, including the -m
# ROFF_PIC set to "yes" to use pic(1)
# ROFF_EQN set to "yes" to use eqn(1)
# ROFF_TBL set to "yes" to use tbl(1)
# ROFF_REFER set to "yes" to use refer(1)
# EXTRAHTMLFILES additional files emitted as part of HTML build
#
# PAGES unknown (XXX)
# EXTRA extra files to install (XXX)
#
# If there are multiple docs to be generated, set these:
# SUBARTICLES= name1 name2 ...
# SRCS.name1= roff source files
# SRCS.name2= more roff source files
# SRCS. : = :
# DEPSRCS.name1= additional included roff source files
# DEPSRCS.name2= more additional included roff source files
# DEPSRCS. : = :
#
# I'm hoping that MACROS and ROFF_* can be uniform across all
# subarticles.
##### Build rules
.if !target(paper.ps)
paper.ps: ${SRCS}
${_MKTARGET_FORMAT}
${TOOL_ROFF_PS} ${MACROS} ${PAGES} ${.ALLSRC} > ${.TARGET}
# Old bsd.doc.mk files tend to invoke tbl and other preprocessors
# directly; they should be changed to set ROFF_* instead.
#
# Also they set e.g. DIR=usd/72.mydocument; this should be changed
# to SECTION=usd and ARTICLE=mydocument. The article numbers are
# no longer present in the file system and do not need to be known
# at build time.
#
# 20130908 dholland: Make sure all makefiles have been converted to the
# new scheme.
.if !defined(SECTION)
.error "bsd.doc.mk: SECTION must be defined"
.endif
.if target(paper.ps)
.error "bsd.doc.mk: target(paper.ps) is true -- this is not allowed"
.endif
.if ${MKSHARE} != "no"
realall: paper.ps
.endif
# 20130908 dholland: right now we cannot generate pdf from roff sources,
# so build compressed postscript instead. XXX. (and: yech)
TOOL_ROFF_PDF?=false "No roff pdf support"
PRINTABLE=ps.gz
#PRINTABLE=ps
#PRINTABLE=pdf
##### Install rules
docinstall:: # ensure existence
.PHONY: docinstall
# If there aren't subarticles, we generate one doc that has the same
# name as the top-level article.
SUBARTICLES?=${ARTICLE}
SRCS.${ARTICLE}?=${SRCS}
DEPSRCS.${ARTICLE}?=${DEPSRCS}
##### Build
.for SA in ${SUBARTICLES}
.if ${MKDOC} != "no"
__docinstall: .USE
${_MKTARGET_INSTALL}
${INSTALL_FILE} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \
${.ALLSRC} ${.TARGET}
FILES?= ${SRCS}
.for F in Makefile ${FILES:O:u} ${EXTRA}
_F:= ${DESTDIR}${DOCDIR}/${DIR}/${F} # installed path
.if ${MKUPDATE} == "no"
${_F}! ${F} __docinstall # install rule
.if !defined(BUILD) && !make(all) && !make(${F})
${_F}! .MADE # no build at install
.endif
.else
${_F}: ${F} __docinstall # install rule
.if !defined(BUILD) && !make(all) && !make(${F})
${_F}: .MADE # no build at install
realall: ${SA}.txt
realall: ${SA}.${PRINTABLE}
.if ${MKHTML} != "no" && ${MKGROFFHTMLDOC} != "no"
realall: ${SA}.html
.endif
.endif
.endfor # SUBARTICLES
docinstall:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.if defined(ROFF_PIC) && ${ROFF_PIC} != "no"
ROFFFLAGS+=-p
.endif
.if defined(ROFF_EQN) && ${ROFF_EQN} != "no"
ROFFFLAGS+=-e
.endif
.if defined(ROFF_TBL) && ${ROFF_TBL} != "no"
ROFFFLAGS+=-t
.endif
.if defined(ROFF_REFER) && ${ROFF_REFER} != "no"
ROFFFLAGS+=-R
.endif
ROFFFLAGS+=-I${.CURDIR}
.for SA in ${SUBARTICLES}
#
# Find the sources.
#
# We can't use .IMPSRC in the rules because they aren't suffix rules
# (they could be for some docs, but not others) and we can't use
# .ALLSRC because that includes DEPSRCS.
#
# As far as I know, the only ways to get the path discovered via .PATH
# are those two magic variables or the P modifier.
#
# For some reason the P modifier finds the path to a variable name,
# not the path to a word in a variable.
#
.for S in ${SRCS.${SA}}
SRCS2.${SA}+=${${S}:P}
.endfor
.for S in ${DEPSRCS.${SA}}
DEPSRCS2.${SA}+=${${S}:P}
.endfor
.undef _F
.endif # ${MKDOC} != "no"
#
# Note: we use TOOL_ROFF_DOCASCII because TOOL_ROFF_ASCII invokes
# the nroff wrapper instead of groff directly, and that doesn't
# understand -I.
#
# We use TOOL_ROFF_DOCHTML because TOOL_ROFF_HTML uses -mdoc2html,
# which is great if it works but doesn't work with at least some of
# the non-mdoc docs. (e.g. the curses one) TOOL_ROFF_DOCHTML uses
# groff -Thtml, which produces fairly blah output but works with these
# docs. It might end up being necessary to choose one or the other on
# a per-document basis... sigh.
#
##### Clean rules
cleandoc: .PHONY
rm -f paper.* [eE]rrs mklog ${CLEANFILES}
${SA}.txt: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
${_MKTARGET_FORMAT}
${TOOL_ROFF_DOCASCII} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
> ${.TARGET}
##### Custom rules
.if !target(print)
print: .PHONY paper.ps
lpr -P${PRINTER} ${.ALLSRC}
${SA}.ps: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
${_MKTARGET_FORMAT}
${TOOL_ROFF_PS} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
| ${TOOL_SED} -e '/^%%CreationDate:/d' \
> ${.TARGET}
${SA}.pdf: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
${_MKTARGET_FORMAT}
${TOOL_ROFF_PDF} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
> ${.TARGET}
${SA}.html: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
${_MKTARGET_FORMAT}
${TOOL_ROFF_DOCHTML} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
-P -I -P ${SA} \
> ${.TARGET}
${SA}.ps.gz: ${SA}.ps
${TOOL_GZIP} -9 -c -n ${.ALLSRC} > ${.TARGET}
.endfor # SUBARTICLES
##### Install
DOCINST:=
.for SA in ${SUBARTICLES}
DOCINST+=${SA}.txt ${SA}.${PRINTABLE}
.if ${MKHTML} != "no" && ${MKGROFFHTMLDOC} != "no"
DOCINST+=${SA}.html
.endif
.endfor
.if ${MKHTML} != "no" && ${MKGROFFHTMLDOC} != "no"
DOCINST+=${EXTRAHTMLFILES}
.endif
spell: .PHONY ${SRCS}
spell ${.ALLSRC} | sort | comm -23 - spell.ok > paper.spell
.if ${MKDOC} != "no"
docinstall:
.for D in ${DOCINST}
${_MKTARGET_INSTALL}
${INSTALL_FILE} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} ${D} \
${DESTDIR}${DOCDIR}/${SECTION}/${ARTICLE}/${D}
.endfor
.else
docinstall: ;
.endif
.PHONY: docinstall
realinstall: docinstall
##### Clean
cleandoc:
.for SA in ${SUBARTICLES}
rm -f ${SA}.txt ${SA}.ps ${SA}.ps.gz ${SA}.html
.endfor
rm -f ${EXTRAHTMLFILES} [eE]rrs mklog ${CLEANFILES}
.PHONY: cleandoc
clean: cleandoc
##### Extra custom rules
.if !target(print)
print: ;
.PHONY: print
.for SA in ${SUBARTICLES}
print: print.${SA}
.PHONY: print.{SA}
print.${SA}: ${SA}.ps
lpr -P${PRINTER} ${.ALLSRC}
.endfor
.endif
spell: ;
.PHONY: spell
.for SA in ${SUBARTICLES}
spell: spell.${SA}
.PHONY: spell.{SA}
spell.${SA}: ${SRCS2} ${DEPSRCS2}
spell ${SRCS2} | sort | comm -23 - spell.ok > paper.spell
.endfor
##### Pull in related .mk logic
.include <bsd.obj.mk>
.include <bsd.sys.mk>
+6 -2
View File
@@ -1,16 +1,19 @@
# $NetBSD: bsd.endian.mk,v 1.19 2013/08/05 15:33:07 matt Exp $
# $NetBSD: bsd.endian.mk,v 1.22 2014/09/19 17:45:42 matt Exp $
.if !defined(_BSD_ENDIAN_MK_)
_BSD_ENDIAN_MK_=1
.include <bsd.init.mk>
.if ${MACHINE_ARCH} == "alpha" || \
.if ${MACHINE_ARCH} == "aarch64" || \
${MACHINE_ARCH} == "alpha" || \
${MACHINE_ARCH} == "arm" || \
(!empty(MACHINE_ARCH:Mearm*) && empty(MACHINE_ARCH:Mearm*eb)) || \
${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "ia64" || \
${MACHINE_ARCH} == "vax" || \
${MACHINE_ARCH} == "riscv32" || \
${MACHINE_ARCH} == "riscv64" || \
${MACHINE_ARCH} == "x86_64" || \
${MACHINE_ARCH:C/^.*el$/el/} == "el"
TARGET_ENDIANNESS= 1234
@@ -18,6 +21,7 @@ TARGET_ENDIANNESS= 1234
${MACHINE_ARCH} == "hppa" || \
${MACHINE_ARCH} == "m68000" || \
${MACHINE_ARCH} == "m68k" || \
${MACHINE_ARCH} == "or1k" || \
${MACHINE_ARCH} == "powerpc" || \
${MACHINE_ARCH} == "powerpc64" || \
${MACHINE_ARCH} == "sparc" || \
+9 -9
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.gcc.mk,v 1.10 2012/12/10 23:49:39 pooka Exp $
# $NetBSD: bsd.gcc.mk,v 1.11 2015/06/07 15:04:28 matt Exp $
.if !defined(_BSD_GCC_MK_)
_BSD_GCC_MK_=1
@@ -21,14 +21,14 @@ _GCC_CRTN!= ${CC} --print-file-name=crtn.o
_GCC_CRTDIR!= dirname ${_GCC_CRTBEGIN}
_GCC_LIBGCCDIR!= dirname `${CC} --print-libgcc-file-name`
.else
_GCC_CRTBEGIN?= ${DESTDIR}/usr/lib/crtbegin.o
_GCC_CRTBEGINS?= ${DESTDIR}/usr/lib/crtbeginS.o
_GCC_CRTEND?= ${DESTDIR}/usr/lib/crtend.o
_GCC_CRTENDS?= ${DESTDIR}/usr/lib/crtendS.o
_GCC_CRTI?= ${DESTDIR}/usr/lib/crti.o
_GCC_CRTN?= ${DESTDIR}/usr/lib/crtn.o
_GCC_CRTDIR?= ${DESTDIR}/usr/lib
_GCC_LIBGCCDIR?= ${DESTDIR}/usr/lib
_GCC_CRTBEGIN?= ${DESTDIR}/usr/lib/${MLIBDIR:D${MLIBDIR}/}crtbegin.o
_GCC_CRTBEGINS?= ${DESTDIR}/usr/lib/${MLIBDIR:D${MLIBDIR}/}crtbeginS.o
_GCC_CRTEND?= ${DESTDIR}/usr/lib/${MLIBDIR:D${MLIBDIR}/}crtend.o
_GCC_CRTENDS?= ${DESTDIR}/usr/lib/${MLIBDIR:D${MLIBDIR}/}crtendS.o
_GCC_CRTI?= ${DESTDIR}/usr/lib/${MLIBDIR:D${MLIBDIR}/}crti.o
_GCC_CRTN?= ${DESTDIR}/usr/lib/${MLIBDIR:D${MLIBDIR}/}crtn.o
_GCC_CRTDIR?= ${DESTDIR}/usr/lib${MLIBDIR:D/${MLIBDIR}}
_GCC_LIBGCCDIR?= ${DESTDIR}/usr/lib${MLIBDIR:D/${MLIBDIR}}
.endif
.endif # ! defined(_BSD_GCC_MK_)
+76
View File
@@ -0,0 +1,76 @@
# $NetBSD: bsd.host.mk,v 1.2 2014/04/10 19:02:18 plunky Exp $
.if !defined(_BSD_HOST_MK_)
_BSD_HOST_MK_=1
.if ${HOST_OSTYPE:C/\-.*//:U} == "Minix"
HOST_LDFLAGS?= -static
#LSC: Be a bit smarter about the default compiler
.if exists(/usr/pkg/bin/clang) || exists(/usr/bin/clang)
HOST_CC?= clang
.endif
.if exists(/usr/pkg/bin/gcc) || exists(/usr/bin/gcc)
HOST_CC?= gcc
.endif
.endif # ${HOST_OSTYPE:C/\-.*//:U} == "Minix"
# Helpers for cross-compiling
HOST_CC?= cc
HOST_CFLAGS?= -O
HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
HOST_COMPILE.cc?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} -c
HOST_LINK.cc?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
.if defined(HOSTPROG_CXX)
HOST_LINK.c?= ${HOST_LINK.cc}
.else
HOST_LINK.c?= ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
.endif
HOST_CXX?= c++
HOST_CXXFLAGS?= -O
HOST_CPP?= cpp
HOST_CPPFLAGS?=
HOST_LD?= ld
HOST_LDFLAGS?=
HOST_AR?= ar
HOST_RANLIB?= ranlib
HOST_LN?= ln
# HOST_SH must be an absolute path
HOST_SH?= /bin/sh
.if !defined(HOST_OSTYPE)
_HOST_OSNAME!= uname -s
_HOST_OSREL!= uname -r
# For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints
# something that does not look like an identifier, then use uname -m.
_HOST_ARCH!= uname -p 2>/dev/null
_HOST_ARCH:= ${HOST_ARCH:tW:C/.*[^-_A-Za-z0-9].*//:S/unknown//}
.if empty(_HOST_ARCH)
_HOST_ARCH!= uname -m
.endif
HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g}
.MAKEOVERRIDES+= HOST_OSTYPE
.endif # !defined(HOST_OSTYPE)
.if ${USETOOLS} == "yes"
HOST_MKDEP?= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
HOST_MKDEPCXX?= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
.else
HOST_MKDEP?= CC=${HOST_CC:Q} mkdep
HOST_MKDEPCXX?= CC=${HOST_CXX:Q} mkdep
.endif
.if ${NEED_OWN_INSTALL_TARGET} != "no"
HOST_INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
HOST_INSTALL_DIR?= ${INSTALL} -d
HOST_INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} ${RENAME}
.endif
.endif
+2 -4
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.hostlib.mk,v 1.17 2013/10/29 16:11:46 joerg Exp $
# $NetBSD: bsd.hostlib.mk,v 1.19 2014/12/01 01:34:30 erh Exp $
.include <bsd.init.mk>
.include <bsd.sys.mk>
@@ -7,9 +7,7 @@
##### Default values
CFLAGS+= ${COPTS}
HOST_MKDEP?= CC=${HOST_CC:Q} mkdep
HOST_MKDEPCXX?= CC=${HOST_CXX:Q} mkdep
MKDEP_SUFFIXES?= .o .lo
MKDEP_SUFFIXES?= .o .lo .d
# Override these:
MKDEP:= ${HOST_MKDEP}
+2 -4
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.hostprog.mk,v 1.72 2013/10/29 16:11:46 joerg Exp $
# $NetBSD: bsd.hostprog.mk,v 1.74 2014/12/01 01:34:30 erh Exp $
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
.include <bsd.init.mk>
@@ -81,9 +81,7 @@ LIBRUMPFS_TMPFS?= /usr/lib/librumpfs_tmpfs.a
LIBRUMPFS_UDF?= /usr/lib/librumpfs_udf.a
LIBRUMPFS_UFS?= /usr/lib/librumpfs_ufs.a
HOST_MKDEP?= CC=${HOST_CC:Q} mkdep
HOST_MKDEPCXX?= CC=${HOST_CXX:Q} mkdep
MKDEP_SUFFIXES?= .lo .ln
MKDEP_SUFFIXES?= .lo .ln .d
# Override these:
INSTALL:= ${INSTALL:NSTRIP=*}
+3 -2
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.ioconf.mk,v 1.4 2013/09/20 16:39:14 pooka Exp $
# $NetBSD: bsd.ioconf.mk,v 1.5 2014/11/30 15:53:29 uebayasi Exp $
#
.include <bsd.own.mk>
@@ -18,7 +18,8 @@
CONFIGDEP=${TOOL_CONFIG}
.endif
ioconf.c: ${IOCONF} ${CONFIGDEP}
${TOOL_CONFIG} -b ${.OBJDIR} -s ${S} ${IOCONFDIR:U${.CURDIR}}/${IOCONF}
${TOOL_CONFIG} ${CONFIGOPTS} -b ${.OBJDIR} -s ${S} \
${IOCONFDIR:U${.CURDIR}}/${IOCONF}
# config doesn't change the files if they're unchanged. however,
# here we want to satisfy our make dependency, so force a
# timestamp update
+18 -12
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.klinks.mk,v 1.11 2013/08/21 15:26:44 matt Exp $
# $NetBSD: bsd.klinks.mk,v 1.13 2014/08/10 05:57:31 matt Exp $
#
.include <bsd.own.mk>
@@ -27,6 +27,8 @@ CLEANFILES+= x86
CLEANFILES+= x86 i386
.elif ${KLINK_MACHINE} == "evbmips"
CLEANFILES+= algor sbmips
.elif ${MACHINE_CPU} == "aarch64"
CLEANFILES+= arm
.endif
.if defined(XEN_BUILD) || ${KLINK_MACHINE} == "xen"
@@ -41,41 +43,45 @@ CLEANFILES+= x86
# XXX .BEGIN is used to make sure the links are done before anything else.
.if !make(obj) && !make(clean) && !make(cleandir)
.BEGIN:
@rm -f machine && \
-@rm -f machine && \
ln -s $S/arch/${KLINK_MACHINE}/include machine
@rm -f ${KLINK_MACHINE} && \
-@rm -f ${KLINK_MACHINE} && \
ln -s $S/arch/${KLINK_MACHINE}/include ${KLINK_MACHINE}
@if [ -d $S/arch/${MACHINE_CPU} ]; then \
-@if [ -d $S/arch/${MACHINE_CPU} ]; then \
rm -f ${MACHINE_CPU} && \
ln -s $S/arch/${MACHINE_CPU}/include ${MACHINE_CPU}; \
fi
# XXX. it gets worse..
.if ${KLINK_MACHINE} == "sun2" || ${KLINK_MACHINE} == "sun3"
@rm -f sun68k && \
-@rm -f sun68k && \
ln -s $S/arch/sun68k/include sun68k
.endif
.if ${KLINK_MACHINE} == "sparc64"
@rm -f sparc && \
-@rm -f sparc && \
ln -s $S/arch/sparc/include sparc
.endif
.if ${KLINK_MACHINE} == "amd64"
@rm -f i386 && \
-@rm -f i386 && \
ln -s $S/arch/i386/include i386
.endif
.if ${MACHINE_CPU} == "i386" || ${MACHINE_CPU} == "x86_64"
@rm -f x86 && \
-@rm -f x86 && \
ln -s $S/arch/x86/include x86
.endif
.if ${MACHINE_CPU} == "aarch64"
-@rm -f arm && \
ln -s $S/arch/arm/include arm
.endif
.if defined(XEN_BUILD) || ${KLINK_MACHINE} == "xen"
@rm -f xen && \
-@rm -f xen && \
ln -s $S/arch/xen/include xen
@rm -rf xen-ma && mkdir xen-ma && \
-@rm -rf xen-ma && mkdir xen-ma && \
ln -s ../${XEN_BUILD:U${MACHINE_ARCH}} xen-ma/machine
.endif
.if ${KLINK_MACHINE} == "evbmips"
@rm -f algor && \
-@rm -f algor && \
ln -s $S/arch/algor/include algor
@rm -f sbmips && \
-@rm -f sbmips && \
ln -s $S/arch/sbmips/include sbmips
.endif
.endif
+48 -11
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.kmodule.mk,v 1.41 2013/11/09 22:40:15 jmcneill Exp $
# $NetBSD: bsd.kmodule.mk,v 1.55 2015/07/09 14:50:08 matt Exp $
# We are not building this with PIE
MKPIE=no
@@ -11,6 +11,7 @@ MKPIE=no
realinstall: kmodinstall
KERN= $S/kern
MKLDSCRIPT?= no
CFLAGS+= -ffreestanding ${COPTS}
CPPFLAGS+= -nostdinc -I. -I${.CURDIR} -isystem $S -isystem $S/arch
@@ -31,14 +32,23 @@ CFLAGS+= -fno-common -fno-unwind-tables
.elif ${MACHINE_CPU} == "hppa"
CFLAGS+= -mlong-calls
.elif ${MACHINE_CPU} == "powerpc"
CFLAGS+= -mlongcall
CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mlongcall :}
.elif ${MACHINE_CPU} == "vax"
CFLAGS+= -fno-pic
.elif ${MACHINE_CPU} == "riscv"
CFLAGS+= -fPIC -Wa,-fno-pic
.elif ${MACHINE_ARCH} == "mips64eb" && !defined(BSD_MK_COMPAT_FILE)
CFLAGS+= -mabi=64
LDFLAGS+= -Wl,-m,elf64btsmip
.elif ${MACHINE_ARCH} == "mips64el" && !defined(BSD_MK_COMPAT_FILE)
CFLAGS+= -mabi=64
LDFLAGS+= -Wl,-m,elf64ltsmip
.endif
.if ${MACHINE} == "sparc64"
.if ${MACHINE_CPU} == "sparc64"
# force same memory model as rest of the kernel
CFLAGS+= -mcmodel=medlow
CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mcmodel=medlow :}
CFLAGS+= ${${ACTIVE_CC} == "clang":? -mcmodel=small :}
.endif
# evbppc needs some special help
@@ -69,9 +79,15 @@ DPSRCS+= ${_YKMSRCS}
CLEANFILES+= ${_YKMSRCS}
.if exists($S/../sys/modules/xldscripts/kmodule)
KMODSCRIPT= $S/../sys/modules/xldscripts/kmodule
KMODSCRIPTSRC= $S/../sys/modules/xldscripts/kmodule
.else
KMODSCRIPT= ${DESTDIR}/usr/libdata/ldscripts/kmodule
KMODSCRIPTSRC= ${DESTDIR}/usr/libdata/ldscripts/kmodule
.endif
.if ${MKLDSCRIPT} == "yes"
KMODSCRIPT= kldscript
MKLDSCRIPTSH=
.else
KMODSCRIPT= ${KMODSCRIPTSRC}
.endif
PROG?= ${KMOD}.kmod
@@ -97,9 +113,16 @@ NODPSRCS+= ${f}
${XOBJS}: ${DPSRCS}
.endif
${PROG}: ${XOBJS} ${XSRCS} ${DPSRCS} ${DPADD}
${_MKTARGET_LINK}
.if ${MKLDSCRIPT} == "yes"
${KMODSCRIPT}: ${KMODSCRIPTSRC} ${XOBJS} $S/conf/mkldscript.sh
@rm -f ${.TARGET}
@OBJDUMP=${OBJDUMP} ${HOST_SH} $S/conf/mkldscript.sh \
-t ${KMODSCRIPTSRC} ${XOBJS} > ${.TARGET}
.endif
${PROG}: ${XOBJS} ${XSRCS} ${DPSRCS} ${DPADD} ${KMODSCRIPT}
${CC} ${LDFLAGS} -nostdlib -MD -combine -r -Wl,-T,${KMODSCRIPT},-d \
-Wl,-Map=${.TARGET}.map \
-o ${.TARGET} ${CFLAGS} ${CPPFLAGS} ${XOBJS} \
${XSRCS:@.SRC.@${.ALLSRC:M*.c:M*${.SRC.}}@:O:u} && \
echo '.-include "${KMOD}.d"' > .depend
@@ -109,6 +132,13 @@ OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
${OBJS} ${LOBJS}: ${DPSRCS}
.if ${MKLDSCRIPT} == "yes"
${KMODSCRIPT}: ${KMODSCRIPTSRC} ${OBJS} $S/conf/mkldscript.sh
@rm -f ${.TARGET}
@OBJDUMP=${OBJDUMP} ${HOST_SH} $S/conf/mkldscript.sh \
-t ${KMODSCRIPTSRC} ${OBJS} > ${.TARGET}
.endif
.if ${MACHINE_CPU} == "arm"
# The solution to limited branch space involves generating trampolines for
# those relocations while creating the module, as the resulting code will
@@ -134,18 +164,21 @@ ${KMOD}_tramp.S: ${KMOD}_tmp.o ${ARCHDIR}/kmodtramp.awk ${ASM_H}
${PROG}: ${KMOD}_tmp.o ${KMOD}_tramp.o
${_MKTARGET_LINK}
.if exists(${ARCHDIR}/kmodhide.awk)
${LD} -r -o tmp.o ${KMOD}_tmp.o ${KMOD}_tramp.o
${LD} -r -Map=${.TARGET}.map \
-o tmp.o ${KMOD}_tmp.o ${KMOD}_tramp.o
${OBJCOPY} \
`${NM} tmp.o | ${TOOL_AWK} -f ${ARCHDIR}/kmodhide.awk` \
tmp.o ${.TARGET} && \
rm tmp.o
.else
${LD} -r -o ${.TARGET} ${KMOD}_tmp.o ${KMOD}_tramp.o
${LD} -r -Map=${.TARGET}.map \
-o ${.TARGET} ${KMOD}_tmp.o ${KMOD}_tramp.o
.endif
.else
${PROG}: ${OBJS} ${DPADD}
${PROG}: ${OBJS} ${DPADD} ${KMODSCRIPT}
${_MKTARGET_LINK}
${CC} ${LDFLAGS} -nostdlib -r -Wl,-T,${KMODSCRIPT},-d \
-Wl,-Map=${.TARGET}.map \
-o ${.TARGET} ${OBJS}
.endif
.endif
@@ -192,6 +225,10 @@ kmodinstall:: ${_PROG}
##### Clean rules
CLEANFILES+= a.out [Ee]rrs mklog core *.core ${PROG} ${OBJS} ${LOBJS}
CLEANFILES+= ${PROG}.map
.if ${MKLDSCRIPT} == "yes"
CLEANFILES+= kldscript
.endif
##### Custom rules
lint: ${LOBJS}
+32 -18
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.lib.mk,v 1.342 2013/10/18 16:06:52 christos Exp $
# $NetBSD: bsd.lib.mk,v 1.362 2015/09/08 16:06:42 uebayasi Exp $
# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
.include <bsd.init.mk>
@@ -64,7 +64,7 @@ DPADD+= ${LIBDO.${_lib}}/lib${_lib}.so # Don't use _LIB_PREFIX
.endif # }
##### Build and install rules
MKDEP_SUFFIXES?= .o .po .pico .go .ln
MKDEP_SUFFIXES?= .o .po .pico .go .ln .d
.if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE}) # {
SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
@@ -169,7 +169,9 @@ CFLAGS+= -g
# Platform-independent linker flags for ELF shared libraries
SHLIB_SOVERSION= ${SHLIB_MAJOR}
SHLIB_SHFLAGS= -Wl,-soname,${_LIB}.so.${SHLIB_SOVERSION}
.if !defined(SHLIB_WARNTEXTREL) || ${SHLIB_WARNTEXTREL} != "no"
SHLIB_SHFLAGS+= -Wl,--warn-shared-textrel
.endif
.if !defined(SHLIB_MKMAP) || ${SHLIB_MKMAP} != "no"
SHLIB_SHFLAGS+= -Wl,-Map=${_LIB}.so.${SHLIB_SOVERSION}.map
.endif
@@ -185,6 +187,9 @@ FFLAGS+= ${FOPTS}
.if defined(CTFCONVERT)
.if defined(CFLAGS) && !empty(CFLAGS:M*-g*)
CTFFLAGS+= -g
.if defined(HAVE_GCC) && ${HAVE_GCC} >= 48
#CFLAGS+= -gdwarf-2
.endif
.endif
.endif
@@ -425,6 +430,7 @@ _LIB_bc.a:=${_LIB}_bc.a
_LIB.so:=${_LIB}.so
_LIB.so.major:=${_LIB}.so.${SHLIB_MAJOR}
_LIB.so.full:=${_LIB}.so.${SHLIB_FULLVERSION}
_LIB.so.link:=${_LIB}.so.${SHLIB_FULLVERSION}.link
.if ${MKDEBUG} != "no"
_LIB.so.debug:=${_LIB.so.full}.debug
.endif
@@ -463,7 +469,7 @@ ${_LIB}_combine.o: ${COMBINESRCS}
${_MKTARGET_COMPILE}
${COMPILE.c} -MD --combine ${.ALLSRC} -o ${.TARGET}
.if defined(LIBSTRIPOBJS)
${OBJCOPY} -x ${.TARGET}
${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
.endif
CLEANFILES+= ${_LIB}_combine.d
@@ -546,7 +552,7 @@ _LIBS+=${_LIB_bc.a}
realall: ${SRCS} ${ALLOBJS:O} ${_LIBS} ${_LIB.so.debug}
MKARZERO?=no
MKARZERO?= ${MKREPRO:Uno}
.if ${MKARZERO} == "yes"
_ARFL=crsD
@@ -656,10 +662,8 @@ LDADD+= ${${ACTIVE_CC} == "gcc":? -lgcc_eh:}
LIBCC:= ${CXX}
. if ${MKLIBCXX} == "yes"
LIBDPLIBS+= c++ ${.CURDIR}/../../../../../external/bsd/libc++/lib
. elif defined(HAVE_GCC) && ${HAVE_GCC} == 4
LIBDPLIBS+= stdc++ ${.CURDIR}/../../../../../gnu/lib/libstdc++-v3_4
. else
LIBDPLIBS+= stdc++ ${.CURDIR}/../../../../../external/gpl3/gcc/lib/libstdc++-v3
LIBDPLIBS+= stdc++ ${.CURDIR}/../../../../../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
. endif
.else
LIBCC:= ${CC}
@@ -668,8 +672,25 @@ LIBCC:= ${CC}
_LDADD.${_LIB}= ${LDADD} ${LDADD.${_LIB}}
_LDFLAGS.${_LIB}= ${LDFLAGS} ${LDFLAGS.${_LIB}}
${_LIB.so.full}: ${SOLIB} ${DPADD} ${DPLIBC} \
${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
_MAINLIBDEPS= ${SOLIB} ${DPADD} ${DPLIBC} \
${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
.if defined(_LIB.so.debug)
${_LIB.so.debug}: ${_LIB.so.link}
${_MKTARGET_CREATE}
( ${OBJCOPY} --only-keep-debug \
${_LIB.so.link} ${_LIB.so.debug} \
) || (rm -f ${.TARGET}; false)
${_LIB.so.full}: ${_LIB.so.link} ${_LIB.so.debug}
${_MKTARGET_CREATE}
( ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
--add-gnu-debuglink=${_LIB.so.debug} \
${_LIB.so.link} ${_LIB.so.full} \
) || (rm -f ${.TARGET}; false)
${_LIB.so.link}: ${_MAINLIBDEPS}
.else # aka no MKDEBUG
${_LIB.so.full}: ${_MAINLIBDEPS}
.endif
${_MKTARGET_BUILD}
rm -f ${.TARGET}
${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} \
@@ -679,6 +700,8 @@ ${_LIB.so.full}: ${SOLIB} ${DPADD} ${DPLIBC} \
# We don't use INSTALL_SYMLINK here because this is just
# happening inside the build directory/objdir. XXX Why does
# this spend so much effort on libraries that aren't live??? XXX
# XXX Also creates dead symlinks until the .full rule runs
# above and creates the main link
.if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
"${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
${HOST_LN} -sf ${_LIB.so.full} ${_LIB.so.major}.tmp
@@ -690,15 +713,6 @@ ${_LIB.so.full}: ${SOLIB} ${DPADD} ${DPLIBC} \
${OBJCOPY} -R .ident ${.TARGET}
.endif
.if defined(_LIB.so.debug)
${_LIB.so.debug}: ${_LIB.so.full}
${_MKTARGET_CREATE}
( ${OBJCOPY} --only-keep-debug ${_LIB.so.full} ${_LIB.so.debug} \
&& ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
--add-gnu-debuglink=${_LIB.so.debug} ${_LIB.so.full} \
) || (rm -f ${.TARGET}; false)
.endif
.if !empty(LOBJS) # {
LLIBS?= -lc
${_LIB.ln}: ${LOBJS}
+4 -2
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.lua.mk,v 1.6 2013/09/12 15:36:16 joerg Exp $
# $NetBSD: bsd.lua.mk,v 1.7 2014/07/19 18:38:34 lneto Exp $
#
# Build rules and definitions for Lua modules
@@ -48,6 +48,8 @@ _BSD_LUA_MK_=1
.include <bsd.shlib.mk>
.include <bsd.gcc.mk>
#__MINIX: Not always included
.include <bsd.own.mk>
.if defined(__MINIX) && ${USE_BITCODE:Uno} == "yes"
LDFLAGS+= -L${DESTDIR}/usr/lib
.endif # defined(__MINIX) && ${USE_BITCODE:Uno} == "yes"
@@ -68,7 +70,7 @@ CLEANFILES+= a.out [Ee]rrs mklog core *.core
##
##### Global variables
LUA_VERSION?= 5.1
LUA_VERSION?= 5.3
LUA_LIBDIR?= ${LIBDIR}/lua/${LUA_VERSION}
LUAC?= /usr/bin/luac
+16 -5
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.man.mk,v 1.114 2013/10/25 22:16:29 apb Exp $
# $NetBSD: bsd.man.mk,v 1.117 2014/12/19 22:25:39 christos Exp $
# @(#)bsd.man.mk 8.1 (Berkeley) 6/8/93
.include <bsd.init.mk>
@@ -9,6 +9,17 @@
.PHONY: lintmanpages
realinstall: ${MANINSTALL}
# If our install destination is case-preserving, but case-insensitive
# then we do filesystem comparisons in lower case to make sure that
# we always refresh the target when needed. In general we don't
# want to do this, otherwise things like _exit.2 -> _Exit.2 get
# installed on each build even when they don't need to. Note that
# the CASE_INSENSITIVE_DEST macro is currently not defined anywhere,
# and the expansion does not really work because of make(1).
.if defined(CASE_INSENSITIVE_DEST)
_FLATTEN?=tl:
.endif
##### Default values
.if ${USETOOLS} == "yes"
TMACDEPDIR?= ${TOOLDIR}/share/groff/tmac
@@ -40,7 +51,7 @@ _MSECTIONREGEX= ${_MSECTIONS:ts|} # e.g. 1|2|3|...
MANCOMPRESS?=
MANSUFFIX?=
.else
MANCOMPRESS?= ${TOOL_GZIP} -ncf
MANCOMPRESS?= ${TOOL_GZIP_N} -cf
MANSUFFIX?= .gz
.endif
@@ -109,7 +120,7 @@ _t:=${DESTDIR}${MANDIR}/man${_dst:T:E}${MANSUBDIR}/${_dst}${MANSUFFIX}
# Handle case conflicts carefully, when _dst occurs
# more than once after case flattening
.if ${MKUPDATE} == "no" || ${MLINKS:tl:M${_dst:tl:Q}:[\#]} > 1
.if ${MKUPDATE} == "no" || ${MLINKS:${_FLATTEN}M${_dst:${_FLATTEN}Q}:[\#]} > 1
${_t}! ${_l} __linkinstallpage
.else
${_t}: ${_l} __linkinstallpage
@@ -177,7 +188,7 @@ _t:=${DESTDIR}${MANDIR}/cat${_dst:T:E}${MANSUBDIR}/${_dst:R}.0${MANSUFFIX}
# Handle case conflicts carefully, when _dst occurs
# more than once after case flattening
.if ${MKUPDATE} == "no" || ${MLINKS:tl:M${_dst:tl:Q}:[\#]} > 1
.if ${MKUPDATE} == "no" || ${MLINKS:${_FLATTEN}M${_dst:${_FLATTEN}Q}:[\#]} > 1
${_t}! ${_l} __linkinstallpage
.else
${_t}: ${_l} __linkinstallpage
@@ -249,7 +260,7 @@ _t:=${HTMLDIR}/html${_dst:T:E}${MANSUBDIR}/${_dst:R:S-/index$-/x&-}.html
# Handle case conflicts carefully, when _dst occurs
# more than once after case flattening
.if ${MKUPDATE} == "no" || ${MLINKS:tl:M${_dst:tl:Q}:[\#]} > 1
.if ${MKUPDATE} == "no" || ${MLINKS:${_FLATTEN}M${_dst:${_FLATTEN}Q}:[\#]} > 1
${_t}! ${_l} __linkinstallpage
.else
${_t}: ${_l} __linkinstallpage
+252 -141
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.own.mk,v 1.755 2013/10/29 16:11:46 joerg Exp $
# $NetBSD: bsd.own.mk,v 1.874 2015/09/30 22:58:02 rjs Exp $
# This needs to be before bsd.init.mk
.if defined(BSD_MK_COMPAT_FILE)
@@ -24,7 +24,6 @@ INFOGRP?= operator
DOCGRP?= operator
MKKYUA?= yes
MKMCLINKER?= no
MKCLANGRT?= no
MKGCC?= no
@@ -38,6 +37,7 @@ MKCOVERAGE?= no
# LSC MINIX does not support these features ATM.
USE_FORT:= no
USE_SSP:= no
MKCOMPAT:= no
MKGDB:= no
MKGROFF:= no
MKHESIOD:= no
@@ -59,6 +59,7 @@ MKPOSTFIX:= no
MKRUMP:= no
MKSKEY:= no
MKYP:= no
MKCROSSGDB:= no
WEAKALIASOVERRIDEPASS?=${NETBSDSRCDIR}/minix/llvm/bin/weak-alias-module-override.so
GOLD_PLUGIN?=${NETBSDSRCDIR}/minix/llvm/bin/LLVMgold.so
@@ -68,7 +69,7 @@ GOLD_PLUGIN?=${NETBSDSRCDIR}/minix/llvm/bin/LLVMgold.so
# - run the passe which allows assembly weak symbols to be
# overriden by bitcode functions
OPTFLAGS?= -disable-opt \
-disable-internalize -disable-inlining \
-disable-inlining \
-load ${WEAKALIASOVERRIDEPASS} -weak-alias-module-override
BITCODE_LD_FLAGS_1ST?= \
@@ -91,15 +92,7 @@ __uname_s!= uname -s
.if ${__uname_s:Uunknown} == "Minix"
USETOOLS?= never
. if ${USETOOLS:Uno} != "yes"
# LSC: We have to use a temporary variable, as some test are done simply on the
# definition (ifdef) of it.
. if ${_HAVE_LLVM:U} == ""
_HAVE_LLVM!= (exec 2>&1; clang --version || echo "")
_HAVE_LLVM:= ${_HAVE_LLVM:M[0-9]\.[0-9]}
. if ${_HAVE_LLVM} != ""
HAVE_LLVM?= ${_HAVE_LLVM}
. endif
. endif # ${_HAVE_LLVM:U} == ""
HAVE_LLVM?= yes
# If DESTDIR was specified, and we are not using the tools, then make sure to
# build out-of-tree and to refer only DESTDIR for target binaries
@@ -161,7 +154,9 @@ MKLIBSTDCXX?= yes # Also install the GNU C++ library
MKLIBSTDCXX?= no
.if ${MKGCC} == "yes"
HAVE_GCC?= 45 # The in-tree gcc version is 4.5
HAVE_GCC?= 5 # Not really, but that's the setting.
HAVE_LIBGCC?= yes
HAVE_LIBGCC_EH?= yes
.endif # ${MKGCC} == "yes"
.if ${USETOOLS:Uno} == "yes"
@@ -169,7 +164,7 @@ MKLLVM?= yes
.endif # ${USETOOLS:Uno} == "yes"
.if ${MKLLVM:Uno} == "yes"
HAVE_LLVM?= 34 # The in-tree LLVM version is 3.4
HAVE_LLVM?= yes
MKBINUTILS?= yes # We are installing clang, so trigger binutils.
.endif # ${MKLLVM:Uno} == "yes"
@@ -192,7 +187,7 @@ MAKECONF?= /etc/mk.conf
#
# CPU model, derived from MACHINE_ARCH
#
MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:C/arm.*/arm/:C/earm.*/arm/:S/earm/arm/:S/powerpc64/powerpc/}
MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:C/arm.*/arm/:C/earm.*/arm/:S/earm/arm/:S/powerpc64/powerpc/:S/aarch64eb/aarch64/:S/or1knd/or1k/:C/riscv../riscv/}
#
# Subdirectory used below ${RELEASEDIR} when building a release
@@ -222,34 +217,76 @@ NEED_OWN_INSTALL_TARGET?= yes
# If some future port is not supported by the in-tree toolchain, this should
# be set to "yes" for that port only.
#
.if ${MACHINE} == "playstation2"
TOOLCHAIN_MISSING?= yes
.endif
TOOLCHAIN_MISSING?= no
.if ${MACHINE_CPU} == "aarch64" && !defined(EXTERNAL_TOOLCHAIN) && ${MKLLVM:Uyes} != "no"
MKLLVM?= yes
HAVE_LLVM?= yes
MKGCC?= no
.endif
#
# Platforms still using GCC 4.1
# GCC Using platforms.
#
.if ${MKGCC:Uyes} != "no"
.if ${MACHINE_CPU} == "vax"
HAVE_GCC?= 4
.if ${MACHINE} == "playstation2" || ${MACHINE_CPU} == "aarch64"
HAVE_GCC?= 0
.else
# Otherwise, default to GCC4.5
HAVE_GCC?= 45
.endif
# Otherwise, default to GCC4.8
HAVE_GCC?= 48
.endif
#
# Platforms that can't run a modern GCC natively
.if ${MACHINE_ARCH} == "m68000"
MKGCCCMDS?= no
.endif
.if ${MACHINE_ARCH} == "ia64"
USE_COMPILERCRTSTUFF?= yes
#
# We import the old gcc as "gcc.old" when upgrading. EXTERNAL_GCC_SUBDIR is
# set to the relevant subdirectory in src/external/gpl3 for his HAVE_GCC.
#
.if ${HAVE_GCC} == 5
EXTERNAL_GCC_SUBDIR= gcc
.elif ${HAVE_GCC} == 48
EXTERNAL_GCC_SUBDIR= gcc.old
.else
USE_COMPILERCRTSTUFF?= no
EXTERNAL_GCC_SUBDIR= /does/not/exist
.endif
.else
MKGCCCMDS?= no
.endif
.if ${MKLLVM:Uno} == "yes" && (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64")
.if !empty(MACHINE_ARCH:Mearm*)
_LIBC_COMPILER_RT.${MACHINE_ARCH}= yes
.endif
_LIBC_COMPILER_RT.aarch64= yes
_LIBC_COMPILER_RT.i386= yes
_LIBC_COMPILER_RT.powerpc= yes
_LIBC_COMPILER_RT.powerpc64= yes
_LIBC_COMPILER_RT.x86_64= yes
.if ${HAVE_LLVM:Uno} == "yes" && ${_LIBC_COMPILER_RT.${MACHINE_ARCH}:Uno} == "yes"
HAVE_LIBGCC?= no
.else
HAVE_LIBGCC?= yes
.endif
HAVE_GDB?= 7
# ia64 is not support
.if ${HAVE_LLVM:Uno} == "yes" || !empty(MACHINE_ARCH:Mearm*)
HAVE_LIBGCC_EH?= no
.else
HAVE_LIBGCC_EH?= yes
.endif
HAVE_GDB?= 79
.if (${MACHINE_ARCH} == "alpha") || \
(${MACHINE_ARCH} == "hppa") || \
@@ -337,19 +374,7 @@ USETOOLS?= no
#
# Host platform information; may be overridden
#
.if !defined(HOST_OSTYPE)
_HOST_OSNAME!= uname -s
_HOST_OSREL!= uname -r
# For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints
# something that does not look like an identifier, then use uname -m.
_HOST_ARCH!= uname -p 2>/dev/null
_HOST_ARCH:= ${HOST_ARCH:tW:C/.*[^-_A-Za-z0-9].*//:S/unknown//}
.if empty(_HOST_ARCH)
_HOST_ARCH!= uname -m
.endif
HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g}
.MAKEOVERRIDES+= HOST_OSTYPE
.endif # !defined(HOST_OSTYPE)
.include <bsd.host.mk>
.if ${USETOOLS} == "yes" # {
@@ -377,7 +402,9 @@ NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
READELF= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-readelf
SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
STRINGS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strings
STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
TOOL_CC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
@@ -402,7 +429,9 @@ NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
READELF= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf
SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
STRINGS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strings
STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
# GCC supports C, C++, Fortran and Objective C
@@ -424,6 +453,7 @@ TOOL_LLC.clang= ${TOOLDIR}/bin/llc
# PCC supports C and Fortran
TOOL_CC.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
TOOL_CPP.pcc= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-cpp
TOOL_CXX.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++
#
# Make sure DESTDIR is set, so that builds with these tools always
@@ -443,9 +473,6 @@ LDFLAGS+= --sysroot=/
.endif
.endif # EXTERNAL_TOOLCHAIN # }
HOST_MKDEP= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
HOST_MKDEPCXX= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
@@ -486,7 +513,7 @@ TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
TOOL_HP700MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp700-mkboot
TOOL_HPPAMKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hppa-mkboot
TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
@@ -496,6 +523,8 @@ TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
TOOL_MAKEKEYS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makekeys
TOOL_MAKESTRS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makestrs
TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
@@ -516,6 +545,7 @@ TOOL_ELFTOSB= ${TOOLDIR}/bin/${_TOOL_PREFIX}elftosb
TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}perf
TOOL_NCDCS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ibmnws-ncdcs
TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz
@@ -524,6 +554,8 @@ TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
@@ -541,6 +573,7 @@ TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic
TOOL_TOPROTO= ${TOOLDIR}/bin/${_TOOL_PREFIX}toproto
TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
TOOL_VFONTEDPR= ${TOOLDIR}/libexec/${_TOOL_PREFIX}vfontedpr
TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
.else # USETOOLS != yes # } {
@@ -567,6 +600,7 @@ TOOL_OBJC.gcc= gcc
# PCC supports C and Fortran
TOOL_CC.pcc= pcc
TOOL_CPP.pcc= /usr/libexec/pcpp
TOOL_CXX.pcc= p++
TOOL_AMIGAAOUT2BB= amiga-aout2bb
TOOL_AMIGAELF2BB= amiga-elf2bb
@@ -577,13 +611,13 @@ TOOL_CAP_MKDB= cap_mkdb
TOOL_CAT= cat
TOOL_CKSUM= cksum
.if defined(__MINIX)
# LSC: A full path has to be provided, as this is also, used as a make
# LSC: A full path has to be provided, as this is also used as a make
# target.
.if exists(/usr/pkg/bin/clang-tblgen)
. if exists(/usr/pkg/bin/clang-tblgen)
TOOL_CLANG_TBLGEN= /usr/pkg/bin/clang-tblgen
.else
. else
TOOL_CLANG_TBLGEN= /usr/bin/clang-tblgen
.endif # exists(/usr/pkg/bin/clang-tblgen)
. endif # exists(/usr/pkg/bin/clang-tblgen)
.else
TOOL_CLANG_TBLGEN= clang-tblgen
.endif # defined(__MINIX)
@@ -605,19 +639,19 @@ TOOL_GREP= grep
TOOL_GROFF= groff
TOOL_HEXDUMP= hexdump
TOOL_HP300MKBOOT= hp300-mkboot
TOOL_HP700MKBOOT= hp700-mkboot
TOOL_HPPAMKBOOT= hppa-mkboot
TOOL_INDXBIB= indxbib
TOOL_INSTALLBOOT= installboot
TOOL_INSTALL_INFO= install-info
TOOL_JOIN= join
.if defined(__MINIX)
# LSC: A full path has to be provided, as this is also, used as a make
# LSC: A full path has to be provided, as this is also used as a make
# target.
.if exists(/usr/pkg/bin/llvm-tblgen)
. if exists(/usr/pkg/bin/llvm-tblgen)
TOOL_LLVM_TBLGEN= /usr/pkg/bin/llvm-tblgen
.else
. else
TOOL_LLVM_TBLGEN= /usr/bin/llvm-tblgen
.endif # exists(/usr/pkg/bin/llvm-tblgen)
. endif # exists(/usr/pkg/bin/llvm-tblgen)
.else
TOOL_LLVM_TBLGEN= llvm-tblgen
.endif # defined(__MINIX)
@@ -625,6 +659,20 @@ TOOL_M4= m4
TOOL_MACPPCFIXCOFF= macppc-fixcoff
TOOL_MAKEFS= makefs
TOOL_MAKEINFO= makeinfo
.if defined(__MINIX)
# LSC: A full path has to be provided, as this is also used as a make
# target.
TOOL_MAKEKEYS= /usr/X11R7/bin/makekeys
.else
TOOL_MAKEKEYS= makekeys
.endif # defined(__MINIX)
.if defined(__MINIX)
# LSC: A full path has to be provided, as this is also used as a make
# target.
TOOL_MAKESTRS= /usr/X11R7/bin/makestrs
.else
TOOL_MAKESTRS= makestrs
.endif # defined(__MINIX)
TOOL_MAKEWHATIS= /usr/libexec/makewhatis
TOOL_MANDOC_ASCII= mandoc -Tascii
TOOL_MANDOC_HTML= mandoc -Thtml
@@ -645,6 +693,7 @@ TOOL_ELFTOSB= elftosb
TOOL_MSGC= msgc
TOOL_MTREE= mtree
TOOL_NBPERF= nbperf
TOOL_NCDCS= ncdcs
TOOL_PAX= pax
TOOL_PIC= pic
TOOL_PIGZ= pigz
@@ -653,6 +702,8 @@ TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage
TOOL_PWD_MKDB= pwd_mkdb
TOOL_REFER= refer
TOOL_ROFF_ASCII= nroff
TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
@@ -679,6 +730,7 @@ TOOL_TIC= tic
TOOL_TOPROTO= toproto
TOOL_UUDECODE= uudecode
TOOL_VGRIND= vgrind -f
TOOL_VFONTEDPR= /usr/libexec/vfontedpr
TOOL_ZIC= zic
.endif # USETOOLS != yes # }
@@ -692,7 +744,7 @@ TOOL_OBJC.false= false
TOOL_OPT.false= false
TOOL_LLC.false= false
AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} false
AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} ${EXTERNAL_TOOLCHAIN:Dgcc} false
.for _t in CC CPP CXX FC OBJC OPT LLC
ACTIVE_${_t}= ${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]}
@@ -707,11 +759,46 @@ OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}}
OPT= ${TOOL_OPT.${ACTIVE_OPT}}
LLC= ${TOOL_LLC.${ACTIVE_LLC}}
.if exists(/usr/bin/${TOOL_CTFCONVERT}) || exists(${TOOL_CTFCONVERT})
# Override with tools versions if needed
.if ${MKCTF:Uno} != "no" && !defined(NOCTF)
CTFCONVERT= ${TOOL_CTFCONVERT}
CTFMERGE= ${TOOL_CTFMERGE}
.endif
# For each ${MACHINE_CPU}, list the ports that use it.
MACHINES.aarch64= evbarm64
MACHINES.alpha= alpha
MACHINES.arm= acorn26 acorn32 cats epoc32 evbarm hpcarm \
iyonix netwinder shark zaurus
MACHINES.coldfire= evbcf
MACHINES.i386= i386
MACHINES.ia64= ia64
MACHINES.hppa= hppa
MACHINES.m68000= sun2
MACHINES.m68k= amiga atari cesfic hp300 luna68k mac68k \
news68k next68k sun3 x68k
MACHINES.mips= arc cobalt algor cobalt emips evbmips ews4800mips \
hpcmips mipsco newsmips pmax sbmips sgimips
MACHINES.or1k= or1k
MACHINES.powerpc= amigappc bebox evbppc ibmnws macppc mvmeppc \
ofppc prep rs6000 sandpoint
MACHINES.riscv= riscv
MACHINES.sh3= dreamcast evbsh3 hpcsh landisk mmeye
MACHINES.sparc= sparc sparc64
MACHINES.sparc64= sparc64
MACHINES.vax= vax
MACHINES.x86_64= amd64
# for crunchide & ldd, define the OBJECT_FMTS used by a MACHINE_ARCH
#
OBJECT_FMTS=
.if ${MACHINE_ARCH} != "alpha"
OBJECT_FMTS+= elf32
.endif
.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH:M*64*} != ""
OBJECT_FMTS+= elf64
.endif
# OBJCOPY flags to create a.out binaries for old firmware
# shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc
.if ${MACHINE_CPU} == "arm"
@@ -731,6 +818,7 @@ OBJCOPY_ELF2AOUT_FLAGS?= \
-R .debug_loc \
-R .debug_pubnames \
-R .debug_pubtypes \
-R .debug_ranges \
-R .debug_str \
-R .eh_frame \
-R .note.netbsd.ident
@@ -809,7 +897,6 @@ LIBOWN?= ${BINOWN}
LIBMODE?= ${NONBINMODE}
DOCDIR?= /usr/share/doc
HTMLDOCDIR?= /usr/share/doc/html
DOCGRP?= wheel
DOCOWN?= root
DOCMODE?= ${NONBINMODE}
@@ -867,6 +954,22 @@ MKGCC:= no
MKGCC:= no
.endif
# No GDB support for aarch64
MKGDB.aarch64= no
MKGDB.or1k= no
MKGDB.riscv32= no
MKGDB.riscv64= no
# No kernel modules for or1k (yet)
MKKMOD.or1k= no
MKKMOD.riscv32= no
MKKMOD.riscv64= no
# No profiling for or1k (yet)
MKPROFILE.or1k= no
MKPROFILE.riscv32=no
MKPROFILE.riscv64=no
#
# The m68000 port is incomplete.
#
@@ -883,10 +986,8 @@ NOPROFILE= # defined
#
# The ia64 port is incomplete.
#
.if ${MACHINE_ARCH} == "ia64"
MKLINT= no
MKGDB= no
.endif
MKLINT.ia64= no
MKGDB.ia64= no
#
# On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
@@ -897,13 +998,15 @@ MKGDB= no
MKPICLIB:= no
.endif
# PowerPC64 and AArch64 ABI's are PIC
MKPICLIB.powerpc64= no
#MKPICLIB.aarch64= no
#
# On VAX using ELF, all objects are PIC, not just shared libraries,
# so don't build the _pic version.
#
.if ${MACHINE_ARCH} == "vax"
MKPICLIB= no
.endif
MKPICLIB.vax= no
#
# Location of the file that contains the major and minor numbers of the
@@ -915,6 +1018,7 @@ SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
#
# GNU sources and packages sometimes see architecture names differently.
#
GNU_ARCH.aarch64eb=aarch64_be
GNU_ARCH.coldfire=m5407
GNU_ARCH.earm=arm
GNU_ARCH.earmhf=arm
@@ -977,33 +1081,32 @@ MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
MACHINE_GNU_PLATFORM:=${MACHINE_GNU_ARCH}-elf32-minix
# We need to check for HAVE_GOLD after LD has been set
.if ${_HAVE_GOLD:U} == ""
. if ${_HAVE_GOLD:U} == ""
_HAVE_GOLD!= (exec 2>&1; ${LD} --version || echo "")
_GOLD_MATCH:=${_HAVE_GOLD:Mgold}
_HAVE_GOLD:= ${_HAVE_GOLD:M[0-9]\.[0-9][0-9]}
. if ${_GOLD_MATCH} != "" && ${_HAVE_GOLD} != ""
. if ${_GOLD_MATCH} != "" && ${_HAVE_GOLD} != ""
HAVE_GOLD?= ${_HAVE_GOLD}
# CFLAGS+= -DHAVE_GOLD=${_HAVE_GOLD}
# AFLAGS+= -DHAVE_GOLD=${_HAVE_GOLD}
# Without -Wl,--no-ctors-in-init-array, gold moves the constructors out of
# .ctors into .init_array, which is bad on intel.
LDFLAGS+= -Wl,--no-ctors-in-init-array
. else
. else
USE_BITCODE:=no
. endif
.endif # ${_HAVE_GOLD:U} == ""
. endif
. endif # ${_HAVE_GOLD:U} == ""
.endif # defined(__MINIX)
#
# Determine if arch uses native kernel modules with rump
#
.if ${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "x86_64"
RUMPKMOD= # defined
.if !empty(MACHINE_ARCH:M*arm*)
# Flags to pass to CC for using the old APCS ABI on ARM for compat or stand.
ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft
ARM_APCS_FLAGS+=${${ACTIVE_CC} == "gcc":? -marm :}
ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :}
.endif
GENASSYM_CPPFLAGS+= ${${ACTIVE_CC} == "clang":? -no-integrated-as :}
TARGETS+= all clean cleandir depend dependall includes \
install lint obj regress tags html analyze
PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
@@ -1071,19 +1174,22 @@ MK${var}:= yes
#
# MK* options which have variable defaults.
#
.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" || \
${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" \
|| ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \
|| ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_CPU} == "aarch64" \
|| ${MACHINE_ARCH} == "riscv64" \
|| !empty(MACHINE_ARCH:Mearm*)
MKCOMPAT?= yes
.elif !empty(MACHINE_ARCH:Mearm*)
MKCOMPAT?= no
.else
# Don't let this build where it really isn't supported.
MKCOMPAT:= no
MKCOMPATTESTS:= no
MKCOMPATX11:= no
.endif
#.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" || \
.if ${MACHINE} == "evbppc"
.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" \
|| ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \
|| (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc")
MKCOMPATMODULES?= yes
.else
MKCOMPATMODULES:= no
@@ -1094,10 +1200,11 @@ MKCOMPATMODULES:= no
# arm is always softfloat unless it isn't
# emips is always softfloat.
# coldfire is always softfloat
# or1k is always softfloat
#
.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" || \
(${MACHINE_CPU} == "arm" && ${MACHINE_ARCH:M*hf*} == "") || \
${MACHINE_ARCH} == "coldfire" || \
${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "or1k" || \
${MACHINE} == "emips"
MKSOFTFLOAT?= yes
.endif
@@ -1122,9 +1229,9 @@ MKBINUTILS?= ${MKBFD}
.endif
#
# We want to build zfs only for i386 and amd64 by default for now.
# We want to build zfs only for amd64 by default for now.
#
.if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
.if ${MACHINE} == "amd64"
MKZFS?= yes
.endif
@@ -1136,7 +1243,7 @@ _MKVARS.yes= \
MKBINUTILS \
MKCRYPTO MKCOMPLEX MKCVS MKCXX \
MKDOC \
MKGCC MKGCCCMDS MKGDB MKGROFF \
MKGCC MKGDB MKGROFF \
MKHESIOD MKHTML \
MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
MKKERBEROS \
@@ -1164,15 +1271,21 @@ _MKVARS.yes+= \
.endif
.for var in ${_MKVARS.yes}
${var}?= yes
${var}?= ${${var}.${MACHINE_ARCH}:Uyes}
.endfor
#
# MKGCCCMDS is only valid if we are building GCC so make it dependent on that.
#
_MKVARS.yes += MKGCCCMDS
MKGCCCMDS?= ${MKGCC}
#
# Exceptions to the above:
#
#.if ${MACHINE} == "evbppc"
#MKKMOD= no
#.endif
.if ${MACHINE} == "acorn26" # page size is prohibitive
MKKMOD= no
.endif
#
# MK* options which default to "no". Note that MKZFS has a different
@@ -1180,8 +1293,8 @@ ${var}?= yes
#
_MKVARS.no= \
MKBSDGREP MKBSDTAR \
MKCATPAGES MKCRYPTO_RC5 MKDEBUG \
MKDEBUGLIB MKDTRACE MKEXTSRC \
MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCRYPTO_RC5 MKCTF MKDEBUG \
MKDEBUGLIB MKDTRACE MKEXTSRC MKGROFFHTMLDOC \
MKKYUA MKLLD MKLLDB MKLINT \
MKMANZ MKMCLINKER MKOBJDIRS \
MKLIBCXX MKLLVM MKPCC \
@@ -1199,33 +1312,14 @@ _MKVARS.no+= \
.endif
.for var in ${_MKVARS.no}
${var}?=no
${var}?= ${${var}.${MACHINE_ARCH}:Uno}
.endfor
#
# Do we default to XFree86 or Xorg for this platform?
#
.if \
${MACHINE} == "acorn32" || \
${MACHINE} == "alpha" || \
${MACHINE} == "amiga" || \
${MACHINE} == "ews4800mips" || \
${MACHINE} == "mac68k" || \
${MACHINE} == "newsmips" || \
${MACHINE} == "pmax" || \
${MACHINE} == "sun3" || \
${MACHINE} == "x68k"
X11FLAVOUR?= XFree86
.else
X11FLAVOUR?= Xorg
.endif
#
# Which platforms build the xorg-server drivers (as opposed
# to just Xnest and Xvfb.)
#
.if ${X11FLAVOUR} == "Xorg" && \
${MACHINE} == "alpha" || \
.if ${MACHINE} == "alpha" || \
${MACHINE} == "amd64" || \
${MACHINE} == "bebox" || \
${MACHINE} == "cats" || \
@@ -1239,6 +1333,7 @@ X11FLAVOUR?= Xorg
${MACHINE} == "hpcsh" || \
${MACHINE} == "i386" || \
${MACHINE} == "luna68k" || \
${MACHINE} == "mac68k" || \
${MACHINE} == "macppc" || \
${MACHINE} == "netwinder" || \
${MACHINE} == "newsmips" || \
@@ -1316,6 +1411,19 @@ MKSYSDEBUG:= no
MKLIVEUPDATE:= no
.endif
.if !empty(MACHINE_ARCH:Mearm*)
_NEEDS_LIBCXX.${MACHINE_ARCH}= yes
.endif
_NEEDS_LIBCXX.i386= yes
_NEEDS_LIBCXX.powerpc= yes
_NEEDS_LIBCXX.powerpc64= yes
_NEEDS_LIBCXX.x86_64= yes
_NEEDS_LIBCXX.aarch64= yes
.if ${MKLLVM} == "yes" && ${_NEEDS_LIBCXX.${MACHINE_ARCH}:Uno} == "yes"
MKLIBCXX:= yes
.endif
#
# install(1) parameters.
#
@@ -1346,9 +1454,6 @@ INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
HOST_INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
HOST_INSTALL_DIR?= ${INSTALL} -d
HOST_INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} ${RENAME}
.endif
#
@@ -1405,11 +1510,17 @@ ${var}?= yes
${var}?= no
.endfor
#
# TOOL_GZIP and friends. These might refer to TOOL_PIGZ or to the host gzip.
#
.if ${USE_PIGZGZIP} != "no"
TOOL_GZIP= ${TOOL_PIGZ}
GZIP_N_FLAG?= -nT
.else
TOOL_GZIP= gzip
GZIP_N_FLAG?= -n
.endif
TOOL_GZIP_N= ${TOOL_GZIP} ${GZIP_N_FLAG}
#
# Where X11 sources are and where it is installed to.
@@ -1422,13 +1533,8 @@ X11SRCDIR= /usr/xsrc
.endif
.endif # !defined(X11SRCDIR)
X11SRCDIR.xc?= ${X11SRCDIR}/xfree/xc
X11SRCDIR.local?= ${X11SRCDIR}/local
.if ${X11FLAVOUR} == "Xorg"
X11ROOTDIR?= /usr/X11R7
.else
X11ROOTDIR?= /usr/X11R6
.endif
X11BINDIR?= ${X11ROOTDIR}/bin
X11ETCDIR?= /etc/X11
X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
@@ -1436,7 +1542,7 @@ X11INCDIR?= ${X11ROOTDIR}/include
X11LIBDIR?= ${X11ROOTDIR}/lib/X11
X11MANDIR?= ${X11ROOTDIR}/man
X11SHAREDIR?= ${X11ROOTDIR}/share
X11USRLIBDIR?= ${X11ROOTDIR}/lib
X11USRLIBDIR?= ${X11ROOTDIR}/lib${MLIBDIR:D/${MLIBDIR}}
#
# New modular-xorg based builds
@@ -1444,35 +1550,38 @@ X11USRLIBDIR?= ${X11ROOTDIR}/lib
X11SRCDIRMIT?= ${X11SRCDIR}/external/mit
.for _lib in \
FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \
Xdmcp Xevie Xext Xfixes Xfont Xft Xi Xinerama Xmu Xpm \
Xdmcp Xevie Xext Xfixes Xfont Xft Xi Xinerama Xmu Xpresent Xpm \
Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \
fontenc xkbfile xkbui Xaw lbxutil Xfontcache pciaccess xcb
fontenc xkbfile xkbui Xaw Xfontcache pciaccess xcb \
pthread-stubs
X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist
.endfor
.for _proto in \
xcmisc xext xf86bigfont bigreqs input kb x fonts fixes scrnsaver \
xinerama dri2 render resource record video xf86dga xf86misc \
xinerama dri2 dri3 render resource record video xf86dga xf86misc \
xf86vidmode composite damage trap gl randr fontcache xf86dri \
xcb-
present xcb-
X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist
.endfor
.for _dir in \
xtrans fontconfig expat freetype evieext mkfontscale bdftopcf \
xkbcomp xorg-cf-files imake xorg-server xbiff xkbdata xkeyboard-config \
xtrans fontconfig freetype evieext mkfontscale bdftopcf \
xkbcomp xorg-cf-files imake xorg-server xbiff xkeyboard-config \
xbitmaps appres xeyes xev xedit sessreg pixman \
beforelight bitmap editres makedepend fonttosfnt fslsfonts \
fstobdf MesaDemos MesaGLUT MesaLib ico iceauth lbxproxy listres lndir \
beforelight bitmap editres makedepend fonttosfnt fslsfonts fstobdf \
glu glw mesa-demos MesaGLUT MesaLib MesaLib7 \
ico iceauth listres lndir \
luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \
setxkbmap smproxy twm viewres x11perf xauth xcalc xclipboard \
xclock xcmsdb xconsole xcutsel xditview xdpyinfo xdriinfo xdm \
rstart setxkbmap showfont smproxy twm viewres \
x11perf xauth xcalc xclipboard \
xclock xcmsdb xconsole xditview xdpyinfo xdriinfo xdm \
xfd xf86dga xfindproxy xfontsel xfwp xgamma xgc xhost xinit \
xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \
xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \
xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \
xwininfo xwud xprehashprinterlist xplsprinters xkbprint xkbevd \
xterm xwd xfs xfsinfo xphelloworld xtrap xkbutils xkbcomp \
xwininfo xwud xkbprint xkbevd \
xterm xwd xfs xfsinfo xtrap xkbutils xkbcomp \
xkeyboard-config xinput xcb-util xorg-docs \
font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \
font-adobe-utopia-75dpi font-adobe-utopia-type1 \
@@ -1492,21 +1601,23 @@ X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist
.endfor
.for _v in \
ag10e apm ark ast ati chips cirrus crime \
geode glint i128 i740 igs imstt intel mach64 mga \
ag10e apm ark ast ati ati-kms chips cirrus crime \
geode glint i128 i740 igs imstt intel intel-old mach64 mga \
neomagic newport nsc nv nvxbox openchrome pnozz \
r128 radeonhd rendition \
s3 s3virge savage siliconmotion sis suncg14 \
suncg6 sunffb sunleo suntcx \
tdfx tga trident tseng vesa vga via vmware wsfb xgi
tdfx tga trident tseng vesa vga vmware wsfb xgi
X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist
.endfor
.if ${X11FLAVOUR} == "Xorg"
X11DRI?= yes
# Only install the radeon firmware on DRM-happy systems.
.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386"
MKRADEONFIRMWARE?= yes
.endif
MKRADEONFIRMWARE?= no
X11DRI?= no
X11DRI?= yes
X11LOADABLE?= yes
@@ -1613,6 +1724,6 @@ _MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
TARGETS+= lintmanpages
.endif
TESTSBASE= /usr/tests
TESTSBASE= /usr/tests${MLIBDIR:D/${MLIBDIR}}
.endif # !defined(_BSD_OWN_MK_)
+11 -8
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.prog.mk,v 1.286 2013/11/11 10:24:53 joerg Exp $
# $NetBSD: bsd.prog.mk,v 1.292 2015/06/07 15:04:28 matt Exp $
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
.ifndef HOSTPROG
@@ -60,32 +60,35 @@ CFLAGS+= ${COPTS}
CFLAGS+= -g
.endif
OBJCFLAGS+= ${OBJCOPTS}
MKDEP_SUFFIXES?= .o .ln
MKDEP_SUFFIXES?= .o .ln .d
# CTF preserve debug symbols
.if defined(MKDTRACE) && (${MKDTRACE} != "no") && (${CFLAGS:M-g} != "")
.if (${MKCTF:Uno} != "no") && (${CFLAGS:M-g} != "")
CTFFLAGS+= -g
CTFMFLAGS+= -g
.if defined(HAVE_GCC) && ${HAVE_GCC} >= 48
#CFLAGS+=-gdwarf-2
.endif
.endif
# ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o
.ifndef LIBCRTBEGIN
LIBCRTBEGIN= ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}
LIBCRTBEGIN= ${DESTDIR}/usr/lib/${MLIBDIR:D${MLIBDIR}/}crti.o ${_GCC_CRTBEGIN}
.MADE: ${LIBCRTBEGIN}
.endif
.ifndef LIBCRTEND
LIBCRTEND= ${_GCC_CRTEND} ${DESTDIR}/usr/lib/crtn.o
LIBCRTEND= ${_GCC_CRTEND} ${DESTDIR}/usr/lib/${MLIBDIR:D${MLIBDIR}/}crtn.o
.MADE: ${LIBCRTEND}
.endif
_SHLINKER= ${SHLINKDIR}/ld.elf_so
.ifndef LIBCRT0
LIBCRT0= ${DESTDIR}/usr/lib/crt0.o
LIBCRT0= ${DESTDIR}/usr/lib/${MLIBDIR:D${MLIBDIR}/}crt0.o
.MADE: ${LIBCRT0}
.endif
.ifndef LIBCRTI
LIBCRTI= ${DESTDIR}/usr/lib/crti.o
LIBCRTI= ${DESTDIR}/usr/lib/${MLIBDIR:D${MLIBDIR}/}crti.o
.MADE: ${LIBCRTI}
.endif
@@ -638,7 +641,7 @@ ${_P}: .gdbinit ${LIBCRT0} ${LIBCRTI} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} \
${_P}.ro: ${OBJS.${_P}} ${_DPADD.${_P}}
${_MKTARGET_LINK}
${CC} ${LDFLAGS} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
${CC} ${LDFLAGS:N-Wl,-pie} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
.if defined(_PROGDEBUG.${_P})
${_PROGDEBUG.${_P}}: ${_P}
+6 -5
View File
@@ -1,8 +1,9 @@
# $NetBSD: bsd.rpc.mk,v 1.12 2011/09/10 16:57:35 apb Exp $
# $NetBSD: bsd.rpc.mk,v 1.13 2013/12/15 00:28:45 christos Exp $
.include <bsd.init.mk>
RPC_XDIR?= ${.CURDIR}/
RPCGEN_FLAGS?= -B
# We don't use implicit suffix rules here to avoid dependencies in the
# Installed files.
@@ -12,7 +13,7 @@ RPC_XDIR?= ${.CURDIR}/
.for I in ${RPC_INCS}
${I}: ${I:.h=.x}
${_MKTARGET_CREATE}
${TOOL_RPCGEN} -C -h ${RPC_XDIR}${I:.h=.x} -o ${.TARGET}
${TOOL_RPCGEN} ${RPCGEN_FLAGS} -h ${RPC_XDIR}${I:.h=.x} -o ${.TARGET}
.endfor
DPSRCS+= ${RPC_INCS}
@@ -26,7 +27,7 @@ CLEANFILES+= ${RPC_INCS}
.for I in ${RPC_XDRFILES}
${I}: ${RPC_XDIR}${I:_xdr.c=.x}
${_MKTARGET_CREATE}
${TOOL_RPCGEN} -C -c ${RPC_XDIR}${I:_xdr.c=.x} -o ${.TARGET}
${TOOL_RPCGEN} ${RPCGEN_FLAGS} -c ${RPC_XDIR}${I:_xdr.c=.x} -o ${.TARGET}
.endfor
DPSRCS+= ${RPC_XDRFILES}
@@ -45,7 +46,7 @@ _RPCS += -s ${I}
${I}: ${RPC_XDIR}${I:_svc.c=.x}
${_MKTARGET_CREATE}
${TOOL_RPCGEN} -C ${_RPCS} ${RPC_SVCFLAGS} ${RPC_XDIR}${I:_svc.c=.x} \
${TOOL_RPCGEN} ${RPCGEN_FLAGS} ${_RPCS} ${RPC_SVCFLAGS} ${RPC_XDIR}${I:_svc.c=.x} \
-o ${.TARGET}
.endfor
@@ -60,7 +61,7 @@ CLEANFILES+= ${RPC_SVCFILES}
${I}: ${RPC_XDIR}${I:_clnt.c=.x}
${_MKTARGET_CREATE}
${TOOL_RPCGEN} -C -l ${_RPCS} ${RPC_CLNTFLAGS} \
${TOOL_RPCGEN} ${RPCGEN_FLAGS} -l ${_RPCS} ${RPC_CLNTFLAGS} \
${RPC_XDIR}${I:_clnt.c=.x} -o ${.TARGET}
.endfor
+49 -52
View File
@@ -1,22 +1,32 @@
# $NetBSD: bsd.sys.mk,v 1.230 2013/11/06 19:57:17 christos Exp $
# $NetBSD: bsd.sys.mk,v 1.245 2014/09/03 19:22:53 matt Exp $
#
# Build definitions used for NetBSD source tree builds.
.if !defined(_BSD_SYS_MK_)
_BSD_SYS_MK_=1
.if ${HOST_OSTYPE:C/\-.*//:U} == "Minix"
HOST_LDFLAGS?= -static
.if !empty(.INCLUDEDFROMFILE:MMakefile*)
error1:
@(echo "bsd.sys.mk should not be included from Makefiles" >& 2; exit 1)
.endif
.if !defined(_BSD_OWN_MK_)
error2:
@(echo "bsd.own.mk must be included before bsd.sys.mk" >& 2; exit 1)
.endif
.if defined(__MINIX)
#LSC: Be a bit smarter about the default compiler
.if exists(/usr/pkg/bin/clang) || exists(/usr/bin/clang)
HOST_CC?= clang
CC?= clang
.endif
.if exists(/usr/pkg/bin/gcc) || exists(/usr/bin/gcc)
HOST_CC?= gcc
CC?= gcc
.endif
.endif # ${HOST_OSTYPE:C/\-.*//:U} == "Minix"
MKDEP?= CC=${CC:Q} mkdep
MKDEPCXX?= CC=${CXX:Q} mkdep
.endif # defined(__MINIX)
.if ${MKREPRO:Uno} == "yes"
CPPFLAGS+= -Wp,-iremap,${NETBSDSRCDIR}:/usr/src
@@ -24,12 +34,10 @@ CPPFLAGS+= -Wp,-iremap,${DESTDIR}/:/
CPPFLAGS+= -Wp,-iremap,${X11SRCDIR}:/usr/xsrc
.endif
# Enable c99 mode by default.
# This has the side effect of complaining for missing prototypes
# implicit type declarations and missing return statements.
.if defined(HAVE_GCC) || defined(HAVE_LLVM)
CFLAGS+= -std=gnu99
.endif
# NetBSD sources use C99 style, with some GCC extensions.
CFLAGS+= ${${ACTIVE_CC} == "clang":? -std=gnu99 :}
CFLAGS+= ${${ACTIVE_CC} == "gcc":? -std=gnu99 :}
CFLAGS+= ${${ACTIVE_CC} == "pcc":? -std=gnu99 :}
.if defined(WARNS)
CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wno-sign-compare -Wno-pointer-sign :}
@@ -43,7 +51,7 @@ CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
# differently in traditional and ansi environments' which is the warning
# we wanted, and now we don't get anymore.
CFLAGS+= -Wno-sign-compare
CFLAGS+= ${${ACTIVE_CC} != "clang":? -Wno-traditional :}
CFLAGS+= ${${ACTIVE_CC} == "gcc" :? -Wno-traditional :}
.if !defined(NOGCCERROR) && !defined(USE_BITCODE)
# Set assembler warnings to be fatal
CFLAGS+= -Wa,--fatal-warnings
@@ -54,7 +62,7 @@ CFLAGS+= -Wa,--fatal-warnings
.if (!defined(MKPIC) || ${MKPIC} != "no") && \
(!defined(LDSTATIC) || ${LDSTATIC} != "-static")
# XXX there are some strange problems not yet resolved
. if !defined(HAVE_GCC) || (defined(HAVE_LLVM) && !defined(USE_BITCODE))
. if defined(HAVE_LLVM) && !defined(USE_BITCODE)
LDFLAGS+= -Wl,--fatal-warnings
. endif
.endif
@@ -81,13 +89,12 @@ CFLAGS+= -Wold-style-definition
CFLAGS+= -Wconversion
.endif
CFLAGS+= -Wsign-compare -Wformat=2
CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wno-error=format-nonliteral :}
CFLAGS+= ${${ACTIVE_CC} == "gcc":? -Wno-format-zero-length :}
.endif
.if ${WARNS} > 3 && defined(HAVE_LLVM)
CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wpointer-sign -Wmissing-noreturn :}
.endif
.if (defined(HAVE_GCC) && ${HAVE_GCC} >= 45 \
.if (defined(HAVE_GCC) \
&& (${MACHINE_ARCH} == "coldfire" || \
${MACHINE_ARCH} == "sh3eb" || \
${MACHINE_ARCH} == "sh3el" || \
@@ -117,12 +124,26 @@ LINTFLAGS+= ${DESTDIR:D-d ${DESTDIR}/usr/include}
CPPFLAGS+= -D_FORTIFY_SOURCE=2
.endif
COPTS+= -fstack-protector -Wstack-protector
# gcc 4.8 on m68k erroneously does not protect functions with
# variables needing special alignement, see
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59674
# (the underlying issue for sh and vax may be different, needs more
# investigation, symptoms are similar but for different sources)
.if "${ACTIVE_CC}" == "gcc" && "${HAVE_GCC}" == "48" && \
( ${MACHINE_CPU} == "sh3" || \
${MACHINE_ARCH} == "vax" || \
${MACHINE_CPU} == "m68k" || \
${MACHINE_CPU} == "or1k" )
COPTS+= -Wno-error=stack-protector
.endif
COPTS+= ${${ACTIVE_CC} == "clang":? --param ssp-buffer-size=1 :}
COPTS+= ${${ACTIVE_CC} == "gcc":? --param ssp-buffer-size=1 :}
.endif
.if ${MKSOFTFLOAT:Uno} != "no"
COPTS+= -msoft-float
COPTS+= ${${ACTIVE_CC} == "gcc":? -msoft-float :}
FOPTS+= -msoft-float
.elif ${MACHINE_ARCH} == "coldfire"
COPTS+= -mhard-float
@@ -160,49 +181,18 @@ AFLAGS+= ${CPUFLAGS}
.if !defined(LDSTATIC) || ${LDSTATIC} != "-static"
# Position Independent Executable flags
PIE_CFLAGS?= -fPIC
PIE_LDFLAGS?= -Wl,-pie -shared-libgcc
PIE_LDFLAGS?= -Wl,-pie ${${ACTIVE_CC} == "gcc":? -shared-libgcc :}
PIE_AFLAGS?= -fPIC
.endif
# Helpers for cross-compiling
HOST_CC?= cc
HOST_CFLAGS?= -O
HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
HOST_COMPILE.cc?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} -c
HOST_LINK.cc?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
.if defined(HOSTPROG_CXX)
HOST_LINK.c?= ${HOST_LINK.cc}
.else
HOST_LINK.c?= ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
.endif
HOST_CXX?= c++
HOST_CXXFLAGS?= -O
HOST_CPP?= cpp
HOST_CPPFLAGS?=
HOST_LD?= ld
HOST_LDFLAGS?=
HOST_AR?= ar
HOST_RANLIB?= ranlib
HOST_LN?= ln
# HOST_SH must be an absolute path
HOST_SH?= /bin/sh
ELF2ECOFF?= elf2ecoff
MKDEP?= CC=${CC:Q} mkdep
MKDEPCXX?= CC=${CXX:Q} mkdep
MKDEP?= mkdep
MKDEPCXX?= mkdep
OBJCOPY?= objcopy
OBJDUMP?= objdump
PAXCTL?= paxctl
STRIP?= strip
# TOOL_* variables are defined in bsd.own.mk
.SUFFIXES: .o .ln .lo .c .cc .cpp .cxx .C .m ${YHEADER:D.h}
# C
@@ -287,6 +277,13 @@ YFLAGS+= ${YPREFIX:D-p${YPREFIX}} ${YHEADER:D-d}
.endif
# Objcopy
OBJCOPYLIBFLAGS?=${"${.TARGET:M*.po}" != "":?-X:-x}
.if ${MACHINE_ARCH} == aarch64eb
# AARCH64 big endian needs to preserve $x/$d symbols for the linker.
OBJCOPYLIBFLAGS_EXTRA=-w -K '[$$][dx]' -K '[$$][dx]\.*'
.elif !empty(MACHINE_ARCH:M*arm*eb)
# ARM big endian needs to preserve $a/$d/$t symbols for the linker.
OBJCOPYLIBFLAGS_EXTRA=-w -K '[$$][adt]' -K '[$$][adt]\.*'
.endif
OBJCOPYLIBFLAGS?=${"${.TARGET:M*.po}" != "":?-X:-x} ${OBJCOPYLIBFLAGS_EXTRA}
.endif # !defined(_BSD_SYS_MK_)
+16
View File
@@ -0,0 +1,16 @@
# $NetBSD: bsd.syscall.mk,v 1.2 2014/01/16 01:19:46 christos Exp $
#
.include <bsd.own.mk>
SYSCALL_OBJS?= ${SYSCALL_PREFIX}_sysent.c ${SYSCALL_PREFIX}_syscalls.c \
${SYSCALL_PREFIX}_syscall.h ${SYSCALL_PREFIX}_syscallargs.h
SYSCALL_DEPS?= ${NETBSDSRCDIR}/sys/kern/makesyscalls.sh \
syscalls.conf syscalls.master
all: ${SYSCALL_OBJS}
${SYSCALL_OBJS}: ${SYSCALL_DEPS}
${HOST_SH} ${.ALLSRC}
.include <bsd.kinc.mk>
+25 -42
View File
@@ -1,4 +1,4 @@
# $NetBSD: bsd.x11.mk,v 1.108 2013/06/05 23:14:13 mrg Exp $
# $NetBSD: bsd.x11.mk,v 1.117 2015/07/23 08:03:26 mrg Exp $
.include <bsd.init.mk>
@@ -17,24 +17,19 @@ CPPFLAGS+= -DNO_ALLOCA
X11FLAGS.VERSION= -DOSMAJORVERSION=5 -DOSMINORVERSION=99 # XXX
# THREADS_DEFINES
# LSC (MINIX): Not supported: -D_REENTRANT
X11FLAGS.THREADS= -DXTHREADS -DXUSE_MTSAFE_API \
-DXNO_MTSAFE_PWDAPI
# LSC (MINIX): Not supported: -D_REENTRANT-DXTHREADS -DXUSE_MTSAFE_API
X11FLAGS.THREADS= -DXNO_MTSAFE_PWDAPI
# CONNECTION_FLAGS
.if !defined(__MINIX)
# LSC (MINIX): Not supported: -DHAS_FCHOWN
X11FLAGS.CONNECTION= -DTCPCONN -DUNIXCONN -DHAS_STICKY_DIR_BIT \
-DHAS_FCHOWN
.else
X11FLAGS.CONNECTION= -DTCPCONN -DUNIXCONN -DHAS_STICKY_DIR_BIT
.endif # !defined(__MINIX)
.if (${USE_INET6} != "no")
X11FLAGS.CONNECTION+= -DIPv6
.endif
# EXT_DEFINES
.if ${X11FLAVOUR} == "Xorg"
X11FLAGS.BASE_EXTENSION= -DMITMISC -DXTEST -DXTRAP -DXSYNC -DXCMISC \
-DXRECORD -DMITSHM -DBIGREQS -DXF86VIDMODE \
-DXF86MISC -DDPMSExtension -DEVI \
@@ -67,12 +62,6 @@ X11INCS.DIX= -I${X11INCSDIR}/freetype2 \
-I$(X11SRCDIR.xorg-server)/randr \
-I$(X11SRCDIR.xorg-server)/fb \
-I$(X11SRCDIR.xorg-server)/../include
.else
X11FLAGS.EXTENSION= -DMITMISC -DXTEST -DXTRAP -DXSYNC -DXCMISC -DXRECORD \
-DMITSHM -DBIGREQS -DXF86MISC -DDBE -DDPMSExtension \
-DEVI -DSCREENSAVER -DXV -DXVMC -DGLXEXT \
-DGLX_USE_MESA -DFONTCACHE -DRES
.endif
X11FLAGS.DRI= -DGLXEXT -DXF86DRI -DGLX_DIRECT_RENDERING \
-DGLX_USE_DLOPEN -DGLX_USE_MESA
@@ -98,7 +87,6 @@ X11FLAGS.OS_DEFINES+= -DXOS_USE_NO_LOCKING
.endif # defined(__MINIX)
.if !(${MACHINE} == "acorn32" || \
(${MACHINE} == "alpha" && ${X11FLAVOUR} != "Xorg") || \
${MACHINE} == "amiga" || \
${MACHINE} == "pmax" || \
${MACHINE} == "sun3" || \
@@ -136,7 +124,6 @@ X11FLAGS.LOADABLE= -DXFree86LOADER -DIN_MODULE -DXFree86Module \
.endif
# XXX FIX ME
.if ${X11FLAVOUR} == "Xorg"
XVENDORNAMESHORT= '"X.Org"'
XVENDORNAME= '"The X.Org Foundation"'
XORG_RELEASE= '"Release 1.10.6"'
@@ -146,7 +133,6 @@ XLOCALE.DEFINES= -DXLOCALEDIR=\"${X11LIBDIR}/locale\" \
# XXX oh yeah, fix me later
XORG_VERSION_CURRENT="(((1) * 10000000) + ((10) * 100000) + ((6) * 1000) + 0)"
.endif
PRINT_PACKAGE_VERSION= awk '/^PACKAGE_VERSION=/ { \
match($$1, "([0-9]+\\.)+[0-9]+"); \
@@ -154,15 +140,6 @@ PRINT_PACKAGE_VERSION= awk '/^PACKAGE_VERSION=/ { \
} END { print version }'
# Extract X11VERSION
PRINTX11VERSION=${TOOL_AWK} ' \
/^\#define XF86_VERSION_MAJOR/ {major = $$3} \
/^\#define XF86_VERSION_MINOR/ {minor = $$3} \
/^\#define XF86_VERSION_PATCH/ {patch = $$3} \
/^\#define XF86_VERSION_SNAP/ {snap = $$3} \
END { print "((("major") * 10000000) + (("minor") * 100000) + (("patch") * 1000) + "snap")"}' \
${X11SRCDIR.xc}/programs/Xserver/hw/xfree86/xf86Version.h
# Commandline to convert 'XCOMM' comments and 'XHASH' to '#', among other
# things. Transformed from the "CppSedMagic" macro from "Imake.rules".
#
@@ -230,7 +207,7 @@ CLEANFILES+= ${CPPSCRIPTS}
.if defined(PKGDIST) && !defined(PKGCONFIG)
PKGCONFIG= ${PKGDIST:tl}
.endif
.if defined(PKGCONFIG)
.if defined(PKGCONFIG) && !defined(MLIBDIR)
.include <bsd.files.mk>
@@ -259,7 +236,7 @@ pkgconfig-install: ${_PKGDEST.${_pkg}}
# Add a dependancy on the configure file if it exists; this way we
# will rebuild the .pc file if the version in configure changes.
.if exists(${PKGDIST.${_pkg}}/configure)
${_pkg}.pc: ${PKGDIST.${_pkg}}/configure
${_pkg}.pc: ${PKGDIST.${_pkg}}/configure Makefile
.endif
.endfor # }
@@ -268,8 +245,8 @@ ${_pkg}.pc: ${PKGDIST.${_pkg}}/configure
# The sed script is very, very ugly. What we actually need is a
# mknative-xorg script that will generate all the .pc files from
# running the autoconfigure script.
# And yes, it has to be splitted in two otherwise it's too long
# for sed to handle.
# And yes, it has to be split in multiple parts otherwise it's
# too long for sed to handle.
# hacky transforms:
# @XCBPROTO_VERSION@
@@ -285,6 +262,7 @@ ${_pkg}.pc: ${PKGDIST.${_pkg}}/configure
${PKGDIST.${.PREFIX}}/configure); \
fi; \
${TOOL_SED} \
${PKGCONFIG_SED_FLAGS} \
-e "s,@prefix@,${X11ROOTDIR},; \
s,@INSTALL_DIR@,${X11ROOTDIR},; \
s,@exec_prefix@,\\$$\{prefix\},; \
@@ -310,6 +288,8 @@ ${_pkg}.pc: ${PKGDIST.${_pkg}}/configure
s,@xcbincludedir@,\\$$\{prefix\}/share/xcb,; \
s,@fontrootdir@,\\$$\{libdir\}/X11/fonts,; \
s,@LIBXML2_LIBS@,,; \
s,@LIBXML2_CFLAGS@,,; \
s,@ICONV_CFLAGS@,,; \
s,@ICONV_LIBS@,,; \
s,@NEEDED@,,; \
s,@FT2_EXTRA_LIBS@,," \
@@ -332,7 +312,8 @@ ${_pkg}.pc: ${PKGDIST.${_pkg}}/configure
s,@GL_LIB@,GL,; \
s,@GL_PC_REQ_PRIV@,x11 xext,; \
s,@GL_PC_LIB_PRIV@,-lm -lpthread,; \
s,@GL_PC_CFLAGS@,," \
s,@GL_PC_CFLAGS@,,; \
s,@GLX_TLS@,no," \
-e "s,@GLU_LIB@,GLU,; \
s,@GLU_PC_REQ@,gl,; \
s,@GLU_PC_REQ_PRIV@,,; \
@@ -348,18 +329,27 @@ ${_pkg}.pc: ${PKGDIST.${_pkg}}/configure
s,@DRI_DRIVER_DIR@,\\$$\{libdir\}/modules/dri,; \
s,@DRI_PC_REQ_PRIV@,,; \
s,@GLW_LIB@,GLw,; \
s,@GBM_PC_REQ_PRIV@,,; \
s,@GBM_PC_LIB_PRIV@,,; \
s,@abi_ansic@,0.4,; \
s,@abi_videodrv@,5.0,; \
s,@abi_xinput@,4.0,; \
s,@abi_extension@,2.0,; \
s,@abi_font@,0.6,; \
s,@fchown_define@,-DHAS_FCHOWN,; \
s,@sticky_bit_define@,-DHAS_STICKY_DIR_BIT," \
s,@sticky_bit_define@,-DHAS_STICKY_DIR_BIT,;" \
-e "s,@PKG_CONFIG_LIBS@,${PKG_CONFIG_LIBS},; \
s,@PACKAGE@,${PKGDIST},; \
s,@PKGCONFIG_REQUIRES@,${PKGCONFIG_REQUIRES},; \
s,@PKGCONFIG_REQUIRES_PRIVATELY@,${PKGCONFIG_REQUIRES_PRIVATELY},; \
s,@ERRORDBDIR@,${X11LIBDIR},; \
s,@EXPAT_CFLAGS@,,; \
s,@FREETYPE_CFLAGS@,-I${X11ROOTDIR}/include/freetype2 -I${X11ROOTDIR}/include,;" \
-e '/^Libs:/ s%-L\([^ ]*\)%-Wl,-rpath,\1 &%g' \
< ${.IMPSRC} > ${.TARGET}.tmp && \
mv -f ${.TARGET}.tmp ${.TARGET}
CLEANDIRFILES+= ${_PKGCONFIG_FILES} ${_PKGCONFIG_FILES:C/$/.tmp/}
CLEANFILES+= ${_PKGCONFIG_FILES} ${_PKGCONFIG_FILES:C/$/.tmp/}
.endif
#
@@ -408,12 +398,6 @@ _X11MANTRANSFORM= \
${X11EXTRAMANTRANSFORMS}
# Note the escaping trick for _X11MANTRANSFORM using % to replace spaces
.if ${X11FLAVOUR} != "Xorg"
X11VERSION= "XFree86 4.5.0"
X11MANCPP?= yes
_X11MANTRANSFORM+= \
__vendorversion__ ${X11VERSION:C/ /%/gW}
.else
XORGVERSION= '"X Version 11"'
X11MANCPP?= no
_X11MANTRANSFORM+= \
@@ -424,7 +408,6 @@ _X11MANTRANSFORM+= \
__xorgversion__ ${XORGVERSION:C/ /%/gW} \
__XSERVERNAME__ Xorg \
__xservername__ Xorg
.endif
_X11MANTRANSFORMCMD= ${TOOL_SED} -e 's/\\$$/\\ /' ${.IMPSRC}
+23 -53
View File
@@ -1,4 +1,4 @@
# $NetBSD: sys.mk,v 1.118 2013/11/01 17:07:37 christos Exp $
# $NetBSD: sys.mk,v 1.128 2015/07/06 00:21:51 chs Exp $
# @(#)sys.mk 8.2 (Berkeley) 3/21/94
#
# This file contains the basic rules for make(1) and is read first
@@ -42,8 +42,7 @@ AS?= as
AFLAGS?=
COMPILE.s?= ${CC} ${AFLAGS} ${AFLAGS.${<:T}} -c
LINK.s?= ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${LDFLAGS}
#_ASM_TRADITIONAL_CPP= -x assembler-with-cpp
_ASM_TRADITIONAL_CPP=
_ASM_TRADITIONAL_CPP= -x assembler-with-cpp
COMPILE.S?= ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${CPPFLAGS} ${_ASM_TRADITIONAL_CPP} -c
LINK.S?= ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${CPPFLAGS} ${LDFLAGS}
@@ -52,10 +51,12 @@ CC?= cc
# -O2 is too -falign-* zealous for low-memory sh3 machines
DBG?= -Os -freorder-blocks
.elif ${MACHINE_ARCH} == "m68k" || ${MACHINE_ARCH} == "m68000"
# see src/doc/HACKS for details
DBG?= -Os
# -freorder-blocks (enabled by -O2) produces much bigger code
DBG?= -O2 -fno-reorder-blocks
.elif ${MACHINE_ARCH} == "coldfire"
DBG?= -O1
.elif !empty(MACHINE_ARCH:Maarch64*)
DBG?= -O2 ${"${.TARGET:M*.po}" == "":? -fomit-frame-pointer:}
.elif ${MACHINE_ARCH} == "vax"
DBG?= -O1 -fgcse -fstrength-reduce -fgcse-after-reload
.else
@@ -72,11 +73,7 @@ LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
# C Type Format data is required for DTrace
CTFFLAGS ?= -g -L VERSION
CTFMFLAGS ?= -g -t -L VERSION
# We don't define these here, we let the bsd.own.mk to do it
#CTFCONVERT ?= ctfconvert
#CTFMERGE ?= ctfmerge
CTFMFLAGS ?= -t -g -L VERSION
CXX?= c++
CXXFLAGS?= ${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-Wno-pointer-sign:N-ffreestanding:N-std=gnu[0-9][0-9]:N-Wold-style-definition:N-Wno-format-zero-length}
@@ -117,7 +114,7 @@ LFLAGS?=
LEX.l?= ${LEX} ${LFLAGS}
LINT?= lint
LINTFLAGS?= -chapbxzFS
LINTFLAGS?= -chapbxzgFS
LORDER?= lorder
@@ -143,14 +140,11 @@ YACC.y?= ${YACC} ${YFLAGS}
# C
.c:
${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
# XXX: disable for now
# ${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.c.o:
${COMPILE.c} ${.IMPSRC}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.c.a:
${COMPILE.c} ${.IMPSRC}
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -175,9 +169,7 @@ YACC.y?= ${YACC} ${YFLAGS}
${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.f.o:
${COMPILE.f} ${.IMPSRC}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.f.a:
${COMPILE.f} ${.IMPSRC}
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -185,14 +177,10 @@ YACC.y?= ${YACC} ${YFLAGS}
.F:
${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.F.o:
${COMPILE.F} ${.IMPSRC}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.F.a:
${COMPILE.F} ${.IMPSRC}
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -202,9 +190,7 @@ YACC.y?= ${YACC} ${YFLAGS}
${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.r.o:
${COMPILE.r} ${.IMPSRC}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.r.a:
${COMPILE.r} ${.IMPSRC}
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -213,14 +199,10 @@ YACC.y?= ${YACC} ${YFLAGS}
# Pascal
.p:
${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.p.o:
${COMPILE.p} ${.IMPSRC}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.p.a:
${COMPILE.p} ${.IMPSRC}
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -229,28 +211,20 @@ YACC.y?= ${YACC} ${YFLAGS}
# Assembly
.s:
${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.s.o:
${COMPILE.s} ${.IMPSRC}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.s.a:
${COMPILE.s} ${.IMPSRC}
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
rm -f ${.PREFIX}.o
.S:
${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.S.o:
${COMPILE.S} ${.IMPSRC}
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
.S.a:
${COMPILE.S} ${.IMPSRC}
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -267,9 +241,7 @@ YACC.y?= ${YACC} ${YFLAGS}
.l.o:
${LEX.l} ${.IMPSRC}
${COMPILE.c} -o ${.TARGET} lex.yy.c
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
rm -f lex.yy.c
# Yacc
@@ -283,9 +255,7 @@ YACC.y?= ${YACC} ${YFLAGS}
.y.o:
${YACC.y} ${.IMPSRC}
${COMPILE.c} -o ${.TARGET} y.tab.c
.if defined(CTFCONVERT)
${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.endif
${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
rm -f y.tab.c
# Shell