Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/mk bsd.dep.mk: fix "make tags"



details:   https://anonhg.NetBSD.org/src/rev/2028d00e71fb
branches:  trunk
changeset: 1011150:2028d00e71fb
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Jun 21 03:39:21 2020 +0000

description:
bsd.dep.mk: fix "make tags"

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.

diffstat:

 share/mk/bsd.dep.mk |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r 3ae012dde706 -r 2028d00e71fb share/mk/bsd.dep.mk
--- a/share/mk/bsd.dep.mk       Sun Jun 21 00:39:59 2020 +0000
+++ b/share/mk/bsd.dep.mk       Sun Jun 21 03:39:21 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.dep.mk,v 1.84 2019/01/21 21:11:54 christos Exp $
+#      $NetBSD: bsd.dep.mk,v 1.85 2020/06/21 03:39:21 lukem Exp $
 
 ##### Basic targets
 realdepend:    beforedepend .depend afterdepend
@@ -94,16 +94,16 @@
 
 ##### 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
 



Home | Main Index | Thread Index | Old Index