From 6e686c26fa53aacf3413ed69464e86cae950c1f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Wed, 11 Dec 2019 10:37:56 +0100 Subject: [PATCH] Makefile: Add cscope and tags rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These were added to the kernel repo, but not in Github. However, they are useful for browsing the source in Github while prototyping new features and compiling them into userspace utilities. Signed-off-by: Toke Høiland-Jørgensen --- src/Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Makefile b/src/Makefile index ad67c81..e539c02 100644 --- a/src/Makefile +++ b/src/Makefile @@ -68,6 +68,8 @@ LIBDIR ?= $(PREFIX)/$(LIBSUBDIR) INCLUDEDIR ?= $(PREFIX)/include UAPIDIR ?= $(PREFIX)/include +TAGS_PROG := $(if $(shell which etags 2>/dev/null),etags,ctags) + all: $(STATIC_LIBS) $(SHARED_LIBS) $(PC_FILE) $(OBJDIR)/libbpf.a: $(STATIC_OBJS) @@ -133,3 +135,12 @@ install_pkgconfig: $(PC_FILE) clean: rm -rf *.o *.a *.so *.so.* *.pc $(SHARED_OBJDIR) $(STATIC_OBJDIR) + +.PHONY: cscope tags +cscope: + ls *.c *.h > cscope.files + cscope -b -q -f cscope.out + +tags: + rm -f TAGS tags + ls *.c *.h | xargs $(TAGS_PROG) -a