summaryrefslogtreecommitdiffstats
path: root/share/mk
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-10-19 11:51:10 +0000
committerbapt <bapt@FreeBSD.org>2015-10-19 11:51:10 +0000
commitd93a51152871c391e2ff845cfd568a72cef65606 (patch)
treec6a11d30ab57567b8bd34aa1c679296e53bab799 /share/mk
parent4f9c78fa034aa8b8b2762c76143139953e2e2474 (diff)
parent5855be3ec6724e6451361f6ef8bd165bf9f949df (diff)
downloadFreeBSD-src-d93a51152871c391e2ff845cfd568a72cef65606.zip
FreeBSD-src-d93a51152871c391e2ff845cfd568a72cef65606.tar.gz
Merge from head
Diffstat (limited to 'share/mk')
-rw-r--r--share/mk/bsd.confs.mk4
-rw-r--r--share/mk/bsd.doc.mk5
-rw-r--r--share/mk/bsd.files.mk2
-rw-r--r--share/mk/bsd.incs.mk4
-rw-r--r--share/mk/bsd.info.mk4
-rw-r--r--share/mk/bsd.lib.mk16
-rw-r--r--share/mk/bsd.man.mk4
-rw-r--r--share/mk/bsd.prog.mk6
-rw-r--r--share/mk/bsd.progs.mk28
-rw-r--r--share/mk/bsd.subdir.mk13
-rw-r--r--share/mk/bsd.sys.mk20
-rw-r--r--share/mk/src.libnames.mk1
-rw-r--r--share/mk/sys.mk13
13 files changed, 76 insertions, 44 deletions
diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk
index 4e219e8..36298d7 100644
--- a/share/mk/bsd.confs.mk
+++ b/share/mk/bsd.confs.mk
@@ -69,7 +69,7 @@ _${group}INS: ${_${group}CONFS}
${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME}
.else
${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
- ${.ALLSRC} ${DESTDIR}${${group}DIR}
+ ${.ALLSRC} ${DESTDIR}${${group}DIR}/
.endif
.endif
@@ -84,4 +84,4 @@ STAGE_TARGETS+= stage_config
.endif
.endif
-.endif # ${MK_TOOLCHAIN} != "no"
+.endif # ${MK_INCLUDES} != "no"
diff --git a/share/mk/bsd.doc.mk b/share/mk/bsd.doc.mk
index 9c6b005..c89c09d 100644
--- a/share/mk/bsd.doc.mk
+++ b/share/mk/bsd.doc.mk
@@ -133,11 +133,11 @@ CLEANFILES+= ${DOC}.ascii ${DOC}.ascii${DCOMPRESS_EXT} \
${DOC}.html ${DOC}-*.html
realinstall:
-.for _dev in ${PRINTERDEVICE:Mhtml}
+.if ${PRINTERDEVICE:Mhtml}
cd ${SRCDIR}; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}
-.endfor
+.endif
.for _dev in ${PRINTERDEVICE:Nhtml}
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${DFILE.${_dev}} ${DESTDIR}${BINDIR}/${VOLUME}
@@ -184,7 +184,6 @@ ${DFILE.html}: ${SRCS}
.else # unroff(1) requires a macro package as an argument
cd ${SRCDIR}; ${UNROFF} -ms ${UNROFFFLAGS} \
document=${DOC} ${SRCS}
-.else
.endif
.endif
.endfor
diff --git a/share/mk/bsd.files.mk b/share/mk/bsd.files.mk
index b9379d9..6a6c66a 100644
--- a/share/mk/bsd.files.mk
+++ b/share/mk/bsd.files.mk
@@ -75,7 +75,7 @@ _${group}INS: ${_${group}FILES}
${DESTDIR}${${group}DIR}/${${group}NAME}
.else
${INSTALL} -o ${${group}OWN} -g ${${group}GRP} \
- -m ${${group}MODE} ${.ALLSRC} ${DESTDIR}${${group}DIR}
+ -m ${${group}MODE} ${.ALLSRC} ${DESTDIR}${${group}DIR}/
.endif
.endif
diff --git a/share/mk/bsd.incs.mk b/share/mk/bsd.incs.mk
index 3f9680a..8ea97ba 100644
--- a/share/mk/bsd.incs.mk
+++ b/share/mk/bsd.incs.mk
@@ -70,7 +70,7 @@ _${group}INS: ${_${group}INCS}
${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME}
.else
${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
- ${.ALLSRC} ${DESTDIR}${${group}DIR}
+ ${.ALLSRC} ${DESTDIR}${${group}DIR}/
.endif
.endif
@@ -99,4 +99,4 @@ STAGE_SYMLINKS.INCS= ${INCSLINKS}
.endif
.endif
-.endif # ${MK_TOOLCHAIN} != "no"
+.endif # ${MK_INCLUDES} != "no"
diff --git a/share/mk/bsd.info.mk b/share/mk/bsd.info.mk
index 8f91315..7720d28 100644
--- a/share/mk/bsd.info.mk
+++ b/share/mk/bsd.info.mk
@@ -177,11 +177,11 @@ CLEANFILES+= ${INFO:S/$/.info.*.html/} ${INFO:S/$/.info/}
install: ${INSTALLINFODIRS}
.if !empty(IFILES:N*.html)
${INSTALL} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \
- ${IFILES:N*.html} ${DESTDIR}${INFODIR}
+ ${IFILES:N*.html} ${DESTDIR}${INFODIR}/
.endif
.if !empty(FORMATS:Mhtml)
${INSTALL} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \
- ${INFO:S/$/.info.*.html/} ${DESTDIR}${INFODIR}
+ ${INFO:S/$/.info.*.html/} ${DESTDIR}${INFODIR}/
.endif
.else
# The indirection in the following is to avoid the null install rule
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 0ed8345..e906ab7 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -140,7 +140,7 @@ SHLIB_NAME_FULL=${SHLIB_NAME}.full
# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
.if ${_SHLIBDIR} == "/boot" ||\
${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\
- ${SHLIBDIR:C%/usr/lib(32)?(/.*)?%/usr/lib%} == "/usr/lib"
+ ${SHLIBDIR:C%/usr/(tests/)?lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib"
DEBUGFILEDIR=${DEBUGDIR}${_SHLIBDIR}
.else
DEBUGFILEDIR=${_SHLIBDIR}/.debug
@@ -339,23 +339,23 @@ realinstall: _libinstall
_libinstall:
.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no"
${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR}
+ ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR}/
.endif
.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB)
${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR}
+ ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR}/
.endif
.if defined(SHLIB_NAME)
${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \
- ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}
+ ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/
.if ${MK_DEBUG_FILES} != "no"
.if defined(DEBUGMKDIR)
- ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR}
+ ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR}/
.endif
${INSTALL} -T debug -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \
${_INSTALLFLAGS} \
- ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}
+ ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}/
.endif
.if defined(SHLIB_LINK)
.if commands(${SHLIB_LINK:R}.ld)
@@ -378,11 +378,11 @@ _libinstall:
.endif # SHIB_NAME
.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no"
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}
+ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/
.endif
.if defined(WANT_LINT) && !defined(NO_LINT) && defined(LIB) && !empty(LIB)
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${_INSTALLFLAGS} ${LINTLIB} ${DESTDIR}${LINTLIBDIR}
+ ${_INSTALLFLAGS} ${LINTLIB} ${DESTDIR}${LINTLIBDIR}/
.endif
.endif # !defined(INTERNALLIB)
diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk
index bbb47b9..72aedfb 100644
--- a/share/mk/bsd.man.mk
+++ b/share/mk/bsd.man.mk
@@ -187,7 +187,7 @@ _maninstall: ${MAN}
.endfor
.else
.for _page _sect in ${.ALLSRC:C/\.([^.]*)$/.\1 \1/}
- @d=${DESTDIR}${MANDIR}${_sect}${MANSUBDIR}; \
+ @d=${DESTDIR}${MANDIR}${_sect}${MANSUBDIR}/; \
${ECHO} ${MINSTALL} ${_page} $${d}; \
${MINSTALL} $${page} $${d};
.endfor
@@ -201,7 +201,7 @@ _maninstall: ${MAN}
.else
.for __page in ${MAN}
${MINSTALL} ${__page:T:S/$/${MCOMPRESS_EXT}/g} \
- ${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR}
+ ${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR}/
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
${MINSTALL} ${__page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g} \
${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T:S/$/${MCOMPRESS_EXT}/}
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index 966c17e..fbb6922 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -56,9 +56,9 @@ PROG_FULL=${PROG}.full
# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
.if defined(BINDIR) && (\
${BINDIR} == "/bin" ||\
- ${BINDIR} == "/libexec" ||\
+ ${BINDIR:C%/libexec(/.*)?%/libexec%} == "/libexec" ||\
${BINDIR} == "/sbin" ||\
- ${BINDIR:C%/usr/(bin|bsdinstall|libexec|lpr|sendmail|sm.bin|sbin)(/.*)?%/usr/bin%} == "/usr/bin"\
+ ${BINDIR:C%/usr/(bin|bsdinstall|libexec|lpr|sendmail|sm.bin|sbin|tests)(/.*)?%/usr/bin%} == "/usr/bin"\
)
DEBUGFILEDIR= ${DEBUGDIR}${BINDIR}
.else
@@ -205,7 +205,7 @@ _proginstall:
${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME}
.if ${MK_DEBUG_FILES} != "no"
.if defined(DEBUGMKDIR)
- ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR}
+ ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR}/
.endif
${INSTALL} -T debug -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \
${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug
diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk
index ab52708..2da30c7 100644
--- a/share/mk/bsd.progs.mk
+++ b/share/mk/bsd.progs.mk
@@ -31,6 +31,9 @@ UPDATE_DEPENDFILE_PROG = ${PROGS:[1]}
# They may have asked us to build just one
.for t in ${PROGS}
.if make($t)
+.if ${PROGS_CXX:M${t}}
+PROG_CXX ?= $t
+.endif
PROG ?= $t
.endif
.endfor
@@ -61,7 +64,7 @@ UPDATE_DEPENDFILE ?= yes
UPDATE_DEPENDFILE ?= NO
# prog.mk will do the rest
-.else
+.else # !defined(PROG)
all: ${PROGS}
# We cannot capture dependencies for meta mode here
@@ -80,10 +83,29 @@ $v =
# handle being called [bsd.]progs.mk
.include <bsd.prog.mk>
-.if !empty(PROGS) && !defined(_RECURSING_PROGS)
+.if !empty(PROGS) && !defined(_RECURSING_PROGS) && !defined(PROG)
# tell progs.mk we might want to install things
PROGS_TARGETS+= checkdpadd clean cleandepend cleandir depend install
+# Find common sources among the PROGS and depend on them before building
+# anything. This allows parallelization without them each fighting over
+# the same objects.
+_PROGS_COMMON_SRCS=
+_PROGS_ALL_SRCS=
+.for p in ${PROGS}
+.for s in ${SRCS.${p}}
+.if ${_PROGS_ALL_SRCS:M${s}} && !${_PROGS_COMMON_SRCS:M${s}}
+_PROGS_COMMON_SRCS+= ${s}
+.else
+_PROGS_ALL_SRCS+= ${s}
+.endif
+.endfor
+.endfor
+.if !empty(_PROGS_COMMON_SRCS)
+_PROGS_COMMON_OBJS= ${_PROGS_COMMON_SRCS:N*.h:R:S/$/.o/g}
+${PROGS}: ${_PROGS_COMMON_OBJS}
+.endif
+
.for p in ${PROGS}
.if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p)
# bsd.prog.mk may need to know this
@@ -111,4 +133,4 @@ $p.$t: .PHONY .MAKE
.for t in ${PROGS_TARGETS:O:u}
$t: ${PROGS:%=%.$t}
.endfor
-.endif
+.endif # !empty(PROGS) && !defined(_RECURSING_PROGS) && !defined(PROG)
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk
index 293b017..037a7fe 100644
--- a/share/mk/bsd.subdir.mk
+++ b/share/mk/bsd.subdir.mk
@@ -32,9 +32,11 @@
.if !target(__<bsd.subdir.mk>__)
__<bsd.subdir.mk>__:
-ALL_SUBDIR_TARGETS= all all-man checkdpadd clean cleandepend cleandir \
- cleanilinks cleanobj depend distribute lint maninstall manlint obj \
- objlink realinstall regress tags ${SUBDIR_TARGETS}
+ALL_SUBDIR_TARGETS= all all-man buildconfig checkdpadd clean cleandepend \
+ cleandir cleanilinks cleanobj depend distribute \
+ installconfig lint maninstall manlint obj objlink \
+ realinstall regress tags \
+ ${SUBDIR_TARGETS}
.include <bsd.init.mk>
@@ -123,7 +125,10 @@ _sub.${__target}: _SUBDIR
.endif
.endfor
-.for __target in files includes config
+# This is to support 'make includes' calling 'make buildincludes' and
+# 'make installincludes' in the proper order, and to support these
+# targets as SUBDIR_TARGETS.
+.for __target in files includes
.for __stage in build install
${__stage}${__target}:
.if make(${__stage}${__target})
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 044b668..cad2b2f 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -148,8 +148,14 @@ CXXFLAGS.clang+= -Wno-c++11-extensions
.if ${MK_SSP} != "no" && \
${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
+.if (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30500) || \
+ (${COMPILER_TYPE} == "gcc" && \
+ (${COMPILER_VERSION} == 40201 || ${COMPILER_VERSION} >= 40900))
# Don't use -Wstack-protector as it breaks world with -Werror.
SSP_CFLAGS?= -fstack-protector-strong
+.else
+SSP_CFLAGS?= -fstack-protector
+.endif
CFLAGS+= ${SSP_CFLAGS}
.endif # SSP && !ARM && !MIPS
@@ -165,13 +171,13 @@ CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}}
# Tell bmake not to mistake standard targets for things to be searched for
# or expect to ever be up-to-date.
PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \
- beforelinking build build-tools buildfiles buildincludes \
- checkdpadd clean cleandepend cleandir cleanobj configure \
- depend dependall distclean distribute exe \
- html includes install installfiles installincludes lint \
- obj objlink objs objwarn realall realdepend \
- realinstall regress subdir-all subdir-depend subdir-install \
- tags whereobj
+ beforelinking build build-tools buildconfig buildfiles \
+ buildincludes checkdpadd clean cleandepend cleandir cleanobj \
+ configure depend dependall distclean distribute exe \
+ files html includes install installconfig installfiles \
+ installincludes lint obj objlink objs objwarn realall \
+ realdepend realinstall regress subdir-all subdir-depend \
+ subdir-install tags whereobj
# we don't want ${PROG} to be PHONY
.PHONY: ${PHONY_NOTMAIN:N${PROG:U}}
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index fc287e3..61f9d79 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -240,6 +240,7 @@ _DP_vmmapi= util
_DP_ctf= z
_DP_proc= rtld_db util
_DP_dtrace= rtld_db pthread
+_DP_xo= util
# Define spacial cases
LDADD_supcplusplus= -lsupc++
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index e8f4892..b6c75b6 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -145,13 +145,12 @@ ECHODIR ?= true
.endif
.endif
-.if defined(.PARSEDIR)
-# _+_ appears to be a workaround for the special src .MAKE not working.
-# setting it to + interferes with -N
-_+_ ?=
-.elif !empty(.MAKEFLAGS:M-n) && ${.MAKEFLAGS:M-n} == "-n"
-# the check above matches only a single -n, so -n -n will result
-# in _+_ = +
+.if ${.MAKEFLAGS:M-N}
+# bmake -N is supposed to skip executing anything but it does not skip
+# exeucting '+' commands. The '+' feature is used where .MAKE
+# is not safe for the entire target. -N is intended to skip building sub-makes
+# so it executing '+' commands is not right. Work around the bug by not
+# setting '+' when -N is used.
_+_ ?=
.else
_+_ ?= +
OpenPOWER on IntegriCloud