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