Module Name: src
Committed By: lukem
Date: Wed Jul 1 07:38:29 UTC 2020
Modified Files:
src/share/mk: bsd.dep.mk
Log Message:
bsd.dep.mk: fix "make tags" (again)
[repeat revision 1.85]
Fix "make tags" to actually build a tags file:
- Use !commands() instead of !target(), so that the rule actually works
- Write to ${.OBJDIR}/tags for read-only source (don't know why ${.TARGET}
isn't sufficient).
- Only match *.[cly] from ${.ALLSRCS} - just excluding *.h causes failures
because of ${targ}: subdir-${targ} in bsd.subdir.mk.
Thanks to uwe@ for assistance.
To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/share/mk/bsd.dep.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/mk/bsd.dep.mk
diff -u src/share/mk/bsd.dep.mk:1.86 src/share/mk/bsd.dep.mk:1.87
--- src/share/mk/bsd.dep.mk:1.86 Mon Jun 22 01:04:26 2020
+++ src/share/mk/bsd.dep.mk Wed Jul 1 07:38:29 2020
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.dep.mk,v 1.86 2020/06/22 01:04:26 lukem Exp $
+# $NetBSD: bsd.dep.mk,v 1.87 2020/07/01 07:38:29 lukem Exp $
##### Basic targets
realdepend: beforedepend .depend afterdepend
@@ -94,16 +94,16 @@ _MKDEP_FILEFLAGS=
##### Clean rules
.if defined(SRCS) && !empty(SRCS)
-CLEANDIRFILES+= .depend ${__DPSRCS.d} ${__DPSRCS.d:.d=.d.tmp} ${.CURDIR}/tags ${CLEANDEPEND}
+CLEANDIRFILES+= .depend ${__DPSRCS.d} ${__DPSRCS.d:.d=.d.tmp} tags ${CLEANDEPEND}
.endif
##### Custom rules
-.if !target(tags)
+.if !commands(tags)
tags: ${SRCS}
.if defined(SRCS) && !empty(SRCS)
${_MKTARGET_CREATE}
- -cd "${.CURDIR}"; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
- ${TOOL_SED} "s;\${.CURDIR}/;;" > tags
+ -cd "${.CURDIR}"; ctags -f /dev/stdout ${.ALLSRC:M*.[cly]} | \
+ ${TOOL_SED} "s;\${.CURDIR}/;;" > ${.OBJDIR}/tags
.endif
.endif