svn commit: r349202 - head/share/mk

Bryan Drewery bdrewery at FreeBSD.org
Wed Jun 19 19:19:38 UTC 2019


Author: bdrewery
Date: Wed Jun 19 19:19:37 2019
New Revision: 349202
URL: https://svnweb.freebsd.org/changeset/base/349202

Log:
  Follow-up r349065: Fix .TARGET flag ambiguity with PROGS which broke MK_TESTS.
  
  X-MFC-With:	r349065
  Sponsored by:	DellEMC

Modified:
  head/share/mk/bsd.sys.mk

Modified: head/share/mk/bsd.sys.mk
==============================================================================
--- head/share/mk/bsd.sys.mk	Wed Jun 19 18:47:44 2019	(r349201)
+++ head/share/mk/bsd.sys.mk	Wed Jun 19 19:19:37 2019	(r349202)
@@ -234,7 +234,6 @@ DEBUG_FILES_CFLAGS?= -g
 .if ${MK_WARNS} != "no"
 CFLAGS+=	${CWARNFLAGS:M*} ${CWARNFLAGS.${COMPILER_TYPE}}
 CFLAGS+=	${CWARNFLAGS.${.IMPSRC:T}}
-CFLAGS+=	${CWARNFLAGS.${.TARGET:T}}
 .endif
 
 CFLAGS+=	 ${CFLAGS.${COMPILER_TYPE}}
@@ -245,14 +244,23 @@ AFLAGS+=	${AFLAGS.${.TARGET:T}}
 ACFLAGS+=	${ACFLAGS.${.IMPSRC:T}}
 ACFLAGS+=	${ACFLAGS.${.TARGET:T}}
 CFLAGS+=	${CFLAGS.${.IMPSRC:T}}
-CFLAGS+=	${CFLAGS.${.TARGET:T}}
 CXXFLAGS+=	${CXXFLAGS.${.IMPSRC:T}}
-CXXFLAGS+=	${CXXFLAGS.${.TARGET:T}}
 
 LDFLAGS+=	${LDFLAGS.${LINKER_TYPE}}
+
+# Only allow .TARGET when not using PROGS as it has the same syntax
+# per PROG which is ambiguous with this syntax. This is only needed
+# for PROG_VARS vars.
+.if !defined(_RECURSING_PROGS)
+.if ${MK_WARNS} != "no"
+CFLAGS+=	${CWARNFLAGS.${.TARGET:T}}
+.endif
+CFLAGS+=	${CFLAGS.${.TARGET:T}}
+CXXFLAGS+=	${CXXFLAGS.${.TARGET:T}}
 LDFLAGS+=	${LDFLAGS.${.TARGET:T}}
 LDADD+=		${LDADD.${.TARGET:T}}
 LIBADD+=	${LIBADD.${.TARGET:T}}
+.endif
 
 .if defined(SRCTOP)
 # Prevent rebuilding during install to support read-only objdirs.


More information about the svn-src-all mailing list