Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jan 2003 15:31:12 -0700 (MST)
From:      Lyndon Nerenberg <lyndon@orthanc.ab.ca>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/46676: [PATCH] bsd.dep.mk restricts domain of tags commands
Message-ID:  <200301012231.h01MVCna032796@orthanc.ab.ca>

next in thread | raw e-mail | index | archive | help


>Number:         46676
>Category:       bin
>Synopsis:       [PATCH] bsd.dep.mk restricts domain of tags commands
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 01 14:40:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Lyndon Nerenberg
>Release:        current
>Organization:
>Environment:
System: FreeBSD foo 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Wed Dec  4 11:49:07 MST 2002     root@foo:/u/freebsd/cvssrc/RELENG_4/sys/i386/compile/DL  i386
>Description:
	The tags target in bsd.dep.mk only allows ctags and gtags as
	tag generator commands.
>How-To-Repeat:
	Set CTAGS=etags in /etc/make.conf, then run make tags.
>Fix:
	The bsd.dep.mk rules have some intimate knowledge of the
	command line invocations of ctags and gtags. Setting the
	flags is done by comparing the CTAGS value to the fixed strings
	"ctags" and "gtags" with no default case. Thus, assigning any
	other value to CTAGS turns the tags target into a no-op.

	The attached patch removes the explicit ctags case, and instead
	makes that the default recipe unless CTAGS is set to gtags.
	The ctags-style invocation is generic enough that it should
	adapt to most other tags generators. It's not unreasonable to
	require the replacement tags command to support the -f switch.


--- /usr/src/share/mk/bsd.dep.mk	Thu Nov 28 15:19:38 2002
+++ bsd.dep.mk	Wed Jan  1 15:16:02 2003
@@ -56,14 +56,14 @@
 # Keep `tags' here, before SRCS are mangled below for `depend'.
 .if !target(tags) && defined(SRCS) && !defined(NOTAGS)
 tags: ${SRCS}
-.if ${CTAGS:T} == "ctags"
-	@${CTAGS} ${CTAGSFLAGS} -f /dev/stdout \
-	    ${.ALLSRC:N*.h} | sed "s;${.CURDIR}/;;" > ${.TARGET}
-.elif ${CTAGS:T} == "gtags"
+.if ${CTAGS:T} == "gtags"
 	@cd ${.CURDIR} && ${CTAGS} ${GTAGSFLAGS} ${.OBJDIR}
 .if defined(HTML)
 	@cd ${.CURDIR} && htags ${HTAGSFLAGS} -d ${.OBJDIR} ${.OBJDIR}
 .endif
+.else
+	@${CTAGS} ${CTAGSFLAGS} -f /dev/stdout \
+	    ${.ALLSRC:N*.h} | sed "s;${.CURDIR}/;;" > ${.TARGET}
 .endif
 .endif
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301012231.h01MVCna032796>