Page MenuHomeFreeBSD

D28467.id83311.diff
No OneTemporary

D28467.id83311.diff

Index: share/mk/bsd.lib.mk
===================================================================
--- share/mk/bsd.lib.mk
+++ share/mk/bsd.lib.mk
@@ -255,6 +255,15 @@
.if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME)
OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/}
+.if ${OBJS:M/*}
+# Absolute paths to OBJS should be an error inside ${SRCTOP}, but external users
+# might be relying on this feature, so make it a warning there.
+.if defined(SRCTOP) && ${OBJS:M${SRCTOP}*}
+.error "\$OBJS absolute path not allowed: ${OBJS:M${SRCTOP}*}"
+.else
+.warning "\$OBJS absolute path not allowed: ${OBJS:M/*}"
+.endif
+.endif
BCOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g}
LLOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g}
CLEANFILES+= ${OBJS} ${BCOBJS} ${LLOBJS} ${STATICOBJS}
Index: share/mk/bsd.prog.mk
===================================================================
--- share/mk/bsd.prog.mk
+++ share/mk/bsd.prog.mk
@@ -142,6 +142,15 @@
.if defined(SRCS)
OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/g}
+.if ${OBJS:M/*}
+# Absolute paths to OBJS should be an error inside ${SRCTOP}, but external users
+# might be relying on this feature, so make it a warning there.
+.if defined(SRCTOP) && ${OBJS:M${SRCTOP}*}
+.error "\$OBJS absolute path not allowed: ${OBJS:M${SRCTOP}*}"
+.else
+.warning "\$OBJS absolute path not allowed: ${OBJS:M/*}"
+.endif
+.endif
# LLVM bitcode / textual IR representations of the program
BCOBJS+=${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g}

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 9, 4:04 AM (14 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38560095
Default Alt Text
D28467.id83311.diff (1 KB)

Event Timeline