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