2 # Makefile for libcpp. Run 'configure' to generate Makefile from Makefile.in
4 # Copyright (C) 2004 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 2, or (at your option)
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 COPYING. If not, write to
20 #the Free Software Foundation, 59 Temple Place - Suite 330,
21 #Boston MA 02111-1307, USA.
33 AUTOHEADER
= @AUTOHEADER@
37 WARN_CFLAGS
= @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@
43 INSTALL_DATA
= @INSTALL_DATA@
44 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
45 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
52 USED_CATALOGS
= @USED_CATALOGS@
56 exec_prefix = @
prefix@
58 localedir
= $(datadir)/locale
62 mkinstalldirs
= $(SHELL
) $(srcdir)/..
/mkinstalldirs
63 INCLUDES
= -I
$(srcdir) -I.
-I
$(srcdir)/..
/include @INCINTL@ \
66 ALL_CFLAGS
= $(CFLAGS
) $(WARN_CFLAGS
) $(INCLUDES
) $(CPPFLAGS
)
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
73 libcpp_a_SOURCES
= charset.c directives.c errors.c expr.c files.c \
74 identifiers.c init.c
lex.c line-map.c macro.c mkdeps.c \
75 pch.c symtab.c traditional.c
77 all: libcpp.a makedepend
$(EXEEXT
) $(USED_CATALOGS
)
80 .SUFFIXES
: .c .gmo .o .obj .po .pox
82 libcpp.a
: $(libcpp_a_OBJS
)
84 $(AR
) $(ARFLAGS
) libcpp.a
$(libcpp_a_OBJS
)
87 makedepend
$(EXEEXT
): $(makedepend_OBJS
) libcpp.a ..
/libiberty
/libiberty.a
88 @
rm -f makedepend
$(EXEEXT
)
89 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o makedepend
$(EXEEXT
) \
90 $(makedepend_OBJS
) libcpp.a ..
/libiberty
/libiberty.a \
91 $(LIBINTL
) $(LIBICONV
)
93 # Rules to rebuild the configuration
95 Makefile
: $(srcdir)/Makefile.in config.status
96 $(SHELL
) .
/config.status Makefile
98 config.status
: $(srcdir)/configure
99 $(SHELL
) .
/config.status
--recheck
101 $(srcdir)/configure
: @MAINT@
$(srcdir)/aclocal.m4
102 cd
$(srcdir) && $(AUTOCONF
)
104 $(srcdir)/aclocal.m4
: @MAINT@
$(srcdir)/..
/config
/acx.m4 \
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
109 cd
$(srcdir) && $(ACLOCAL
) -I ..
/config
112 test -f config.h ||
(rm -f stamp-h1
&& $(MAKE
) stamp-h1
)
114 stamp-h1
: $(srcdir)/config.in config.status
116 $(SHELL
) .
/config.status config.h
118 $(srcdir)/config.in
: @MAINT@
$(srcdir)/configure
119 cd
$(srcdir) && $(AUTOHEADER
)
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
131 # Installation rules and other phony targets
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.
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; \
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; \
154 dir=$(localedir
)/$$lang/LC_MESSAGES
; \
155 echo
$(INSTALL_DATA
) $$cat $(DESTDIR
)$$dir/$(PACKAGE
).mo
; \
156 $(INSTALL_DATA
) $$cat $(DESTDIR
)$$dir/$(PACKAGE
).mo
; \
163 -rm -rf makedepend
$(EXEEXT
) libcpp.a
$(srcdir)/autom4te.cache
166 -rm -f config.h stamp-h1 config.status config.cache config.log \
167 configure.lineno configure.status.lineno Makefile localedir.h \
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
183 update-po
: $(CATALOGS
:.gmo
=.pox
)
185 .PHONY
: installdirs install install-strip
mostlyclean clean distclean \
186 maintainer-clean
check installcheck dvi html
info install-info \
187 install-man update-po
189 # Implicit rules and I18N
192 $(CC
) $(DEFS
) $(INCLUDES
) $(CPPFLAGS
) $(ALL_CFLAGS
) -c
$<
194 # N.B. We do not attempt to copy these into $(srcdir).
196 -test -d po || mkdir po
197 $(GMSGFMT
) --statistics
-o
$@
$<
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.
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
$@
209 # Rule for regenerating the message template.
210 po
/$(PACKAGE
).pot
: $(libcpp_a_SOURCES
)
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
$^
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.
226 top_srcdir
= $(srcdir)/..
227 top_incdir
= $(srcdir)/..
/include
228 libcpp_incdir
= $(srcdir)/..
/libcpp
/include
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
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
)
242 files.o
: $(srcdir)/files.c
$(COMMON_DEPS
) $(libcpp_incdir
)/mkdeps.h \
243 $(top_incdir
)/hashtab.h
$(top_incdir
)/md5.h
244 identifiers.o
: $(srcdir)/identifiers.c
$(COMMON_DEPS
)
245 init.o
: $(srcdir)/init.c
$(COMMON_DEPS
) $(libcpp_incdir
)/mkdeps.h localedir.h
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
)
249 makedepend.o
: $(srcdir)/makedepend.c
$(COMMON_DEPS
)
250 mkdeps.o
: $(srcdir)/mkdeps.c
$(COMMON_DEPS
)
252 pch.o
: $(srcdir)/pch.c
$(COMMON_DEPS
) \
253 $(top_incdir
)/hashtab.h
$(libcpp_incdir
)/mkdeps.h
255 symtab.o
: $(srcdir)/symtab.c
$(COMMON_DEPS
)
256 traditional.o
: $(srcdir)/traditional.c
$(COMMON_DEPS
)