1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994-2012 Free Software Foundation, Inc.
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
21 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
22 ## Make sure the list of sources is unique.
23 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
24 unique=`for i in $$list; do \
25 ## Handle VPATH correctly.
26 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
28 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
29 END { if (nonempty) { for (i in files) print i; }; }'`; \
40 AM_RECURSIVE_TARGETS += tags TAGS
44 TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \
46 ## We use the positional parameters to build the subdir list with
47 ## absolute names, without the need to worry about white space in `pwd`.
50 ## Exuberant Ctags wants --etags-include,
51 ## GNU Etags --include
52 ## Furthermore Exuberant Ctags 5.5.4 fails to create TAGS files
53 ## when no files are supplied, despite any --etags-include option.
54 ## A workaround is to pass '.' as a file. This is what $empty_fix is for.
55 ?SUBDIRS? if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
56 ?SUBDIRS? include_option=--etags-include; \
57 ?SUBDIRS? empty_fix=.; \
59 ?SUBDIRS? include_option=--include; \
60 ?SUBDIRS? empty_fix=; \
62 ?SUBDIRS? list='$(SUBDIRS)'; for subdir in $$list; do \
63 ## Do nothing if we're trying to look in '.'.
64 ?SUBDIRS? if test "$$subdir" = .; then :; else \
65 ?SUBDIRS? test ! -f $$subdir/TAGS || \
66 ## Note that the = is mandatory for --etags-include.
67 ?SUBDIRS? set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
70 ## Make sure the list of sources is unique.
71 list='$(SOURCES) $(HEADERS) %CONFIG% $(LISP) $(TAGS_FILES)'; \
72 unique=`for i in $$list; do \
73 ## Handle VPATH correctly.
74 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
76 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
77 END { if (nonempty) { for (i in files) print i; }; }'`; \
78 ## Remove the 'x' we added first:
80 ## Make sure we have something to run etags on.
81 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
82 test -n "$$unique" || unique=$$empty_fix; \
83 if test $$# -gt 0; then \
84 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
87 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
100 AM_RECURSIVE_TARGETS += ctags CTAGS
104 ## We have a dummy name here because 'tags' has already been in use
105 ## for a long time to mean Emacs-style tags. Oops. This means the
106 ## dependencies here are useless.
107 CTAGS: %CTAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \
108 $(TAGS_FILES) $(LISP)
109 ## Make sure the list of sources is unique.
110 list='$(SOURCES) $(HEADERS) %CONFIG% $(LISP) $(TAGS_FILES)'; \
111 unique=`for i in $$list; do \
112 ## Handle VPATH correctly.
113 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
115 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
116 END { if (nonempty) { for (i in files) print i; }; }'`; \
117 ## Make sure we have something to run ctags on.
118 test -z "$(CTAGS_ARGS)$$unique" \
119 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
123 ## --------------- ##
125 ## --------------- ##
129 here=`$(am__cd) $(top_builddir) && pwd` \
130 && $(am__cd) $(top_srcdir) \
131 && gtags -i $(GTAGS_ARGS) "$$here"
141 .PHONY: cscope clean-cscope
142 AM_RECURSIVE_TARGETS += cscope
145 test ! -s cscope.files \
146 || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
151 cscope.files: clean-cscope %CSCOPEDIRS% cscopelist
156 cscopelist: %CSCOPEDIRS% $(HEADERS) $(SOURCES) $(LISP)
157 list='$(SOURCES) $(HEADERS) $(LISP)'; \
158 case "$(srcdir)" in \
159 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
160 *) sdir=$(subdir)/$(srcdir) ;; \
162 for i in $$list; do \
163 if test -f "$$i"; then \
164 echo "$(subdir)/$$i"; \
168 done >> $(top_builddir)/cscope.files
175 .PHONY distclean-am: distclean-tags
178 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
180 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files