diff mbox

[05/17] add 'make cscope' support

Message ID 1390321323-1855-6-git-send-email-drjones@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Jones Jan. 21, 2014, 4:21 p.m. UTC
Add a Makefile target to quickly generate arch-specific cscope
for kvm-unit-tests. Assumes a mostly flat directory structure,
i.e. uses '-maxdepth 1' in the file search.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 Makefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Christoffer Dall Feb. 2, 2014, 2:22 a.m. UTC | #1
On Tue, Jan 21, 2014 at 05:21:51PM +0100, Andrew Jones wrote:
> Add a Makefile target to quickly generate arch-specific cscope
> for kvm-unit-tests. Assumes a mostly flat directory structure,
> i.e. uses '-maxdepth 1' in the file search.
> 
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  Makefile | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index fa95d66386d49..283655957f39f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3,7 +3,7 @@ include config.mak
>  
>  DESTDIR := $(PREFIX)/share/qemu/tests
>  
> -.PHONY: arch_clean clean
> +.PHONY: arch_clean clean cscope
>  
>  #make sure env CFLAGS variable is not used
>  CFLAGS =
> @@ -52,3 +52,10 @@ install:
>  
>  clean: arch_clean
>  	$(RM) lib/.*.d $(libcflat) $(cflatobjs)
> +
> +cscope: common_dirs = lib
> +cscope:
> +	rm -f ./cscope.*
> +	find $(TEST_DIR) lib/$(TEST_DIR) $(common_dirs) -maxdepth 1 \
> +		-name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files

shouldn't you use single quotes for the -name pattern to avoid any
substitutions here?

> +	cscope -bk
> -- 
> 1.8.1.4
> 

Otherwise:
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andrew Jones Feb. 3, 2014, 1:25 p.m. UTC | #2
On Sat, Feb 01, 2014 at 06:22:58PM -0800, Christoffer Dall wrote:
> On Tue, Jan 21, 2014 at 05:21:51PM +0100, Andrew Jones wrote:
> > Add a Makefile target to quickly generate arch-specific cscope
> > for kvm-unit-tests. Assumes a mostly flat directory structure,
> > i.e. uses '-maxdepth 1' in the file search.
> > 
> > Signed-off-by: Andrew Jones <drjones@redhat.com>
> > ---
> >  Makefile | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index fa95d66386d49..283655957f39f 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -3,7 +3,7 @@ include config.mak
> >  
> >  DESTDIR := $(PREFIX)/share/qemu/tests
> >  
> > -.PHONY: arch_clean clean
> > +.PHONY: arch_clean clean cscope
> >  
> >  #make sure env CFLAGS variable is not used
> >  CFLAGS =
> > @@ -52,3 +52,10 @@ install:
> >  
> >  clean: arch_clean
> >  	$(RM) lib/.*.d $(libcflat) $(cflatobjs)
> > +
> > +cscope: common_dirs = lib
> > +cscope:
> > +	rm -f ./cscope.*
> > +	find $(TEST_DIR) lib/$(TEST_DIR) $(common_dirs) -maxdepth 1 \
> > +		-name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
> 
> shouldn't you use single quotes for the -name pattern to avoid any
> substitutions here?
> 

sure, will do
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Makefile b/Makefile
index fa95d66386d49..283655957f39f 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@  include config.mak
 
 DESTDIR := $(PREFIX)/share/qemu/tests
 
-.PHONY: arch_clean clean
+.PHONY: arch_clean clean cscope
 
 #make sure env CFLAGS variable is not used
 CFLAGS =
@@ -52,3 +52,10 @@  install:
 
 clean: arch_clean
 	$(RM) lib/.*.d $(libcflat) $(cflatobjs)
+
+cscope: common_dirs = lib
+cscope:
+	rm -f ./cscope.*
+	find $(TEST_DIR) lib/$(TEST_DIR) $(common_dirs) -maxdepth 1 \
+		-name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
+	cscope -bk