* automake.in (read_am_file): Removed debugging code.
[automake.git] / tags.am
blob9f85768fa4cb2bba961fa93d15d0bd68d94917b0
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
3 ## 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)
8 ## any later version.
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, write to the Free Software
17 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 ## 02111-1307, USA.
20 .PHONY: tags
21 tags: TAGS
24 ## ---- ##
25 ## ID.  ##
26 ## ---- ##
28 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
29 ## Make sure the list of sources is unique.
30         list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
31         unique=`for i in $$list; do \
32 ## Handle VPATH correctly.
33             if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
34           done | \
35           $(AWK) '    { files[$$0] = 1; } \
36                END { for (i in files) print i; }'`; \
37         mkid -fID $$unique $(LISP)
40 ## ------ ##
41 ## TAGS.  ##
42 ## ------ ##
44 TAGS: %DIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \
45                 $(TAGS_FILES) $(LISP)
46         tags=; \
47         here=`pwd`; \
48 ## It is tempting to use if/endif here, but don't: the previous
49 ## backslash will cause bad results (automake doesn't `see' the `if').
50 ?SUBDIRS?       list='$(SUBDIRS)'; for subdir in $$list; do \
51 ## Do nothing if we're trying to look in `.'.
52 ?SUBDIRS?         if test "$$subdir" = .; then :; else \
53 ?SUBDIRS?           test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
54 ?SUBDIRS?         fi; \
55 ?SUBDIRS?       done; \
56 ## Make sure the list of sources is unique.
57         list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
58         unique=`for i in $$list; do \
59 ## Handle VPATH correctly.
60             if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
61           done | \
62           $(AWK) '    { files[$$0] = 1; } \
63                END { for (i in files) print i; }'`; \
64 ## Make sure we have something to run etags on.
65         test -z "$(ETAGS_ARGS)%CONFIG%$$unique$(LISP)$$tags" \
66           || etags $(ETAGS_ARGS) $$tags %CONFIG% $$unique $(LISP)
69 ## --------------- ##
70 ## `Global' tags.  ##
71 ## --------------- ##
73 GTAGS:
74         here=`CDPATH=: && cd $(top_builddir) && pwd` \
75           && cd $(top_srcdir) \
76           && gtags -i $$here
79 ## ---------- ##
80 ## Cleaning.  ##
81 ## ---------- ##
83 .PHONY distclean-am: distclean-tags
85 distclean-tags:
86         -rm -f TAGS ID