2006-07-12 Andrew John Hughes <gnu_andrew@member.fsf.org>
[official-gcc.git] / libcpp / Makefile.in
blobedd75f13ee57a464c7eee29edd1329b6e290726e
1 # @configure_input@
2 # Makefile for libcpp. Run 'configure' to generate Makefile from Makefile.in
4 # Copyright (C) 2004 Free Software Foundation, Inc.
6 #This file is part of libcpp.
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.
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.
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.
23 @SET_MAKE@
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@
57 datadir = @datadir@
58 exec_prefix = @prefix@
59 libdir = @libdir@
60 localedir = $(datadir)/locale
61 prefix = @prefix@
63 MSGMERGE = msgmerge
64 mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs
65 depcomp = $(SHELL) $(srcdir)/../depcomp
67 INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \
68 -I$(srcdir)/include
70 ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS)
72 libcpp_a_OBJS = charset.o directives.o errors.o expr.o files.o \
73 identifiers.o init.o lex.o line-map.o macro.o mkdeps.o \
74 pch.o symtab.o traditional.o
75 makedepend_OBJS = makedepend.o
77 libcpp_a_SOURCES = charset.c directives.c errors.c expr.c files.c \
78 identifiers.c init.c lex.c line-map.c macro.c mkdeps.c \
79 pch.c symtab.c traditional.c
81 all: libcpp.a makedepend$(EXEEXT) $(USED_CATALOGS)
83 .SUFFIXES:
84 .SUFFIXES: .c .gmo .o .obj .po .pox
86 libcpp.a: $(libcpp_a_OBJS)
87 -rm -f libcpp.a
88 $(AR) $(ARFLAGS) libcpp.a $(libcpp_a_OBJS)
89 $(RANLIB) libcpp.a
91 makedepend$(EXEEXT): $(makedepend_OBJS) libcpp.a ../libiberty/libiberty.a
92 @rm -f makedepend$(EXEEXT)
93 $(CC) $(CFLAGS) $(LDFLAGS) -o makedepend$(EXEEXT) \
94 $(makedepend_OBJS) libcpp.a ../libiberty/libiberty.a \
95 $(LIBINTL) $(LIBICONV)
97 # Rules to rebuild the configuration
99 Makefile: $(srcdir)/Makefile.in config.status
100 $(SHELL) ./config.status Makefile
102 config.status: $(srcdir)/configure
103 $(SHELL) ./config.status --recheck
105 $(srcdir)/configure: @MAINT@ $(srcdir)/aclocal.m4
106 cd $(srcdir) && $(AUTOCONF)
108 $(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/../config/acx.m4 \
109 $(srcdir)/../config/gettext-sister.m4 $(srcdir)/../config/iconv.m4 \
110 $(srcdir)/../config/codeset.m4 $(srcdir)/../config/lib-ld.m4 \
111 $(srcdir)/../config/lib-link.m4 $(srcdir)/../config/lib-prefix.m4 \
112 $(srcdir)/configure.ac
113 cd $(srcdir) && $(ACLOCAL) -I ../config
115 config.h: stamp-h1
116 test -f config.h || (rm -f stamp-h1 && $(MAKE) stamp-h1)
118 stamp-h1: $(srcdir)/config.in config.status
119 -rm -f stamp-h1
120 $(SHELL) ./config.status config.h
122 $(srcdir)/config.in: @MAINT@ $(srcdir)/configure
123 cd $(srcdir) && $(AUTOHEADER)
124 -rm -f stamp-h1
126 # It is not possible to get LOCALEDIR defined in config.h because
127 # the value it needs to be defined to is only determined in the
128 # Makefile. Hence we do this instead.
129 localedir.h: localedir.hs; @true
130 localedir.hs: Makefile
131 echo "#define LOCALEDIR \"$(localedir)\"" > localedir.new
132 $(srcdir)/../move-if-change localedir.new localedir.h
133 echo timestamp > localedir.hs
135 # Installation rules and other phony targets
137 # These rule has to look for .gmo modules in both srcdir and
138 # the cwd, and has to check that we actually have a catalog
139 # for each language, in case they weren't built or included
140 # with the distribution.
141 installdirs:
142 @$(mkinstalldirs) $(DESTDIR)$(datadir); \
143 cats="$(CATALOGS)"; for cat in $$cats; do \
144 lang=`basename $$cat | sed 's/\.gmo$$//'`; \
145 if [ -f $$cat ] || [ -f $(srcdir)/$$cat ]; then \
146 dir=$(localedir)/$$lang/LC_MESSAGES; \
147 $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
148 fi; \
149 done
151 install-strip install: all installdirs
152 cats="$(CATALOGS)"; for cat in $$cats; do \
153 lang=`basename $$cat | sed 's/\.gmo$$//'`; \
154 if [ -f $$cat ]; then :; \
155 elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
156 else continue; \
157 fi; \
158 dir=$(localedir)/$$lang/LC_MESSAGES; \
159 echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
160 $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
161 done
163 mostlyclean:
164 -rm -f *.o
166 clean: mostlyclean
167 -rm -rf makedepend$(EXEEXT) libcpp.a $(srcdir)/autom4te.cache
169 distclean: clean
170 -rm -f config.h stamp-h1 config.status config.cache config.log \
171 configure.lineno configure.status.lineno Makefile localedir.h \
172 localedir.hs $(DEPDIR)/*.Po
173 -rmdir $(DEPDIR)
175 maintainer-clean: distclean
176 @echo "This command is intended for maintainers to use"
177 @echo "it deletes files that may require special tools to rebuild."
178 -rm -f $(srcdir)/configure $(srcdir)/aclocal.m4
180 check:
181 installcheck:
182 dvi:
183 html:
184 info:
185 install-info:
186 install-man:
187 install-html:
189 update-po: $(CATALOGS:.gmo=.pox)
191 .PHONY: installdirs install install-strip mostlyclean clean distclean \
192 maintainer-clean check installcheck dvi html info install-info \
193 install-man update-po install-html
195 # Dependency rule.
196 COMPILE.base = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(ALL_CFLAGS) -c
197 ifeq ($(DEPMODE),depmode=gcc3)
198 COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Po
199 else
200 COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \
201 $(depcomp) $(COMPILE.base)
202 endif
204 # Implicit rules and I18N
206 .c.o:
207 $(COMPILE) $<
209 # N.B. We do not attempt to copy these into $(srcdir).
210 .po.gmo:
211 -test -d po || mkdir po
212 $(GMSGFMT) --statistics -o $@ $<
214 # The new .po has to be gone over by hand, so we deposit it into
215 # build/po with a different extension.
216 # If build/po/$(PACKAGE).pot exists, use it (it was just created),
217 # else use the one in srcdir.
218 .po.pox:
219 -test -d po || mkdir po
220 $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \
221 then echo po/$(PACKAGE).pot; \
222 else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
224 # Rule for regenerating the message template.
225 $(PACKAGE).pot: po/$(PACKAGE).pot
226 po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
227 -test -d $(srcdir)/po || mkdir $(srcdir)/po
228 $(XGETTEXT) --default-domain=$(PACKAGE) \
229 --keyword=_ --keyword=N_ \
230 --keyword=cpp_error:3 --keyword=cpp_errno:3 \
231 --keyword=cpp_error_with_line:5 \
232 --keyword=SYNTAX_ERROR --keyword=SYNTAX_ERROR2 \
233 --copyright-holder="Free Software Foundation, Inc." \
234 --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
235 --language=c -o po/$(PACKAGE).pot.tmp $^
236 sed 's:$(srcdir)/::g' <po/$(PACKAGE).pot.tmp >po/$(PACKAGE).pot
237 rm po/$(PACKAGE).pot.tmp
240 # Tell versions [3.59,3.63) of GNU make to not export all variables.
241 # Otherwise a system limit (for SysV at least) may be exceeded.
242 .NOEXPORT:
244 # Dependencies
245 -include $(patsubst %.o, $(DEPDIR)/%.Po, $(libcpp_a_OBJS) $(makedepend_OBJS))
247 # Dependencies on generated headers have to be explicit.
248 init.o: localedir.h