]> sourceware.org Git - glibc.git/blame - MakeTAGS
Use 64-bit loading.
[glibc.git] / MakeTAGS
CommitLineData
28f540f4 1# Make the TAGS files.
52a86d0a
RM
2# Copyright (C) 1992,1994,1995,1996,1998,2002,2003
3# Free Software Foundation, Inc.
28f540f4
RM
4# This file is part of the GNU C Library.
5
6# The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
7# modify it under the terms of the GNU Lesser General Public
8# License as published by the Free Software Foundation; either
9# version 2.1 of the License, or (at your option) any later version.
28f540f4
RM
10
11# The GNU C Library is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 14# Lesser General Public License for more details.
28f540f4 15
41bdb6e2
AJ
16# You should have received a copy of the GNU Lesser General Public
17# License along with the GNU C Library; if not, write to the Free
18# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19# 02111-1307 USA.
28f540f4
RM
20
21# Make this the default goal.
22TAGS:
23
24ifdef subdir
25.. := ../
26endif
27
28include $(..)Makeconfig
29
52a86d0a
RM
30# Pass these to $(MAKE) calls to avoid source generation and such.
31sub-make-vars = generating=t no_deps=t
32
28f540f4
RM
33ifndef tags_sources
34ifeq ($(subdir),ctype)
35# In most cases, we want the C source files to come before
36# the header files so tags for optimizing #define's in the
37# headers won't be put in the tags files, but for ctype,
38# the functions are just backup for the #define's in the header.
e607b492 39tags_sources = $(all-headers) $(all-sources) $(all-dist)
28f540f4 40else # Not ctype.
e607b492 41tags_sources = $(all-sources) $(all-headers) $(all-dist)
28f540f4
RM
42endif # ctype
43endif # No tags_sources
44
0a55a284 45sysdep-dirs := $(full_config_sysdirs)
28f540f4
RM
46
47ifndef sysdep_dirs
48# Find all sysdep directories.
47707456
UD
49sysdep_dirs := $(shell find $(..)sysdeps \
50 $(wildcard \
51 $(patsubst %,$(..)%/sysdeps,$(add-ons))) \
abe71ca6
UD
52 -type d ! -name RCS ! -name CVS \
53 ! -name SCCS -print)
28f540f4
RM
54endif
55
56# Find all sysdep dirs there are, but putting the ones
57# we are configured to use first and preserving their order.
19c3f208
RM
58all-dirs := $(subdir-dirs) \
59 $(objdir) \
28f540f4
RM
60 $(sysdep-dirs) \
61 $(source_dirs) \
62 $(filter-out $(sysdep-dirs),$(sysdep_dirs))
63
64# Find all the subdirs there are, but putting the ones
65# we are configured to use first and preserving their order.
66ifndef subdir
67subdirs := $(subdirs) \
68 $(filter-out $(subdirs),\
4c393b68
UD
69 $(sort \
70 $(shell sed -e 's/\#.*$$//' \
71 $(wildcard $(addsuffix /Subdirs,\
72 $(all-dirs)))\
73 /dev/null)))
28f540f4
RM
74all-dist = $(foreach Dist,$(wildcard $(all-dirs:%=%/Dist)),\
75 $(addprefix $(Dist:%/Dist=%)/,\
76 $(filter %.c %.h %.S %.s,\
77 $(shell cat $(Dist)))))
78tags_sources = $(all-sources) $(all-headers) $(all-dist)
e607b492
RM
79else
80all-dist = $(distribute)
28f540f4
RM
81endif
82
a4242e25
RM
83# sources and headers must be simply expanded variables
84sources := $(sources) $(filter %.c %.s %.S,$(all-dist))
85headers := $(headers) $(filter %.h,$(all-dist))
8e3cc80f
RM
86all-dist := $(filter-out %.h %.c %.s %.S,$(all-dist))
87
c3352e62
RM
88sources += $(foreach lib,$(extra-libs),$($(lib)-routines:=.c))
89
28f540f4
RM
90# All different versions of $(sources), preserving the configured sysdep
91# directory order.
6952e59e
UD
92# Files that are found in the current directory cannot occur in
93# sysdep directories, so don't bother searching them.
94sysdep-sources := $(filter-out $(wildcard $(sources)), $(sources))
e61abf83 95all-sources = $(wildcard $(sort $(sources) $(sources:.c=.S) $(sources:.c=.s) \
c238ecf7
UD
96 $(others:=.c) $(tests:=.c) $(xtests:=.c) \
97 $(test-srcs:=.c))) \
19c3f208
RM
98 $(foreach dir,$(all-dirs),\
99 $(wildcard \
100 $(addprefix $(dir)/,\
6952e59e
UD
101 $(sort $(sysdep-sources) \
102 $(sysdep-sources:.c=.S) \
103 $(sysdep-sources:.c=.s)))))
19c3f208 104
6952e59e 105sysdep-headers := $(filter-out $(wildcard $(headers)), $(headers))
19c3f208
RM
106all-headers = $(wildcard $(headers)) \
107 $(foreach dir,$(all-dirs),\
6952e59e 108 $(wildcard $(addprefix $(dir)/,$(sysdep-headers))))
28f540f4
RM
109
110tags_sources := $(strip $(tags_sources))
111
112TAGS: $(tags_sources)
113ifdef subdir
114ifdef tags_sources
115 $(ETAGS) -o $@ $^
116else
a182affd 117# No sources. Create a dummy file.
28f540f4
RM
118 touch $@
119endif # tags_sources
120else # parent
121TAGS: subdir_TAGS
122# Note that this uses the -i switch, and thus requires v19 etags.
123 $(ETAGS) -o $@ \
124 $(subdirs:%=-i %/TAGS) \
125 $(filter-out subdir_TAGS,$^)
126
127.PHONY: subdir_TAGS $(subdirs:%=%/TAGS)
128subdir_TAGS: $(subdirs:%=%/TAGS)
129$(subdirs:%=%/TAGS):
52a86d0a 130 $(MAKE) -C $(@D) $(sub-make-vars) $(@F)
28f540f4
RM
131
132endif # subdir
a182affd
RM
133\f
134ifndef XGETTEXT
135XGETTEXT = xgettext
136endif
a182affd
RM
137
138P = $(..)po
139
140ifdef subdir
141domain = $(subdir)
142else
143domain = libc-top
144endif
145
146define extract
147@rm -f $@.new
567fb074 148$(XGETTEXT) --keyword=_ --keyword=N_ --add-comments=TRANS --sort-by-file \
88ee92ed 149 --omit-header -E -n -d - $(XGETTEXTFLAGS-$(@F)) > $@.new $^
a182affd
RM
150mv -f $@.new $@
151endef
152
857fa1b8
RM
153text-srcs := $(filter %.c %.h %.cc %.C,$(tags_sources))
154$P/$(domain).pot: $(text-srcs)
155ifeq (,$(text-srcs))
156 cp /dev/null $@
157else
158 $(extract)
159endif
a182affd 160
df4ef2ab 161all-pot = $P/libc-top.pot $P/subdirs.pot
a182affd
RM
162
163ifndef subdir
7a1c652d
RM
164# Collect all the subdir messages, massaging the file names in comments
165# to include the subdir name.
166$P/subdirs.pot: $(subdirs:%=$P/%.pot)
167 @rm -f $@.new
168 (for d in $(subdirs); \
14bab8de 169 do sed "/^#:/s% % $$d/%g" $P/$$d.pot; done) > $@.new
7a1c652d
RM
170 mv -f $@.new $@
171
172# Combine all the messages into the final sorted template translation file.
ec4b0518 173# The following code requires GNU date.
8ca5c11b 174$P/libc.pot: $(all-pot)
a182affd 175 @rm -f $@.new
0d204b0a 176 set `date -R`; disp="$$6"; \
ec4b0518 177 sed -e 's/VERSION/$(version)/' \
0d204b0a 178 -e "s/DATE/`date +'%Y-%m-%d %H:%M'$$disp`/" \
299a95b9 179 po/header.pot > $@.new
88ee92ed 180 $(XGETTEXT) -d - --omit-header -E -n $^ >> $@.new
a182affd 181 mv -f $@.new $@
880f421f 182ifeq ($(with-cvs),yes)
379bb425 183 test ! -d CVS || cvs $(CVSOPTS) ci -m'Regenerated from source files' $@
880f421f 184endif
a182affd
RM
185
186$(subdirs:%=$P/%.pot): $P/%.pot: FORCE
52a86d0a 187 $(MAKE) -C $* $(sub-make-vars) ../$@
a182affd
RM
188FORCE:
189endif
This page took 0.16408 seconds and 5 git commands to generate.