]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/Makefile.in
Makefile.in (POSTCOMPILE): New variable.
[thirdparty/gcc.git] / libcpp / Makefile.in
CommitLineData
4f4e53dd 1# @configure_input@
078e3ffe 2# Makefile for libcpp. Run 'configure' to generate Makefile from Makefile.in
4f4e53dd 3
161031e3 4# Copyright (C) 2004, 2008 Free Software Foundation, Inc.
4f4e53dd 5
078e3ffe 6#This file is part of libcpp.
4f4e53dd 7
078e3ffe
PB
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.
4f4e53dd 12
078e3ffe
PB
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.
4f4e53dd 17
078e3ffe
PB
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
200031d1
KC
20#the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21#Boston MA 02110-1301, USA.
c6e83800 22
078e3ffe 23@SET_MAKE@
4f4e53dd
PB
24
25srcdir = @srcdir@
5d1f4b27 26top_builddir = .
4f4e53dd 27VPATH = @srcdir@
4f4e53dd 28INSTALL = @INSTALL@
4f4e53dd
PB
29AR = ar
30ARFLAGS = cru
4f4e53dd 31ACLOCAL = @ACLOCAL@
4f4e53dd
PB
32AUTOCONF = @AUTOCONF@
33AUTOHEADER = @AUTOHEADER@
5c3c3683 34CATALOGS = $(patsubst %,po/%,@CATALOGS@)
4f4e53dd 35CC = @CC@
4f4e53dd 36CFLAGS = @CFLAGS@
018a4785 37WARN_CFLAGS = @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@
4f4e53dd
PB
38CPP = @CPP@
39CPPFLAGS = @CPPFLAGS@
4f4e53dd
PB
40EXEEXT = @EXEEXT@
41GMSGFMT = @GMSGFMT@
42INCINTL = @INCINTL@
43INSTALL_DATA = @INSTALL_DATA@
44INSTALL_PROGRAM = @INSTALL_PROGRAM@
45INSTALL_SCRIPT = @INSTALL_SCRIPT@
4f4e53dd
PB
46LDFLAGS = @LDFLAGS@
47LIBICONV = @LIBICONV@
48LIBINTL = @LIBINTL@
4f4e53dd 49PACKAGE = @PACKAGE@
4f4e53dd 50RANLIB = @RANLIB@
4f4e53dd 51SHELL = @SHELL@
078e3ffe 52USED_CATALOGS = @USED_CATALOGS@
4f4e53dd 53XGETTEXT = @XGETTEXT@
f610dd5f
ZW
54DEPMODE = @CCDEPMODE@
55DEPDIR = @DEPDIR@
078e3ffe 56
4f4e53dd 57datadir = @datadir@
078e3ffe 58exec_prefix = @prefix@
4f4e53dd 59libdir = @libdir@
4f4e53dd 60localedir = $(datadir)/locale
078e3ffe 61prefix = @prefix@
4f4e53dd 62
078e3ffe
PB
63MSGMERGE = msgmerge
64mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs
f610dd5f
ZW
65depcomp = $(SHELL) $(srcdir)/../depcomp
66
078e3ffe
PB
67INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \
68 -I$(srcdir)/include
69
018a4785
ZW
70ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS)
71
ccfc4c91
OW
72libcpp_a_OBJS = charset.o directives.o directives-only.o errors.o \
73 expr.o files.o identifiers.o init.o lex.o line-map.o macro.o \
74 mkdeps.o pch.o symtab.o traditional.o
078e3ffe
PB
75makedepend_OBJS = makedepend.o
76
ccfc4c91
OW
77libcpp_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
4f4e53dd 80
078e3ffe 81all: libcpp.a makedepend$(EXEEXT) $(USED_CATALOGS)
4f4e53dd
PB
82
83.SUFFIXES:
84.SUFFIXES: .c .gmo .o .obj .po .pox
4f4e53dd 85
078e3ffe 86libcpp.a: $(libcpp_a_OBJS)
4f4e53dd 87 -rm -f libcpp.a
078e3ffe 88 $(AR) $(ARFLAGS) libcpp.a $(libcpp_a_OBJS)
4f4e53dd
PB
89 $(RANLIB) libcpp.a
90
078e3ffe 91makedepend$(EXEEXT): $(makedepend_OBJS) libcpp.a ../libiberty/libiberty.a
c6e83800 92 @rm -f makedepend$(EXEEXT)
078e3ffe
PB
93 $(CC) $(CFLAGS) $(LDFLAGS) -o makedepend$(EXEEXT) \
94 $(makedepend_OBJS) libcpp.a ../libiberty/libiberty.a \
95 $(LIBINTL) $(LIBICONV)
4f4e53dd 96
078e3ffe 97# Rules to rebuild the configuration
4f4e53dd 98
078e3ffe
PB
99Makefile: $(srcdir)/Makefile.in config.status
100 $(SHELL) ./config.status Makefile
4f4e53dd 101
078e3ffe
PB
102config.status: $(srcdir)/configure
103 $(SHELL) ./config.status --recheck
4f4e53dd 104
078e3ffe
PB
105$(srcdir)/configure: @MAINT@ $(srcdir)/aclocal.m4
106 cd $(srcdir) && $(AUTOCONF)
4f4e53dd 107
078e3ffe 108$(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/../config/acx.m4 \
88fa57d7
KC
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
078e3ffe 113 cd $(srcdir) && $(ACLOCAL) -I ../config
4f4e53dd 114
078e3ffe
PB
115config.h: stamp-h1
116 test -f config.h || (rm -f stamp-h1 && $(MAKE) stamp-h1)
4f4e53dd 117
078e3ffe
PB
118stamp-h1: $(srcdir)/config.in config.status
119 -rm -f stamp-h1
120 $(SHELL) ./config.status config.h
4f4e53dd 121
185a6cc1 122$(srcdir)/config.in: @MAINT@ $(srcdir)/configure.ac
078e3ffe
PB
123 cd $(srcdir) && $(AUTOHEADER)
124 -rm -f stamp-h1
018a4785
ZW
125
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.
129localedir.h: localedir.hs; @true
130localedir.hs: Makefile
131 echo "#define LOCALEDIR \"$(localedir)\"" > localedir.new
132 $(srcdir)/../move-if-change localedir.new localedir.h
133 echo timestamp > localedir.hs
4f4e53dd 134
078e3ffe 135# Installation rules and other phony targets
4f4e53dd 136
078e3ffe
PB
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.
141installdirs:
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
4f4e53dd 150
078e3ffe
PB
151install-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
4f4e53dd 162
078e3ffe
PB
163mostlyclean:
164 -rm -f *.o
4f4e53dd 165
078e3ffe 166clean: mostlyclean
018a4785 167 -rm -rf makedepend$(EXEEXT) libcpp.a $(srcdir)/autom4te.cache
4f4e53dd 168
078e3ffe
PB
169distclean: clean
170 -rm -f config.h stamp-h1 config.status config.cache config.log \
018a4785 171 configure.lineno configure.status.lineno Makefile localedir.h \
f610dd5f
ZW
172 localedir.hs $(DEPDIR)/*.Po
173 -rmdir $(DEPDIR)
4f4e53dd 174
078e3ffe
PB
175maintainer-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
179
180check:
181installcheck:
182dvi:
b5422ad7 183pdf:
078e3ffe
PB
184html:
185info:
186install-info:
4fcb360b 187install-pdf:
4f4e53dd 188install-man:
b2bd74bc 189install-html:
4f4e53dd 190
078e3ffe 191update-po: $(CATALOGS:.gmo=.pox)
4f4e53dd 192
078e3ffe 193.PHONY: installdirs install install-strip mostlyclean clean distclean \
b5422ad7 194 maintainer-clean check installcheck dvi pdf html info install-info \
b2bd74bc 195 install-man update-po install-html
4f4e53dd 196
f610dd5f
ZW
197# Dependency rule.
198COMPILE.base = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(ALL_CFLAGS) -c
199ifeq ($(DEPMODE),depmode=gcc3)
161031e3
TT
200# Note that we put the dependencies into a .Tpo file, then move them
201# into place if the compile succeeds. We need this because gcc does
202# not atomically write the dependency output file.
203COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Tpo
204POSTCOMPILE = @mv $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
f610dd5f
ZW
205else
206COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \
207 $(depcomp) $(COMPILE.base)
161031e3
TT
208# depcomp handles atomicity for us, so we don't need a postcompile
209# step.
210POSTCOMPILE =
f610dd5f
ZW
211endif
212
078e3ffe 213# Implicit rules and I18N
0ca8e815 214
078e3ffe 215.c.o:
f610dd5f 216 $(COMPILE) $<
161031e3 217 $(POSTCOMPILE)
4f4e53dd
PB
218
219# N.B. We do not attempt to copy these into $(srcdir).
220.po.gmo:
221 -test -d po || mkdir po
222 $(GMSGFMT) --statistics -o $@ $<
223
224# The new .po has to be gone over by hand, so we deposit it into
225# build/po with a different extension.
226# If build/po/$(PACKAGE).pot exists, use it (it was just created),
227# else use the one in srcdir.
228.po.pox:
229 -test -d po || mkdir po
230 $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \
231 then echo po/$(PACKAGE).pot; \
232 else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
233
078e3ffe 234# Rule for regenerating the message template.
50f47ee0 235$(PACKAGE).pot: po/$(PACKAGE).pot
078e3ffe 236po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
4f4e53dd
PB
237 -test -d $(srcdir)/po || mkdir $(srcdir)/po
238 $(XGETTEXT) --default-domain=$(PACKAGE) \
50f47ee0
JM
239 --keyword=_ --keyword=N_ \
240 --keyword=cpp_error:3 --keyword=cpp_errno:3 \
241 --keyword=cpp_error_with_line:5 \
242 --keyword=SYNTAX_ERROR --keyword=SYNTAX_ERROR2 \
4f4e53dd
PB
243 --copyright-holder="Free Software Foundation, Inc." \
244 --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
50f47ee0
JM
245 --language=c -o po/$(PACKAGE).pot.tmp $^
246 sed 's:$(srcdir)/::g' <po/$(PACKAGE).pot.tmp >po/$(PACKAGE).pot
247 rm po/$(PACKAGE).pot.tmp
078e3ffe
PB
248
249
4f4e53dd
PB
250# Tell versions [3.59,3.63) of GNU make to not export all variables.
251# Otherwise a system limit (for SysV at least) may be exceeded.
252.NOEXPORT:
078e3ffe
PB
253
254# Dependencies
f610dd5f 255-include $(patsubst %.o, $(DEPDIR)/%.Po, $(libcpp_a_OBJS) $(makedepend_OBJS))
078e3ffe 256
f610dd5f
ZW
257# Dependencies on generated headers have to be explicit.
258init.o: localedir.h