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 ## It is tempting to use if/endif here, but don't: the previous
51 ## backslash will cause bad results (automake doesn't `see' the `if').
52 ## Exuberant Ctags wants --etags-include,
53 ## GNU Etags --include
54 ## Furthermore Exuberant Ctags 5.5.4 fails to create TAGS files
55 ## when no files are supplied, despite any --etags-include option.
56 ## A workaround is to pass `.' as a file. This is what $empty_fix is for.
57 ?SUBDIRS? if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
58 ?SUBDIRS? include_option=--etags-include; \
59 ?SUBDIRS? empty_fix=.; \
61 ?SUBDIRS? include_option=--include; \
62 ?SUBDIRS? empty_fix=; \
64 ?SUBDIRS? list='$(SUBDIRS)'; for subdir in $$list; do \
65 ## Do nothing if we're trying to look in `.'.
66 ?SUBDIRS? if test "$$subdir" = .; then :; else \
67 ?SUBDIRS? test ! -f $$subdir/TAGS || \
68 ## Note that the = is mandatory for --etags-include.
69 ?SUBDIRS? set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
72 ## Make sure the list of sources is unique.
73 list='$(SOURCES) $(HEADERS) %CONFIG% $(LISP) $(TAGS_FILES)'; \
74 unique=`for i in $$list; do \
75 ## Handle VPATH correctly.
76 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
78 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
79 END { if (nonempty) { for (i in files) print i; }; }'`; \
80 ## Remove the `x' we added first:
82 ## Make sure we have something to run etags on.
83 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
84 test -n "$$unique" || unique=$$empty_fix; \
85 if test $$# -gt 0; then \
86 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
89 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
102 AM_RECURSIVE_TARGETS += ctags CTAGS
106 ## We have a dummy name here because `tags' has already been in use
107 ## for a long time to mean Emacs-style tags. Oops. This means the
108 ## dependencies here are useless.
109 CTAGS: %CTAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \
110 $(TAGS_FILES) $(LISP)
111 ## Make sure the list of sources is unique.
112 list='$(SOURCES) $(HEADERS) %CONFIG% $(LISP) $(TAGS_FILES)'; \
113 unique=`for i in $$list; do \
114 ## Handle VPATH correctly.
115 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
117 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
118 END { if (nonempty) { for (i in files) print i; }; }'`; \
119 ## Make sure we have something to run ctags on.
120 test -z "$(CTAGS_ARGS)$$unique" \
121 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
125 ## --------------- ##
127 ## --------------- ##
131 here=`$(am__cd) $(top_builddir) && pwd` \
132 && $(am__cd) $(top_srcdir) \
133 && gtags -i $(GTAGS_ARGS) "$$here"
143 .PHONY: cscope clean-cscope
144 AM_RECURSIVE_TARGETS += cscope
147 test ! -s cscope.files \
148 || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
153 cscope.files: clean-cscope %CSCOPEDIRS% cscopelist
158 cscopelist: %CSCOPEDIRS% $(HEADERS) $(SOURCES) $(LISP)
159 list='$(SOURCES) $(HEADERS) $(LISP)'; \
160 case "$(srcdir)" in \
161 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
162 *) sdir=$(subdir)/$(srcdir) ;; \
164 for i in $$list; do \
165 if test -f "$$i"; then \
166 echo "$(subdir)/$$i"; \
170 done >> $(top_builddir)/cscope.files
177 .PHONY distclean-am: distclean-tags
180 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
182 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files