Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171495188
D55711.id173312.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D55711.id173312.diff
View Options
diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk
--- a/share/mk/bsd.progs.mk
+++ b/share/mk/bsd.progs.mk
@@ -15,6 +15,7 @@
PROGS += ${PROGS_CXX}
.if defined(PROG)
+_save_srcs:= ${SRCS:U}
# just one of many
PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE CSTD CXXSTD DPSRCS MAN \
NO_SHARED MK_WERROR PROGNAME STRIP WARNS MK_ASAN MK_UBSAN
@@ -91,8 +92,27 @@
# Find common sources among the PROGS to depend on them before building
# anything. This allows parallelization without them each fighting over
# the same objects.
-_PROGS_COMMON_SRCS= ${DPSRCS} ${SRCS}
-_PROGS_ALL_SRCS= ${SRCS}
+#
+# There are 3 cases to consider.
+# 1. No common sources.
+# SRCS=
+# SRCS.prog1= prog1.c
+# SRCS.prog2= prog2.c
+# 2. Common sources in all SRCS.$prog.
+# SRCS=
+# SRCS.prog1= prog1.c common.c
+# SRCS.prog2= prog2.c common.c
+# 3. Common sources in SRCS.
+# SRCS= common.c
+# SRCS.prog1= prog1.c
+# SRCS.prog2= prog2.c
+# The intent is:
+# a. Only build common objects in the parent make before recursing.
+# b. When recursing only build non-common objects.
+# c. When recursing disable meta mode for common objects so they are not
+# inspected.
+_PROGS_COMMON_SRCS= ${DPSRCS} ${_save_srcs}
+_PROGS_ALL_SRCS= ${_save_srcs}
.for p in ${PROGS}
.for s in ${SRCS.${p}}
.if ${_PROGS_ALL_SRCS:M${s}} && !${_PROGS_COMMON_SRCS:M${s}}
@@ -115,6 +135,7 @@
${_PROGS_COMMON_OBJS}: .NOMETA
.endif
.endif
+.undef _save_srcs
.if !empty(PROGS) && !defined(_RECURSING_PROGS) && !defined(PROG)
# tell progs.mk we might want to install things
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 12, 11:28 AM (16 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38787960
Default Alt Text
D55711.id173312.diff (1 KB)
Attached To
Mode
D55711: bsd.progs.mk: Fix incremental META_MODE for prog sources
Attached
Detach File
Event Timeline
Log In to Comment