1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003,
3 ## 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
22 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
23 ## Make sure the list of sources is unique.
24 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
25 unique=`for i in $$list; do \
26 ## Handle VPATH correctly.
27 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
29 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
30 END { if (nonempty) { for (i in files) print i; }; }'`; \
41 AM_RECURSIVE_TARGETS += tags TAGS
45 TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \
47 ## We use the positional parameters to build the subdir list with
48 ## absolute names, without the need to worry about white space in `pwd`.
51 ## It is tempting to use if/endif here, but don't: the previous
52 ## backslash will cause bad results (automake doesn't `see' the `if').
53 ## Exuberant Ctags wants --etags-include,
54 ## GNU Etags --include
55 ## Furthermore Exuberant Ctags 5.5.4 fails to create TAGS files
56 ## when no files are supplied, despite any --etags-include option.
57 ## A workaround is to pass `.' as a file. This is what $empty_fix is for.
58 ?SUBDIRS? if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
59 ?SUBDIRS? include_option=--etags-include; \
60 ?SUBDIRS? empty_fix=.; \
62 ?SUBDIRS? include_option=--include; \
63 ?SUBDIRS? empty_fix=; \
65 ?SUBDIRS? list='$(SUBDIRS)'; for subdir in $$list; do \
66 ## Do nothing if we're trying to look in `.'.
67 ?SUBDIRS? if test "$$subdir" = .; then :; else \
68 ?SUBDIRS? test ! -f $$subdir/TAGS || \
69 ## Note that the = is mandatory for --etags-include.
70 ?SUBDIRS? set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
73 ## Make sure the list of sources is unique.
74 list='$(SOURCES) $(HEADERS) %CONFIG% $(LISP) $(TAGS_FILES)'; \
75 unique=`for i in $$list; do \
76 ## Handle VPATH correctly.
77 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
79 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
80 END { if (nonempty) { for (i in files) print i; }; }'`; \
81 ## Remove the `x' we added first:
83 ## Make sure we have something to run etags on.
84 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
85 test -n "$$unique" || unique=$$empty_fix; \
86 if test $$# -gt 0; then \
87 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
90 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
103 AM_RECURSIVE_TARGETS += ctags CTAGS
107 ## We have a dummy name here because `tags' has already been in use
108 ## for a long time to mean Emacs-style tags. Oops. This means the
109 ## dependencies here are useless.
110 CTAGS: %CTAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \
111 $(TAGS_FILES) $(LISP)
112 ## Make sure the list of sources is unique.
113 list='$(SOURCES) $(HEADERS) %CONFIG% $(LISP) $(TAGS_FILES)'; \
114 unique=`for i in $$list; do \
115 ## Handle VPATH correctly.
116 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
118 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
119 END { if (nonempty) { for (i in files) print i; }; }'`; \
120 ## Make sure we have something to run ctags on.
121 test -z "$(CTAGS_ARGS)$$unique" \
122 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
126 ## --------------- ##
128 ## --------------- ##
132 here=`$(am__cd) $(top_builddir) && pwd` \
133 && $(am__cd) $(top_srcdir) \
134 && gtags -i $(GTAGS_ARGS) "$$here"
144 .PHONY: cscope clean-cscope
145 AM_RECURSIVE_TARGETS += cscope
148 test ! -s cscope.files \
149 || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
154 cscope.files: clean-cscope %CSCOPEDIRS% cscopelist
159 cscopelist: %CSCOPEDIRS% $(HEADERS) $(SOURCES) $(LISP)
160 list='$(SOURCES) $(HEADERS) $(LISP)'; \
161 case "$(srcdir)" in \
162 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
163 *) sdir=$(subdir)/$(srcdir) ;; \
165 for i in $$list; do \
166 if test -f "$$i"; then \
167 echo "$(subdir)/$$i"; \
171 done >> $(top_builddir)/cscope.files
178 .PHONY distclean-am: distclean-tags
181 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
183 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files