OSDN Git Service

2009-04-01 Rafael Avila de Espindola <espindola@google.com>
[pf3gnuchains/gcc-fork.git] / libcpp / Makefile.in
1 # @configure_input@
2 # Makefile for libcpp.  Run 'configure' to generate Makefile from Makefile.in
3
4 # Copyright (C) 2004, 2008, 2009 Free Software Foundation, Inc.
5
6 #This file is part of libcpp.
7
8 #libcpp is free software; you can redistribute it and/or modify
9 #it under the terms of the GNU General Public License as published by
10 #the Free Software Foundation; either version 2, or (at your option)
11 #any later version.
12
13 #libcpp is distributed in the hope that it will be useful,
14 #but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #GNU General Public License for more details.
17
18 #You should have received a copy of the GNU General Public License
19 #along with libcpp; see the file COPYING.  If not, write to
20 #the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21 #Boston MA 02110-1301, USA.
22
23 @SET_MAKE@
24
25 srcdir = @srcdir@
26 top_builddir = .
27 VPATH = @srcdir@
28 INSTALL = @INSTALL@
29 AR = ar
30 ARFLAGS = cru
31 ACLOCAL = @ACLOCAL@
32 AUTOCONF = @AUTOCONF@
33 AUTOHEADER = @AUTOHEADER@
34 CATALOGS = $(patsubst %,po/%,@CATALOGS@)
35 CC = @CC@
36 CFLAGS = @CFLAGS@
37 WARN_CFLAGS = @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@
38 CPP = @CPP@
39 CPPFLAGS = @CPPFLAGS@
40 EXEEXT = @EXEEXT@
41 GMSGFMT = @GMSGFMT@
42 INCINTL = @INCINTL@
43 INSTALL_DATA = @INSTALL_DATA@
44 INSTALL_PROGRAM = @INSTALL_PROGRAM@
45 INSTALL_SCRIPT = @INSTALL_SCRIPT@
46 LDFLAGS = @LDFLAGS@
47 LIBICONV = @LIBICONV@
48 LIBINTL = @LIBINTL@
49 PACKAGE = @PACKAGE@
50 RANLIB = @RANLIB@
51 SHELL = @SHELL@
52 USED_CATALOGS = @USED_CATALOGS@
53 XGETTEXT = @XGETTEXT@
54 DEPMODE = @CCDEPMODE@
55 DEPDIR = @DEPDIR@
56
57 datarootdir = @datarootdir@
58 datadir = @datadir@
59 exec_prefix = @prefix@
60 libdir = @libdir@
61 localedir = $(datadir)/locale
62 prefix = @prefix@
63
64 MSGMERGE = msgmerge
65 mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs
66 depcomp = $(SHELL) $(srcdir)/../depcomp
67
68 INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \
69         -I$(srcdir)/include
70
71 ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS)
72
73 libcpp_a_OBJS = charset.o directives.o directives-only.o errors.o \
74         expr.o files.o identifiers.o init.o lex.o line-map.o macro.o \
75         mkdeps.o pch.o symtab.o traditional.o
76
77 libcpp_a_SOURCES = charset.c directives.c directives-only.c errors.c \
78         expr.c files.c identifiers.c init.c lex.c line-map.c macro.c \
79         mkdeps.c pch.c symtab.c traditional.c
80
81 all: libcpp.a $(USED_CATALOGS)
82
83 .SUFFIXES:
84 .SUFFIXES: .c .gmo .o .obj .po .pox
85
86 libcpp.a: $(libcpp_a_OBJS)
87         -rm -f libcpp.a
88         $(AR) $(ARFLAGS) libcpp.a $(libcpp_a_OBJS)
89         $(RANLIB) libcpp.a
90
91 # Rules to rebuild the configuration
92
93 Makefile: $(srcdir)/Makefile.in config.status
94         $(SHELL) ./config.status Makefile
95
96 config.status: $(srcdir)/configure
97         $(SHELL) ./config.status --recheck
98
99 $(srcdir)/configure: @MAINT@ $(srcdir)/aclocal.m4
100         cd $(srcdir) && $(AUTOCONF)
101
102 $(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/../config/acx.m4 \
103         $(srcdir)/../config/gettext-sister.m4 $(srcdir)/../config/iconv.m4 \
104         $(srcdir)/../config/codeset.m4 $(srcdir)/../config/lib-ld.m4 \
105         $(srcdir)/../config/lib-link.m4 $(srcdir)/../config/lib-prefix.m4 \
106         $(srcdir)/../config/override.m4 $(srcdir)/../config/proginstall.m4 \
107         $(srcdir)/configure.ac
108         cd $(srcdir) && $(ACLOCAL) -I ../config
109
110 config.h: stamp-h1
111         test -f config.h || (rm -f stamp-h1 && $(MAKE) stamp-h1)
112
113 stamp-h1: $(srcdir)/config.in config.status
114         -rm -f stamp-h1
115         $(SHELL) ./config.status config.h
116
117 $(srcdir)/config.in: @MAINT@ $(srcdir)/configure.ac
118         cd $(srcdir) && $(AUTOHEADER)
119         -rm -f stamp-h1
120
121 # It is not possible to get LOCALEDIR defined in config.h because
122 # the value it needs to be defined to is only determined in the
123 # Makefile.  Hence we do this instead.
124 localedir.h: localedir.hs; @true
125 localedir.hs: Makefile
126         echo "#define LOCALEDIR \"$(localedir)\"" > localedir.new
127         $(srcdir)/../move-if-change localedir.new localedir.h
128         echo timestamp > localedir.hs
129
130 # Installation rules and other phony targets
131
132 # These rule has to look for .gmo modules in both srcdir and
133 # the cwd, and has to check that we actually have a catalog
134 # for each language, in case they weren't built or included
135 # with the distribution.
136 installdirs:
137         @$(mkinstalldirs) $(DESTDIR)$(datadir); \
138         cats="$(CATALOGS)"; for cat in $$cats; do \
139           lang=`basename $$cat | sed 's/\.gmo$$//'`; \
140           if [ -f $$cat ] || [ -f $(srcdir)/$$cat ]; then \
141             dir=$(localedir)/$$lang/LC_MESSAGES; \
142             $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
143           fi; \
144         done
145
146 install-strip install: all installdirs
147         cats="$(CATALOGS)"; for cat in $$cats; do \
148           lang=`basename $$cat | sed 's/\.gmo$$//'`; \
149           if [ -f $$cat ]; then :; \
150           elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
151           else continue; \
152           fi; \
153           dir=$(localedir)/$$lang/LC_MESSAGES; \
154           echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
155           $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
156         done
157
158 mostlyclean:
159         -rm -f *.o
160
161 clean: mostlyclean
162         -rm -rf libcpp.a $(srcdir)/autom4te.cache
163
164 distclean: clean
165         -rm -f config.h stamp-h1 config.status config.cache config.log \
166           configure.lineno configure.status.lineno Makefile localedir.h \
167           localedir.hs $(DEPDIR)/*.Po
168         -rmdir $(DEPDIR)
169
170 maintainer-clean: distclean
171         @echo "This command is intended for maintainers to use"
172         @echo "it deletes files that may require special tools to rebuild."
173         -rm -f $(srcdir)/configure $(srcdir)/aclocal.m4
174
175 check:
176 installcheck:
177 dvi:
178 pdf:
179 html:
180 info:
181 install-info:
182 install-pdf:
183 install-man:
184 install-html:
185
186 update-po: $(CATALOGS:.gmo=.pox)
187
188 .PHONY: installdirs install install-strip mostlyclean clean distclean \
189   maintainer-clean check installcheck dvi pdf html info install-info \
190   install-man update-po install-html
191
192 # Dependency rule.
193 COMPILE.base = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(ALL_CFLAGS) -c
194 ifeq ($(DEPMODE),depmode=gcc3)
195 # Note that we put the dependencies into a .Tpo file, then move them
196 # into place if the compile succeeds.  We need this because gcc does
197 # not atomically write the dependency output file.
198 COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Tpo
199 POSTCOMPILE = @mv $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
200 else
201 COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \
202           $(depcomp) $(COMPILE.base)
203 # depcomp handles atomicity for us, so we don't need a postcompile
204 # step.
205 POSTCOMPILE =
206 endif
207
208 # Implicit rules and I18N
209
210 .c.o:
211         $(COMPILE) $<
212         $(POSTCOMPILE)
213
214 # N.B. We do not attempt to copy these into $(srcdir).
215 .po.gmo:
216         $(mkinstalldirs) po
217         $(GMSGFMT) --statistics -o $@ $<
218
219 # The new .po has to be gone over by hand, so we deposit it into
220 # build/po with a different extension.
221 # If build/po/$(PACKAGE).pot exists, use it (it was just created),
222 # else use the one in srcdir.
223 .po.pox:
224         $(mkinstalldirs) po
225         $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \
226                         then echo po/$(PACKAGE).pot; \
227                         else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
228
229 # Rule for regenerating the message template.
230 $(PACKAGE).pot: po/$(PACKAGE).pot
231 po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
232         $(mkinstalldirs) $(srcdir)/po
233         $(XGETTEXT) --default-domain=$(PACKAGE) \
234           --keyword=_ --keyword=N_ \
235           --keyword=cpp_error:3 --keyword=cpp_errno:3 \
236           --keyword=cpp_error_with_line:5 \
237           --keyword=SYNTAX_ERROR --keyword=SYNTAX_ERROR2 \
238           --copyright-holder="Free Software Foundation, Inc." \
239           --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
240           --language=c -o po/$(PACKAGE).pot.tmp $^
241         sed 's:$(srcdir)/::g' <po/$(PACKAGE).pot.tmp >po/$(PACKAGE).pot
242         rm po/$(PACKAGE).pot.tmp
243
244 TAGS_SOURCES = $(libcpp_a_SOURCES) internal.h ucnid.h \
245     include/line-map.h include/symtab.h include/cpp-id-data.h \
246     include/cpplib.h include/mkdeps.h system.h
247
248 TAGS: $(TAGS_SOURCES)
249         cd $(srcdir) && etags $(TAGS_SOURCES)
250
251 # Tell versions [3.59,3.63) of GNU make to not export all variables.
252 # Otherwise a system limit (for SysV at least) may be exceeded.
253 .NOEXPORT:
254
255 # Dependencies
256 -include $(patsubst %.o, $(DEPDIR)/%.Po, $(libcpp_a_OBJS))
257
258 # Dependencies on generated headers have to be explicit.
259 init.o: localedir.h