Skip to contentSkip to conversation

Makefile: introduce gtags target

PATCH In review Wei Liu 2 participants 2 messages Sep 27, 2016 Kbuild

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 Makefile: introduce gtags target

---
 .gitignore |  3 +++
 Makefile   | 10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
.gitignore +3 -0
index f69e7fc..28c7874 100644
@@ -11,3 +11,6 @@
 /selftests/test-*
 /tests/*/test-*
 /tests/*/info.json
+/GPATH
+/GRTAGS
+/GTAGS
Makefile +9 -1
index 17d784e..6767f72 100644
@@ -50,11 +50,19 @@ install:
 		$(MAKE) -C $$D install; \
 	done
 
+define all_sources
+    ( find include/ arch/ common/ tests/ -name "*.[hcsS]" )
+endef
+
 .PHONY: cscope
 cscope:
-	find include/ arch/ common/ tests/ -name "*.[hcsS]" > cscope.files
+	$(all_sources) > cscope.files
 	cscope -b -q -k
 
+.PHONY: gtags
+gtags:
+	$(all_sources) | gtags -f -
+
 .PHONY: clean
 clean:
 	find . \( -name "*.o" -o -name "*.d" -o -name "*.lds" \) -delete
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 22 lines · Wei Liu
---
 .gitignore |  3 +++
 Makefile   | 10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
.gitignore +3 -0
index f69e7fc..28c7874 100644
@@ -11,3 +11,6 @@
 /selftests/test-*
 /tests/*/test-*
 /tests/*/info.json
+/GPATH
+/GRTAGS
+/GTAGS
Makefile +0 -0
index 17d784e..6767f72 100644

Makefile install: · line 54

Quoted 5 lines
Makefile +2 -0
@@ -50,11 +50,19 @@ install:
 		$(MAKE) -C $$D install; \
 	done
 
+define all_sources
+    ( find include/ arch/ common/ tests/ -name "*.[hcsS]" )

Why the subshell? It doesn't look necessary.

Otherwise, Reviewed-by: Andrew Cooper <[email protected]>

Quoted 5 lines
Makefile +2 -1
+endef
+
 .PHONY: cscope
 cscope:
-	find include/ arch/ common/ tests/ -name "*.[hcsS]" > cscope.files

Makefile install: · line 68

Quoted 10 lines
Makefile +5 -0
+	$(all_sources) > cscope.files
 	cscope -b -q -k
 
+.PHONY: gtags
+gtags:
+	$(all_sources) | gtags -f -
+
 .PHONY: clean
 clean:
 	find . \( -name "*.o" -o -name "*.d" -o -name "*.lds" \) -delete

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel