]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/Makefile.in
gcc/, libcpp/
[thirdparty/gcc.git] / libcpp / Makefile.in
CommitLineData
d856c8a6 1# @configure_input@
a668be26 2# Makefile for libcpp. Run 'configure' to generate Makefile from Makefile.in
d856c8a6 3
a668be26 4# Copyright (C) 2004 Free Software Foundation, Inc.
d856c8a6 5
a668be26 6#This file is part of libcpp.
d856c8a6 7
a668be26 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.
d856c8a6 12
a668be26 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.
d856c8a6 17
a668be26 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
2656917a 20#the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21#Boston MA 02110-1301, USA.
3eb3f293 22
a668be26 23@SET_MAKE@
d856c8a6 24
25srcdir = @srcdir@
99439f5b 26top_builddir = .
d856c8a6 27VPATH = @srcdir@
d856c8a6 28INSTALL = @INSTALL@
d856c8a6 29AR = ar
30ARFLAGS = cru
d856c8a6 31ACLOCAL = @ACLOCAL@
d856c8a6 32AUTOCONF = @AUTOCONF@
33AUTOHEADER = @AUTOHEADER@
49688a56 34CATALOGS = $(patsubst %,po/%,@CATALOGS@)
d856c8a6 35CC = @CC@
d856c8a6 36CFLAGS = @CFLAGS@
21164c01 37WARN_CFLAGS = @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@
d856c8a6 38CPP = @CPP@
39CPPFLAGS = @CPPFLAGS@
d856c8a6 40EXEEXT = @EXEEXT@
41GMSGFMT = @GMSGFMT@
42INCINTL = @INCINTL@
43INSTALL_DATA = @INSTALL_DATA@
44INSTALL_PROGRAM = @INSTALL_PROGRAM@
45INSTALL_SCRIPT = @INSTALL_SCRIPT@
d856c8a6 46LDFLAGS = @LDFLAGS@
47LIBICONV = @LIBICONV@
48LIBINTL = @LIBINTL@
d856c8a6 49PACKAGE = @PACKAGE@
d856c8a6 50RANLIB = @RANLIB@
d856c8a6 51SHELL = @SHELL@
a668be26 52USED_CATALOGS = @USED_CATALOGS@
d856c8a6 53XGETTEXT = @XGETTEXT@
cbaa9876 54DEPMODE = @CCDEPMODE@
55DEPDIR = @DEPDIR@
a668be26 56
d856c8a6 57datadir = @datadir@
a668be26 58exec_prefix = @prefix@
d856c8a6 59libdir = @libdir@
d856c8a6 60localedir = $(datadir)/locale
a668be26 61prefix = @prefix@
d856c8a6 62
a668be26 63MSGMERGE = msgmerge
64mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs
cbaa9876 65depcomp = $(SHELL) $(srcdir)/../depcomp
66
a668be26 67INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \
68 -I$(srcdir)/include
69
21164c01 70ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS)
71
a668be26 72libcpp_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
75makedepend_OBJS = makedepend.o
76
77libcpp_a_SOURCES = charset.c directives.c errors.c expr.c files.c \
d856c8a6 78 identifiers.c init.c lex.c line-map.c macro.c mkdeps.c \
79 pch.c symtab.c traditional.c
80
a668be26 81all: libcpp.a makedepend$(EXEEXT) $(USED_CATALOGS)
d856c8a6 82
83.SUFFIXES:
84.SUFFIXES: .c .gmo .o .obj .po .pox
d856c8a6 85
a668be26 86libcpp.a: $(libcpp_a_OBJS)
d856c8a6 87 -rm -f libcpp.a
a668be26 88 $(AR) $(ARFLAGS) libcpp.a $(libcpp_a_OBJS)
d856c8a6 89 $(RANLIB) libcpp.a
90
a668be26 91makedepend$(EXEEXT): $(makedepend_OBJS) libcpp.a ../libiberty/libiberty.a
3eb3f293 92 @rm -f makedepend$(EXEEXT)
a668be26 93 $(CC) $(CFLAGS) $(LDFLAGS) -o makedepend$(EXEEXT) \
94 $(makedepend_OBJS) libcpp.a ../libiberty/libiberty.a \
95 $(LIBINTL) $(LIBICONV)
d856c8a6 96
a668be26 97# Rules to rebuild the configuration
d856c8a6 98
a668be26 99Makefile: $(srcdir)/Makefile.in config.status
100 $(SHELL) ./config.status Makefile
d856c8a6 101
a668be26 102config.status: $(srcdir)/configure
103 $(SHELL) ./config.status --recheck
d856c8a6 104
a668be26 105$(srcdir)/configure: @MAINT@ $(srcdir)/aclocal.m4
106 cd $(srcdir) && $(AUTOCONF)
d856c8a6 107
a668be26 108$(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/../config/acx.m4 \
986086aa 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
a668be26 113 cd $(srcdir) && $(ACLOCAL) -I ../config
d856c8a6 114
a668be26 115config.h: stamp-h1
116 test -f config.h || (rm -f stamp-h1 && $(MAKE) stamp-h1)
d856c8a6 117
a668be26 118stamp-h1: $(srcdir)/config.in config.status
119 -rm -f stamp-h1
120 $(SHELL) ./config.status config.h
d856c8a6 121
a668be26 122$(srcdir)/config.in: @MAINT@ $(srcdir)/configure
123 cd $(srcdir) && $(AUTOHEADER)
124 -rm -f stamp-h1
21164c01 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
d856c8a6 134
a668be26 135# Installation rules and other phony targets
d856c8a6 136
a668be26 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
d856c8a6 150
a668be26 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
d856c8a6 162
a668be26 163mostlyclean:
164 -rm -f *.o
d856c8a6 165
a668be26 166clean: mostlyclean
21164c01 167 -rm -rf makedepend$(EXEEXT) libcpp.a $(srcdir)/autom4te.cache
d856c8a6 168
a668be26 169distclean: clean
170 -rm -f config.h stamp-h1 config.status config.cache config.log \
21164c01 171 configure.lineno configure.status.lineno Makefile localedir.h \
cbaa9876 172 localedir.hs $(DEPDIR)/*.Po
173 -rmdir $(DEPDIR)
d856c8a6 174
a668be26 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:
183html:
184info:
185install-info:
d856c8a6 186install-man:
8f597c12 187install-html:
d856c8a6 188
a668be26 189update-po: $(CATALOGS:.gmo=.pox)
d856c8a6 190
a668be26 191.PHONY: installdirs install install-strip mostlyclean clean distclean \
192 maintainer-clean check installcheck dvi html info install-info \
8f597c12 193 install-man update-po install-html
d856c8a6 194
cbaa9876 195# Dependency rule.
196COMPILE.base = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(ALL_CFLAGS) -c
197ifeq ($(DEPMODE),depmode=gcc3)
3c77e017 198COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Po
cbaa9876 199else
200COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \
201 $(depcomp) $(COMPILE.base)
202endif
203
a668be26 204# Implicit rules and I18N
dd6e5561 205
a668be26 206.c.o:
cbaa9876 207 $(COMPILE) $<
d856c8a6 208
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 $@ $<
213
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 $@
223
a668be26 224# Rule for regenerating the message template.
34ae664d 225$(PACKAGE).pot: po/$(PACKAGE).pot
a668be26 226po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
d856c8a6 227 -test -d $(srcdir)/po || mkdir $(srcdir)/po
228 $(XGETTEXT) --default-domain=$(PACKAGE) \
34ae664d 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 \
d856c8a6 233 --copyright-holder="Free Software Foundation, Inc." \
234 --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
34ae664d 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
a668be26 238
239
d856c8a6 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:
a668be26 243
244# Dependencies
cbaa9876 245-include $(patsubst %.o, $(DEPDIR)/%.Po, $(libcpp_a_OBJS) $(makedepend_OBJS))
a668be26 246
cbaa9876 247# Dependencies on generated headers have to be explicit.
248init.o: localedir.h