2 # Makefile for libcpp. Run 'configure' to generate Makefile from Makefile.in
4 # Copyright (C) 2004, 2008 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, 51 Franklin Street, Fifth Floor,
21 #Boston MA 02110-1301, USA.
33 AUTOHEADER
= @AUTOHEADER@
34 CATALOGS
= $(patsubst %,po
/%,@CATALOGS@
)
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@
57 datarootdir
= @datarootdir@
59 exec_prefix = @
prefix@
61 localedir
= $(datadir)/locale
65 mkinstalldirs
= $(SHELL
) $(srcdir)/..
/mkinstalldirs
66 depcomp
= $(SHELL
) $(srcdir)/..
/depcomp
68 INCLUDES
= -I
$(srcdir) -I.
-I
$(srcdir)/..
/include @INCINTL@ \
71 ALL_CFLAGS
= $(CFLAGS
) $(WARN_CFLAGS
) $(INCLUDES
) $(CPPFLAGS
)
73 libcpp_a_OBJS
= charset.o directives.o directives-only.o errors.o \
74 expr.o files.o identifiers.o init.o
lex.o line-map.o macro.o \
75 mkdeps.o pch.o symtab.o traditional.o
76 makedepend_OBJS
= makedepend.o
78 libcpp_a_SOURCES
= charset.c directives.c directives-only.c errors.c \
79 expr.c files.c identifiers.c init.c
lex.c line-map.c macro.c \
80 mkdeps.c pch.c symtab.c traditional.c
82 all: libcpp.a makedepend
$(EXEEXT
) $(USED_CATALOGS
)
85 .SUFFIXES
: .c .gmo .o .obj .po .pox
87 libcpp.a
: $(libcpp_a_OBJS
)
89 $(AR
) $(ARFLAGS
) libcpp.a
$(libcpp_a_OBJS
)
92 makedepend
$(EXEEXT
): $(makedepend_OBJS
) libcpp.a ..
/libiberty
/libiberty.a
93 @
rm -f makedepend
$(EXEEXT
)
94 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o makedepend
$(EXEEXT
) \
95 $(makedepend_OBJS
) libcpp.a ..
/libiberty
/libiberty.a \
96 $(LIBINTL
) $(LIBICONV
)
98 # Rules to rebuild the configuration
100 Makefile
: $(srcdir)/Makefile.in config.status
101 $(SHELL
) .
/config.status Makefile
103 config.status
: $(srcdir)/configure
104 $(SHELL
) .
/config.status
--recheck
106 $(srcdir)/configure
: @MAINT@
$(srcdir)/aclocal.m4
107 cd
$(srcdir) && $(AUTOCONF
)
109 $(srcdir)/aclocal.m4
: @MAINT@
$(srcdir)/..
/config
/acx.m4 \
110 $(srcdir)/..
/config
/gettext-sister.m4
$(srcdir)/..
/config
/iconv.m4 \
111 $(srcdir)/..
/config
/codeset.m4
$(srcdir)/..
/config
/lib-ld.m4 \
112 $(srcdir)/..
/config
/lib-link.m4
$(srcdir)/..
/config
/lib-prefix.m4 \
113 $(srcdir)/..
/config
/override.m4
$(srcdir)/..
/config
/proginstall.m4 \
114 $(srcdir)/configure.ac
115 cd
$(srcdir) && $(ACLOCAL
) -I ..
/config
118 test -f config.h ||
(rm -f stamp-h1
&& $(MAKE
) stamp-h1
)
120 stamp-h1
: $(srcdir)/config.in config.status
122 $(SHELL
) .
/config.status config.h
124 $(srcdir)/config.in
: @MAINT@
$(srcdir)/configure.ac
125 cd
$(srcdir) && $(AUTOHEADER
)
128 # It is not possible to get LOCALEDIR defined in config.h because
129 # the value it needs to be defined to is only determined in the
130 # Makefile. Hence we do this instead.
131 localedir.h
: localedir.hs
; @true
132 localedir.hs
: Makefile
133 echo
"#define LOCALEDIR \"$(localedir)\"" > localedir.new
134 $(srcdir)/..
/move-if-change localedir.new localedir.h
135 echo timestamp
> localedir.hs
137 # Installation rules and other phony targets
139 # These rule has to look for .gmo modules in both srcdir and
140 # the cwd, and has to check that we actually have a catalog
141 # for each language, in case they weren't built or included
142 # with the distribution.
144 @
$(mkinstalldirs
) $(DESTDIR
)$(datadir); \
145 cats
="$(CATALOGS)"; for cat in
$$cats; do \
146 lang
=`basename $$cat | sed 's/\.gmo$$//'`; \
147 if
[ -f
$$cat ] ||
[ -f
$(srcdir)/$$cat ]; then \
148 dir=$(localedir
)/$$lang/LC_MESSAGES
; \
149 $(mkinstalldirs
) $(DESTDIR
)$$dir || exit
1; \
153 install-strip
install: all installdirs
154 cats
="$(CATALOGS)"; for cat in
$$cats; do \
155 lang
=`basename $$cat | sed 's/\.gmo$$//'`; \
156 if
[ -f
$$cat ]; then
:; \
157 elif
[ -f
$(srcdir)/$$cat ]; then cat
=$(srcdir)/$$cat; \
160 dir=$(localedir
)/$$lang/LC_MESSAGES
; \
161 echo
$(INSTALL_DATA
) $$cat $(DESTDIR
)$$dir/$(PACKAGE
).mo
; \
162 $(INSTALL_DATA
) $$cat $(DESTDIR
)$$dir/$(PACKAGE
).mo
; \
169 -rm -rf makedepend
$(EXEEXT
) libcpp.a
$(srcdir)/autom4te.cache
172 -rm -f config.h stamp-h1 config.status config.cache config.log \
173 configure.lineno configure.status.lineno Makefile localedir.h \
174 localedir.hs
$(DEPDIR
)/*.Po
177 maintainer-clean
: distclean
178 @echo
"This command is intended for maintainers to use"
179 @echo
"it deletes files that may require special tools to rebuild."
180 -rm -f
$(srcdir)/configure
$(srcdir)/aclocal.m4
193 update-po
: $(CATALOGS
:.gmo
=.pox
)
195 .PHONY
: installdirs install install-strip
mostlyclean clean distclean \
196 maintainer-clean
check installcheck dvi pdf html
info install-info \
197 install-man update-po install-html
200 COMPILE.base
= $(CC
) $(DEFS
) $(INCLUDES
) $(CPPFLAGS
) $(ALL_CFLAGS
) -c
201 ifeq ($(DEPMODE
),depmode
=gcc3
)
202 # Note that we put the dependencies into a .Tpo file, then move them
203 # into place if the compile succeeds. We need this because gcc does
204 # not atomically write the dependency output file.
205 COMPILE
= $(COMPILE.base
) -o
$@
-MT
$@
-MMD
-MP
-MF
$(DEPDIR
)/$*.Tpo
206 POSTCOMPILE
= @mv
$(DEPDIR
)/$*.Tpo
$(DEPDIR
)/$*.Po
208 COMPILE
= source
='$<' object
='$@' libtool
=no DEPDIR
=$(DEPDIR
) $(DEPMODE
) \
209 $(depcomp
) $(COMPILE.base
)
210 # depcomp handles atomicity for us, so we don't need a postcompile
215 # Implicit rules and I18N
221 # N.B. We do not attempt to copy these into $(srcdir).
223 -test -d po || mkdir po
224 $(GMSGFMT
) --statistics
-o
$@
$<
226 # The new .po has to be gone over by hand, so we deposit it into
227 # build/po with a different extension.
228 # If build/po/$(PACKAGE).pot exists, use it (it was just created),
229 # else use the one in srcdir.
231 -test -d po || mkdir po
232 $(MSGMERGE
) $< `if test -f po/$(PACKAGE).pot; \
233 then echo po/$(PACKAGE).pot; \
234 else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o
$@
236 # Rule for regenerating the message template.
237 $(PACKAGE
).pot
: po
/$(PACKAGE
).pot
238 po
/$(PACKAGE
).pot
: $(libcpp_a_SOURCES
)
239 -test -d
$(srcdir)/po || mkdir
$(srcdir)/po
240 $(XGETTEXT
) --default-domain
=$(PACKAGE
) \
241 --keyword
=_
--keyword
=N_ \
242 --keyword
=cpp_error
:3 --keyword
=cpp_errno
:3 \
243 --keyword
=cpp_error_with_line
:5 \
244 --keyword
=SYNTAX_ERROR
--keyword
=SYNTAX_ERROR2 \
245 --copyright-holder
="Free Software Foundation, Inc." \
246 --msgid-bugs-address
="http://gcc.gnu.org/bugs.html" \
247 --language
=c
-o po
/$(PACKAGE
).pot.tmp
$^
248 sed
's:$(srcdir)/::g' <po
/$(PACKAGE
).pot.tmp
>po
/$(PACKAGE
).pot
249 rm po
/$(PACKAGE
).pot.tmp
251 TAGS_SOURCES
= $(libcpp_a_SOURCES
) makedepend.c internal.h ucnid.h \
252 include/line-map.h
include/symtab.h
include/cpp-id-data.h \
253 include/cpplib.h
include/mkdeps.h system.h
255 TAGS
: $(TAGS_SOURCES
)
256 cd
$(srcdir) && etags
$(TAGS_SOURCES
)
258 # Tell versions [3.59,3.63) of GNU make to not export all variables.
259 # Otherwise a system limit (for SysV at least) may be exceeded.
263 -include $(patsubst %.o
, $(DEPDIR
)/%.Po
, $(libcpp_a_OBJS
) $(makedepend_OBJS
))
265 # Dependencies on generated headers have to be explicit.