]>
Commit | Line | Data |
---|---|---|
4f4e53dd | 1 | # @configure_input@ |
078e3ffe | 2 | # Makefile for libcpp. Run 'configure' to generate Makefile from Makefile.in |
4f4e53dd | 3 | |
8d9254fc | 4 | # Copyright (C) 2004-2020 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 | |
748086b7 | 10 | #the Free Software Foundation; either version 3, or (at your option) |
078e3ffe | 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 | 18 | #You should have received a copy of the GNU General Public License |
748086b7 JJ |
19 | #along with libcpp; see the file COPYING3. If not see |
20 | #<http://www.gnu.org/licenses/>. | |
c6e83800 | 21 | |
078e3ffe | 22 | @SET_MAKE@ |
4f4e53dd PB |
23 | |
24 | srcdir = @srcdir@ | |
5d1f4b27 | 25 | top_builddir = . |
4f4e53dd | 26 | VPATH = @srcdir@ |
4f4e53dd | 27 | INSTALL = @INSTALL@ |
4f4e53dd PB |
28 | AR = ar |
29 | ARFLAGS = cru | |
4f4e53dd | 30 | ACLOCAL = @ACLOCAL@ |
4f4e53dd PB |
31 | AUTOCONF = @AUTOCONF@ |
32 | AUTOHEADER = @AUTOHEADER@ | |
5c3c3683 | 33 | CATALOGS = $(patsubst %,po/%,@CATALOGS@) |
4f4e53dd | 34 | CC = @CC@ |
4f4e53dd | 35 | CFLAGS = @CFLAGS@ |
f1bf410c JQ |
36 | WARN_CFLAGS = @warn@ @c_warn@ @WARN_PEDANTIC@ @WERROR@ |
37 | CXX = @CXX@ | |
38 | CXXFLAGS = @CXXFLAGS@ | |
39 | WARN_CXXFLAGS = @warn@ @WARN_PEDANTIC@ @WERROR@ | |
4f4e53dd PB |
40 | CPP = @CPP@ |
41 | CPPFLAGS = @CPPFLAGS@ | |
4f4e53dd PB |
42 | EXEEXT = @EXEEXT@ |
43 | GMSGFMT = @GMSGFMT@ | |
44 | INCINTL = @INCINTL@ | |
45 | INSTALL_DATA = @INSTALL_DATA@ | |
46 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
47 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
4f4e53dd PB |
48 | LDFLAGS = @LDFLAGS@ |
49 | LIBICONV = @LIBICONV@ | |
50 | LIBINTL = @LIBINTL@ | |
4f4e53dd | 51 | PACKAGE = @PACKAGE@ |
4f4e53dd | 52 | RANLIB = @RANLIB@ |
4f4e53dd | 53 | SHELL = @SHELL@ |
078e3ffe | 54 | USED_CATALOGS = @USED_CATALOGS@ |
4f4e53dd | 55 | XGETTEXT = @XGETTEXT@ |
f1bf410c JQ |
56 | CCDEPMODE = @CCDEPMODE@ |
57 | CXXDEPMODE = @CXXDEPMODE@ | |
f610dd5f | 58 | DEPDIR = @DEPDIR@ |
e9411247 | 59 | NOEXCEPTION_FLAGS = @noexception_flags@ |
459260ec | 60 | PICFLAG = @PICFLAG@ |
078e3ffe | 61 | |
2d09b640 | 62 | datarootdir = @datarootdir@ |
4f4e53dd | 63 | datadir = @datadir@ |
078e3ffe | 64 | exec_prefix = @prefix@ |
4f4e53dd | 65 | libdir = @libdir@ |
4f4e53dd | 66 | localedir = $(datadir)/locale |
078e3ffe | 67 | prefix = @prefix@ |
4f4e53dd | 68 | |
078e3ffe PB |
69 | MSGMERGE = msgmerge |
70 | mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs | |
f610dd5f ZW |
71 | depcomp = $(SHELL) $(srcdir)/../depcomp |
72 | ||
078e3ffe PB |
73 | INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \ |
74 | -I$(srcdir)/include | |
75 | ||
459260ec | 76 | ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS) $(PICFLAG) |
e9411247 | 77 | ALL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(NOEXCEPTION_FLAGS) $(INCLUDES) \ |
459260ec | 78 | $(CPPFLAGS) $(PICFLAG) |
f1bf410c JQ |
79 | |
80 | # The name of the compiler to use. | |
f1bf410c JQ |
81 | COMPILER = $(CXX) |
82 | COMPILER_FLAGS = $(ALL_CXXFLAGS) | |
83 | DEPMODE = $(CXXDEPMODE) | |
f1bf410c | 84 | |
018a4785 | 85 | |
ccfc4c91 OW |
86 | libcpp_a_OBJS = charset.o directives.o directives-only.o errors.o \ |
87 | expr.o files.o identifiers.o init.o lex.o line-map.o macro.o \ | |
88 | mkdeps.o pch.o symtab.o traditional.o | |
078e3ffe | 89 | |
ccfc4c91 OW |
90 | libcpp_a_SOURCES = charset.c directives.c directives-only.c errors.c \ |
91 | expr.c files.c identifiers.c init.c lex.c line-map.c macro.c \ | |
92 | mkdeps.c pch.c symtab.c traditional.c | |
4f4e53dd | 93 | |
148e4216 | 94 | all: libcpp.a $(USED_CATALOGS) |
4f4e53dd PB |
95 | |
96 | .SUFFIXES: | |
97 | .SUFFIXES: .c .gmo .o .obj .po .pox | |
4f4e53dd | 98 | |
078e3ffe | 99 | libcpp.a: $(libcpp_a_OBJS) |
4f4e53dd | 100 | -rm -f libcpp.a |
078e3ffe | 101 | $(AR) $(ARFLAGS) libcpp.a $(libcpp_a_OBJS) |
4f4e53dd PB |
102 | $(RANLIB) libcpp.a |
103 | ||
078e3ffe | 104 | # Rules to rebuild the configuration |
4f4e53dd | 105 | |
078e3ffe PB |
106 | Makefile: $(srcdir)/Makefile.in config.status |
107 | $(SHELL) ./config.status Makefile | |
4f4e53dd | 108 | |
078e3ffe PB |
109 | config.status: $(srcdir)/configure |
110 | $(SHELL) ./config.status --recheck | |
4f4e53dd | 111 | |
078e3ffe PB |
112 | $(srcdir)/configure: @MAINT@ $(srcdir)/aclocal.m4 |
113 | cd $(srcdir) && $(AUTOCONF) | |
4f4e53dd | 114 | |
078e3ffe | 115 | $(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/../config/acx.m4 \ |
88fa57d7 KC |
116 | $(srcdir)/../config/gettext-sister.m4 $(srcdir)/../config/iconv.m4 \ |
117 | $(srcdir)/../config/codeset.m4 $(srcdir)/../config/lib-ld.m4 \ | |
118 | $(srcdir)/../config/lib-link.m4 $(srcdir)/../config/lib-prefix.m4 \ | |
18c04407 | 119 | $(srcdir)/../config/override.m4 $(srcdir)/../config/proginstall.m4 \ |
88fa57d7 | 120 | $(srcdir)/configure.ac |
078e3ffe | 121 | cd $(srcdir) && $(ACLOCAL) -I ../config |
4f4e53dd | 122 | |
078e3ffe PB |
123 | config.h: stamp-h1 |
124 | test -f config.h || (rm -f stamp-h1 && $(MAKE) stamp-h1) | |
4f4e53dd | 125 | |
078e3ffe PB |
126 | stamp-h1: $(srcdir)/config.in config.status |
127 | -rm -f stamp-h1 | |
128 | $(SHELL) ./config.status config.h | |
4f4e53dd | 129 | |
185a6cc1 | 130 | $(srcdir)/config.in: @MAINT@ $(srcdir)/configure.ac |
078e3ffe PB |
131 | cd $(srcdir) && $(AUTOHEADER) |
132 | -rm -f stamp-h1 | |
018a4785 ZW |
133 | |
134 | # It is not possible to get LOCALEDIR defined in config.h because | |
135 | # the value it needs to be defined to is only determined in the | |
136 | # Makefile. Hence we do this instead. | |
137 | localedir.h: localedir.hs; @true | |
138 | localedir.hs: Makefile | |
139 | echo "#define LOCALEDIR \"$(localedir)\"" > localedir.new | |
140 | $(srcdir)/../move-if-change localedir.new localedir.h | |
141 | echo timestamp > localedir.hs | |
4f4e53dd | 142 | |
078e3ffe | 143 | # Installation rules and other phony targets |
4f4e53dd | 144 | |
078e3ffe PB |
145 | # These rule has to look for .gmo modules in both srcdir and |
146 | # the cwd, and has to check that we actually have a catalog | |
147 | # for each language, in case they weren't built or included | |
148 | # with the distribution. | |
149 | installdirs: | |
150 | @$(mkinstalldirs) $(DESTDIR)$(datadir); \ | |
151 | cats="$(CATALOGS)"; for cat in $$cats; do \ | |
152 | lang=`basename $$cat | sed 's/\.gmo$$//'`; \ | |
153 | if [ -f $$cat ] || [ -f $(srcdir)/$$cat ]; then \ | |
154 | dir=$(localedir)/$$lang/LC_MESSAGES; \ | |
155 | $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \ | |
156 | fi; \ | |
157 | done | |
4f4e53dd | 158 | |
078e3ffe PB |
159 | install-strip install: all installdirs |
160 | cats="$(CATALOGS)"; for cat in $$cats; do \ | |
161 | lang=`basename $$cat | sed 's/\.gmo$$//'`; \ | |
162 | if [ -f $$cat ]; then :; \ | |
163 | elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \ | |
164 | else continue; \ | |
165 | fi; \ | |
166 | dir=$(localedir)/$$lang/LC_MESSAGES; \ | |
167 | echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ | |
168 | $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ | |
169 | done | |
4f4e53dd | 170 | |
078e3ffe PB |
171 | mostlyclean: |
172 | -rm -f *.o | |
4f4e53dd | 173 | |
078e3ffe | 174 | clean: mostlyclean |
148e4216 | 175 | -rm -rf libcpp.a $(srcdir)/autom4te.cache |
4f4e53dd | 176 | |
078e3ffe PB |
177 | distclean: clean |
178 | -rm -f config.h stamp-h1 config.status config.cache config.log \ | |
018a4785 | 179 | configure.lineno configure.status.lineno Makefile localedir.h \ |
f610dd5f ZW |
180 | localedir.hs $(DEPDIR)/*.Po |
181 | -rmdir $(DEPDIR) | |
4f4e53dd | 182 | |
078e3ffe PB |
183 | maintainer-clean: distclean |
184 | @echo "This command is intended for maintainers to use" | |
185 | @echo "it deletes files that may require special tools to rebuild." | |
186 | -rm -f $(srcdir)/configure $(srcdir)/aclocal.m4 | |
187 | ||
188 | check: | |
189 | installcheck: | |
190 | dvi: | |
b5422ad7 | 191 | pdf: |
078e3ffe PB |
192 | html: |
193 | info: | |
194 | install-info: | |
4fcb360b | 195 | install-pdf: |
4f4e53dd | 196 | install-man: |
b2bd74bc | 197 | install-html: |
4f4e53dd | 198 | |
078e3ffe | 199 | update-po: $(CATALOGS:.gmo=.pox) |
4f4e53dd | 200 | |
078e3ffe | 201 | .PHONY: installdirs install install-strip mostlyclean clean distclean \ |
b5422ad7 | 202 | maintainer-clean check installcheck dvi pdf html info install-info \ |
b2bd74bc | 203 | install-man update-po install-html |
4f4e53dd | 204 | |
f610dd5f | 205 | # Dependency rule. |
f1bf410c | 206 | COMPILE.base = $(COMPILER) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(COMPILER_FLAGS) -c |
f610dd5f | 207 | ifeq ($(DEPMODE),depmode=gcc3) |
161031e3 TT |
208 | # Note that we put the dependencies into a .Tpo file, then move them |
209 | # into place if the compile succeeds. We need this because gcc does | |
210 | # not atomically write the dependency output file. | |
211 | COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Tpo | |
212 | POSTCOMPILE = @mv $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | |
f610dd5f ZW |
213 | else |
214 | COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \ | |
215 | $(depcomp) $(COMPILE.base) | |
161031e3 TT |
216 | # depcomp handles atomicity for us, so we don't need a postcompile |
217 | # step. | |
218 | POSTCOMPILE = | |
f610dd5f ZW |
219 | endif |
220 | ||
078e3ffe | 221 | # Implicit rules and I18N |
0ca8e815 | 222 | |
078e3ffe | 223 | .c.o: |
f610dd5f | 224 | $(COMPILE) $< |
161031e3 | 225 | $(POSTCOMPILE) |
4f4e53dd PB |
226 | |
227 | # N.B. We do not attempt to copy these into $(srcdir). | |
228 | .po.gmo: | |
fc0cd180 | 229 | $(mkinstalldirs) po |
4f4e53dd PB |
230 | $(GMSGFMT) --statistics -o $@ $< |
231 | ||
232 | # The new .po has to be gone over by hand, so we deposit it into | |
233 | # build/po with a different extension. | |
234 | # If build/po/$(PACKAGE).pot exists, use it (it was just created), | |
235 | # else use the one in srcdir. | |
236 | .po.pox: | |
fc0cd180 | 237 | $(mkinstalldirs) po |
4f4e53dd PB |
238 | $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \ |
239 | then echo po/$(PACKAGE).pot; \ | |
240 | else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@ | |
241 | ||
078e3ffe | 242 | # Rule for regenerating the message template. |
50f47ee0 | 243 | $(PACKAGE).pot: po/$(PACKAGE).pot |
078e3ffe | 244 | po/$(PACKAGE).pot: $(libcpp_a_SOURCES) |
f1450211 | 245 | $(mkinstalldirs) $(srcdir)/po |
4f4e53dd | 246 | $(XGETTEXT) --default-domain=$(PACKAGE) \ |
50f47ee0 | 247 | --keyword=_ --keyword=N_ \ |
87cf0651 SB |
248 | --keyword=cpp_error:3 \ |
249 | --keyword=cpp_warning:3 \ | |
250 | --keyword=cpp_pedwarning:3 \ | |
251 | --keyword=cpp_warning_syshdr:3 \ | |
50f47ee0 | 252 | --keyword=cpp_error_with_line:5 \ |
87cf0651 SB |
253 | --keyword=cpp_warning_with_line:5 \ |
254 | --keyword=cpp_pedwarning_with_line:5 \ | |
255 | --keyword=cpp_warning_with_line_syshdr:5 \ | |
256 | --keyword=cpp_errno:3 \ | |
50f47ee0 | 257 | --keyword=SYNTAX_ERROR --keyword=SYNTAX_ERROR2 \ |
4f4e53dd | 258 | --copyright-holder="Free Software Foundation, Inc." \ |
e228c50f | 259 | --msgid-bugs-address="https://gcc.gnu.org/bugs/" \ |
50f47ee0 JM |
260 | --language=c -o po/$(PACKAGE).pot.tmp $^ |
261 | sed 's:$(srcdir)/::g' <po/$(PACKAGE).pot.tmp >po/$(PACKAGE).pot | |
262 | rm po/$(PACKAGE).pot.tmp | |
078e3ffe | 263 | |
abcd1775 NS |
264 | TAGS_SOURCES = $(libcpp_a_SOURCES) internal.h system.h ucnid.h \ |
265 | include/cpplib.h include/line-map.h include/mkdeps.h include/symtab.h | |
7f27b0f8 TT |
266 | |
267 | TAGS: $(TAGS_SOURCES) | |
268 | cd $(srcdir) && etags $(TAGS_SOURCES) | |
078e3ffe | 269 | |
4f4e53dd PB |
270 | # Tell versions [3.59,3.63) of GNU make to not export all variables. |
271 | # Otherwise a system limit (for SysV at least) may be exceeded. | |
272 | .NOEXPORT: | |
078e3ffe PB |
273 | |
274 | # Dependencies | |
148e4216 | 275 | -include $(patsubst %.o, $(DEPDIR)/%.Po, $(libcpp_a_OBJS)) |
078e3ffe | 276 | |
f610dd5f ZW |
277 | # Dependencies on generated headers have to be explicit. |
278 | init.o: localedir.h |