Emacs exposes an environment variable `INSIDE_EMACS` which can be used
to toggle ctags to generate an Emacs-friendly TAGS file.
... | ... |
@@ -24,6 +24,10 @@ endif |
24 | 24 |
endif |
25 | 25 |
|
26 | 26 |
MKTAGS?=ctags |
27 |
+EMACS_COMPAT= |
|
28 |
+ifneq (INSIDE_EMACS,) |
|
29 |
+EMACS_COMPAT=-e |
|
30 |
+endif |
|
27 | 31 |
|
28 | 32 |
# forward all named targets |
29 | 33 |
%: |
... | ... |
@@ -41,7 +45,7 @@ install: |
41 | 45 |
.PHONY: TAGS |
42 | 46 |
.PHONY: tags |
43 | 47 |
TAGS tags: |
44 |
- $(MKTAGS) --exclude="misc/*" --exclude="test/*" -R . |
|
48 |
+ $(MKTAGS) $(EMACS_COMPAT) --exclude="misc/*" --exclude="test/*" -R . |
|
45 | 49 |
|
46 | 50 |
# clean everything generated - shortcut on maintainer-clean |
47 | 51 |
.PHONY: pure |