From ad676ad67866d11daac213d3b125a872c764f3ce Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Mon, 18 Sep 2017 16:04:16 +0930 Subject: [PATCH] Add 'tags' target to Makefile The 'make tags' indexes all the header and source files known to the Makefile, and also all the non-standard library headers used for compiling, such as libsodium, JNI and Android NDK. This supports the sp-mktags utility in serval-tools, which tries "make tags" before falling back to its own ctags command. --- Makefile.in | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index d0fd2dbb..58eb6df1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -109,7 +109,8 @@ clean: libservaldaemon.so libservaldaemon.a \ libservalclient.so libservalclient.a \ libmonitorclient.so libmonitorclient.a \ - tfw_createfile directory_service fakeradio simulator serval-tests + tfw_createfile directory_service fakeradio simulator serval-tests \ + tags # Only provide Java targets if the Java compiler is available. ifneq ($(JAVAC),) @@ -309,6 +310,15 @@ libmonitorclient.so: $(MONITOR_CLIENT_OBJS) $(OBJSDIR_TOOLS)/version.o @echo LINK $@ @$(CC) -Wall -shared -o $@ $^ $(LDFLAGS) +# The tags will always index all the Serval DNA headers and source files. If +# serval-tools is installed, then it will also index all the libsodium, JNI +# and Android NDK header files. +tags: Makefile $(HDRS) $(ALL_SOURCES) + { for file in $(HDRS) $(ALL_SOURCES); do echo "$$file"; done; \ + sp-find-gcc-headers $(CFLAGS) 2>/dev/null; \ + ndk_prefix=$$(sp-ndk-prefix . 2>/dev/null) && find "$$ndk_prefix/arch-arm/usr/include" -type f; \ + } | ctags -L- -f $@ --tag-relative=yes --c-kinds=defgmpstuv + # Helpful target to update the COPYRIGHT.txt file by harvesting copyright # information from the contents of all the source and header files. This # should be run periodically and the results reviewed, manually adjusted and