]>
Commit | Line | Data |
---|---|---|
4f4e53dd | 1 | # @configure_input@ |
078e3ffe | 2 | # Makefile for libcpp. Run 'configure' to generate Makefile from Makefile.in |
4f4e53dd | 3 | |
078e3ffe | 4 | # Copyright (C) 2004 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 | |
20 | #the Free Software Foundation, 59 Temple Place - Suite 330, | |
21 | #Boston MA 02111-1307, USA. | |
c6e83800 | 22 | |
078e3ffe | 23 | @SET_MAKE@ |
4f4e53dd PB |
24 | |
25 | srcdir = @srcdir@ | |
5d1f4b27 | 26 | top_builddir = . |
4f4e53dd | 27 | VPATH = @srcdir@ |
4f4e53dd | 28 | INSTALL = @INSTALL@ |
4f4e53dd PB |
29 | AR = ar |
30 | ARFLAGS = cru | |
4f4e53dd | 31 | ACLOCAL = @ACLOCAL@ |
4f4e53dd PB |
32 | AUTOCONF = @AUTOCONF@ |
33 | AUTOHEADER = @AUTOHEADER@ | |
4f4e53dd PB |
34 | CATALOGS = @CATALOGS@ |
35 | CC = @CC@ | |
4f4e53dd | 36 | CFLAGS = @CFLAGS@ |
018a4785 | 37 | WARN_CFLAGS = @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@ |
4f4e53dd PB |
38 | CPP = @CPP@ |
39 | CPPFLAGS = @CPPFLAGS@ | |
4f4e53dd PB |
40 | EXEEXT = @EXEEXT@ |
41 | GMSGFMT = @GMSGFMT@ | |
42 | INCINTL = @INCINTL@ | |
43 | INSTALL_DATA = @INSTALL_DATA@ | |
44 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
45 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
4f4e53dd PB |
46 | LDFLAGS = @LDFLAGS@ |
47 | LIBICONV = @LIBICONV@ | |
48 | LIBINTL = @LIBINTL@ | |
4f4e53dd | 49 | PACKAGE = @PACKAGE@ |
4f4e53dd | 50 | RANLIB = @RANLIB@ |
4f4e53dd | 51 | SHELL = @SHELL@ |
078e3ffe | 52 | USED_CATALOGS = @USED_CATALOGS@ |
4f4e53dd | 53 | XGETTEXT = @XGETTEXT@ |
078e3ffe | 54 | |
4f4e53dd | 55 | datadir = @datadir@ |
078e3ffe | 56 | exec_prefix = @prefix@ |
4f4e53dd | 57 | libdir = @libdir@ |
4f4e53dd | 58 | localedir = $(datadir)/locale |
078e3ffe | 59 | prefix = @prefix@ |
4f4e53dd | 60 | |
078e3ffe PB |
61 | MSGMERGE = msgmerge |
62 | mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs | |
078e3ffe PB |
63 | INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \ |
64 | -I$(srcdir)/include | |
65 | ||
018a4785 ZW |
66 | ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS) |
67 | ||
078e3ffe PB |
68 | libcpp_a_OBJS = charset.o directives.o errors.o expr.o files.o \ |
69 | identifiers.o init.o lex.o line-map.o macro.o mkdeps.o \ | |
70 | pch.o symtab.o traditional.o | |
71 | makedepend_OBJS = makedepend.o | |
72 | ||
73 | libcpp_a_SOURCES = charset.c directives.c errors.c expr.c files.c \ | |
4f4e53dd PB |
74 | identifiers.c init.c lex.c line-map.c macro.c mkdeps.c \ |
75 | pch.c symtab.c traditional.c | |
76 | ||
078e3ffe | 77 | all: libcpp.a makedepend$(EXEEXT) $(USED_CATALOGS) |
4f4e53dd PB |
78 | |
79 | .SUFFIXES: | |
80 | .SUFFIXES: .c .gmo .o .obj .po .pox | |
4f4e53dd | 81 | |
078e3ffe | 82 | libcpp.a: $(libcpp_a_OBJS) |
4f4e53dd | 83 | -rm -f libcpp.a |
078e3ffe | 84 | $(AR) $(ARFLAGS) libcpp.a $(libcpp_a_OBJS) |
4f4e53dd PB |
85 | $(RANLIB) libcpp.a |
86 | ||
078e3ffe | 87 | makedepend$(EXEEXT): $(makedepend_OBJS) libcpp.a ../libiberty/libiberty.a |
c6e83800 | 88 | @rm -f makedepend$(EXEEXT) |
078e3ffe PB |
89 | $(CC) $(CFLAGS) $(LDFLAGS) -o makedepend$(EXEEXT) \ |
90 | $(makedepend_OBJS) libcpp.a ../libiberty/libiberty.a \ | |
91 | $(LIBINTL) $(LIBICONV) | |
4f4e53dd | 92 | |
078e3ffe | 93 | # Rules to rebuild the configuration |
4f4e53dd | 94 | |
078e3ffe PB |
95 | Makefile: $(srcdir)/Makefile.in config.status |
96 | $(SHELL) ./config.status Makefile | |
4f4e53dd | 97 | |
078e3ffe PB |
98 | config.status: $(srcdir)/configure |
99 | $(SHELL) ./config.status --recheck | |
4f4e53dd | 100 | |
078e3ffe PB |
101 | $(srcdir)/configure: @MAINT@ $(srcdir)/aclocal.m4 |
102 | cd $(srcdir) && $(AUTOCONF) | |
4f4e53dd | 103 | |
078e3ffe | 104 | $(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/../config/acx.m4 \ |
88fa57d7 KC |
105 | $(srcdir)/../config/gettext-sister.m4 $(srcdir)/../config/iconv.m4 \ |
106 | $(srcdir)/../config/codeset.m4 $(srcdir)/../config/lib-ld.m4 \ | |
107 | $(srcdir)/../config/lib-link.m4 $(srcdir)/../config/lib-prefix.m4 \ | |
108 | $(srcdir)/configure.ac | |
078e3ffe | 109 | cd $(srcdir) && $(ACLOCAL) -I ../config |
4f4e53dd | 110 | |
078e3ffe PB |
111 | config.h: stamp-h1 |
112 | test -f config.h || (rm -f stamp-h1 && $(MAKE) stamp-h1) | |
4f4e53dd | 113 | |
078e3ffe PB |
114 | stamp-h1: $(srcdir)/config.in config.status |
115 | -rm -f stamp-h1 | |
116 | $(SHELL) ./config.status config.h | |
4f4e53dd | 117 | |
078e3ffe PB |
118 | $(srcdir)/config.in: @MAINT@ $(srcdir)/configure |
119 | cd $(srcdir) && $(AUTOHEADER) | |
120 | -rm -f stamp-h1 | |
018a4785 ZW |
121 | |
122 | # It is not possible to get LOCALEDIR defined in config.h because | |
123 | # the value it needs to be defined to is only determined in the | |
124 | # Makefile. Hence we do this instead. | |
125 | localedir.h: localedir.hs; @true | |
126 | localedir.hs: Makefile | |
127 | echo "#define LOCALEDIR \"$(localedir)\"" > localedir.new | |
128 | $(srcdir)/../move-if-change localedir.new localedir.h | |
129 | echo timestamp > localedir.hs | |
4f4e53dd | 130 | |
078e3ffe | 131 | # Installation rules and other phony targets |
4f4e53dd | 132 | |
078e3ffe PB |
133 | # These rule has to look for .gmo modules in both srcdir and |
134 | # the cwd, and has to check that we actually have a catalog | |
135 | # for each language, in case they weren't built or included | |
136 | # with the distribution. | |
137 | installdirs: | |
138 | @$(mkinstalldirs) $(DESTDIR)$(datadir); \ | |
139 | cats="$(CATALOGS)"; for cat in $$cats; do \ | |
140 | lang=`basename $$cat | sed 's/\.gmo$$//'`; \ | |
141 | if [ -f $$cat ] || [ -f $(srcdir)/$$cat ]; then \ | |
142 | dir=$(localedir)/$$lang/LC_MESSAGES; \ | |
143 | $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \ | |
144 | fi; \ | |
145 | done | |
4f4e53dd | 146 | |
078e3ffe PB |
147 | install-strip install: all installdirs |
148 | cats="$(CATALOGS)"; for cat in $$cats; do \ | |
149 | lang=`basename $$cat | sed 's/\.gmo$$//'`; \ | |
150 | if [ -f $$cat ]; then :; \ | |
151 | elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \ | |
152 | else continue; \ | |
153 | fi; \ | |
154 | dir=$(localedir)/$$lang/LC_MESSAGES; \ | |
155 | echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ | |
156 | $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ | |
157 | done | |
4f4e53dd | 158 | |
078e3ffe PB |
159 | mostlyclean: |
160 | -rm -f *.o | |
4f4e53dd | 161 | |
078e3ffe | 162 | clean: mostlyclean |
018a4785 | 163 | -rm -rf makedepend$(EXEEXT) libcpp.a $(srcdir)/autom4te.cache |
4f4e53dd | 164 | |
078e3ffe PB |
165 | distclean: clean |
166 | -rm -f config.h stamp-h1 config.status config.cache config.log \ | |
018a4785 ZW |
167 | configure.lineno configure.status.lineno Makefile localedir.h \ |
168 | localedir.hs | |
4f4e53dd | 169 | |
078e3ffe PB |
170 | maintainer-clean: distclean |
171 | @echo "This command is intended for maintainers to use" | |
172 | @echo "it deletes files that may require special tools to rebuild." | |
173 | -rm -f $(srcdir)/configure $(srcdir)/aclocal.m4 | |
174 | ||
175 | check: | |
176 | installcheck: | |
177 | dvi: | |
178 | html: | |
179 | info: | |
180 | install-info: | |
4f4e53dd PB |
181 | install-man: |
182 | ||
078e3ffe | 183 | update-po: $(CATALOGS:.gmo=.pox) |
4f4e53dd | 184 | |
078e3ffe PB |
185 | .PHONY: installdirs install install-strip mostlyclean clean distclean \ |
186 | maintainer-clean check installcheck dvi html info install-info \ | |
187 | install-man update-po | |
4f4e53dd | 188 | |
078e3ffe | 189 | # Implicit rules and I18N |
0ca8e815 | 190 | |
078e3ffe | 191 | .c.o: |
018a4785 | 192 | $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(ALL_CFLAGS) -c $< |
4f4e53dd PB |
193 | |
194 | # N.B. We do not attempt to copy these into $(srcdir). | |
195 | .po.gmo: | |
196 | -test -d po || mkdir po | |
197 | $(GMSGFMT) --statistics -o $@ $< | |
198 | ||
199 | # The new .po has to be gone over by hand, so we deposit it into | |
200 | # build/po with a different extension. | |
201 | # If build/po/$(PACKAGE).pot exists, use it (it was just created), | |
202 | # else use the one in srcdir. | |
203 | .po.pox: | |
204 | -test -d po || mkdir po | |
205 | $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \ | |
206 | then echo po/$(PACKAGE).pot; \ | |
207 | else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@ | |
208 | ||
078e3ffe PB |
209 | # Rule for regenerating the message template. |
210 | po/$(PACKAGE).pot: $(libcpp_a_SOURCES) | |
4f4e53dd PB |
211 | -test -d $(srcdir)/po || mkdir $(srcdir)/po |
212 | $(XGETTEXT) --default-domain=$(PACKAGE) \ | |
213 | --keyword=cpp_error,3 --keyword=cpp_errno,3 \ | |
214 | --keyword=cpp_error_with_line,5 \ | |
215 | --copyright-holder="Free Software Foundation, Inc." \ | |
216 | --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \ | |
217 | --language=c -o po/$(PACKAGE).pot $^ | |
078e3ffe PB |
218 | |
219 | ||
4f4e53dd PB |
220 | # Tell versions [3.59,3.63) of GNU make to not export all variables. |
221 | # Otherwise a system limit (for SysV at least) may be exceeded. | |
222 | .NOEXPORT: | |
078e3ffe PB |
223 | |
224 | # Dependencies | |
225 | ||
226 | top_srcdir = $(srcdir)/.. | |
227 | top_incdir = $(srcdir)/../include | |
228 | libcpp_incdir = $(srcdir)/../libcpp/include | |
229 | ||
230 | COMMON_DEPS = config.h $(srcdir)/system.h $(srcdir)/internal.h \ | |
231 | $(top_incdir)/libiberty.h $(top_incdir)/ansidecl.h \ | |
232 | $(top_incdir)/filenames.h $(top_incdir)/safe-ctype.h \ | |
233 | $(libcpp_incdir)/symtab.h $(top_incdir)/obstack.h \ | |
234 | $(libcpp_incdir)/line-map.h $(libcpp_incdir)/cpplib.h \ | |
235 | $(libcpp_incdir)/cpp-id-data.h $(top_incdir)/getopt.h | |
236 | ||
237 | charset.o: $(srcdir)/charset.c $(COMMON_DEPS) $(srcdir)/ucnid.h | |
238 | directives.o: $(srcdir)/directives.c $(COMMON_DEPS) $(libcpp_incdir)/mkdeps.h | |
239 | errors.o: $(srcdir)/errors.c $(COMMON_DEPS) | |
240 | expr.o: $(srcdir)/expr.c $(COMMON_DEPS) | |
241 | ||
242 | files.o: $(srcdir)/files.c $(COMMON_DEPS) $(libcpp_incdir)/mkdeps.h \ | |
243 | $(top_incdir)/hashtab.h $(top_incdir)/md5.h | |
078e3ffe | 244 | identifiers.o: $(srcdir)/identifiers.c $(COMMON_DEPS) |
018a4785 | 245 | init.o: $(srcdir)/init.c $(COMMON_DEPS) $(libcpp_incdir)/mkdeps.h localedir.h |
078e3ffe PB |
246 | lex.o: $(srcdir)/lex.c $(COMMON_DEPS) |
247 | line-map.o: $(srcdir)/line-map.c $(COMMON_DEPS) | |
248 | macro.o: $(srcdir)/macro.c $(COMMON_DEPS) | |
7731405b | 249 | makedepend.o: $(srcdir)/makedepend.c $(COMMON_DEPS) $(libcpp_incdir)/mkdeps.h |
078e3ffe PB |
250 | mkdeps.o: $(srcdir)/mkdeps.c $(COMMON_DEPS) |
251 | ||
252 | pch.o: $(srcdir)/pch.c $(COMMON_DEPS) \ | |
253 | $(top_incdir)/hashtab.h $(libcpp_incdir)/mkdeps.h | |
254 | ||
255 | symtab.o: $(srcdir)/symtab.c $(COMMON_DEPS) | |
256 | traditional.o: $(srcdir)/traditional.c $(COMMON_DEPS) |