summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-02-06 20:33:13 -0500
committerJune McEnroe <june@causal.agency>2018-02-06 20:35:44 -0500
commit41e6147e16a614ead51bf7d80896be9f3fdf531c (patch)
tree07e0a38872f826fb12160c725d4e101bf158414d
parentReplace gfxx SCALE macro with interp function (diff)
downloadsrc-41e6147e16a614ead51bf7d80896be9f3fdf531c.tar.gz
src-41e6147e16a614ead51bf7d80896be9f3fdf531c.zip
Add tags target
This seems a bit out of character for me, but this is basically free:
ctags(1) is part of FreeBSD and Darwin, and vim automatically uses tags.
Also the format of tags files is cute.
-rw-r--r--bin/.gitignore1
-rw-r--r--bin/Makefile7
2 files changed, 6 insertions, 2 deletions
diff --git a/bin/.gitignore b/bin/.gitignore
index 354e7720..f20dec2e 100644
--- a/bin/.gitignore
+++ b/bin/.gitignore
@@ -1,3 +1,4 @@
+tags
 *.o
 atch
 dtch
diff --git a/bin/Makefile b/bin/Makefile
index d6d46e4c..a6e734f9 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -7,7 +7,7 @@ ALL_BINS = $(ANY_BINS) $(BSD_BINS) $(MAC_BINS) $(LIN_BINS)
 CFLAGS += -Wall -Wextra -Wpedantic
 LDLIBS = -lcurses -ledit -lutil -lz
 
-any: .gitignore $(ANY_BINS)
+any: .gitignore tags $(ANY_BINS)
 
 bsd: any $(BSD_BINS)
 
@@ -45,6 +45,9 @@ unlink:
 	rm -f $(ALL_BINS:%=~/.bin/%)
 
 .gitignore: Makefile
-	echo '*.o' $(ALL_BINS) | tr ' ' '\n' > .gitignore
+	echo tags '*.o' $(ALL_BINS) | tr ' ' '\n' > .gitignore
+
+tags: *.c
+	ctags *.c
 
 .PHONY: any bsd mac linux setuid clean link unlink