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@
42 INSTALL_DATA
= @INSTALL_DATA@
43 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
44 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
51 USED_CATALOGS
= @USED_CATALOGS@
55 exec_prefix = @
prefix@
57 localedir
= $(datadir)/locale
61 mkinstalldirs
= $(SHELL
) $(srcdir)/..
/mkinstalldirs
62 DEFS
= -DLOCALEDIR
="\"$(localedir)\""
63 INCLUDES
= -I
$(srcdir) -I.
-I
$(srcdir)/..
/include @INCINTL@ \
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
71 libcpp_a_SOURCES
= charset.c directives.c errors.c expr.c files.c \
72 identifiers.c init.c
lex.c line-map.c macro.c mkdeps.c \
73 pch.c symtab.c traditional.c
75 all: libcpp.a makedepend
$(EXEEXT
) $(USED_CATALOGS
)
78 .SUFFIXES
: .c .gmo .o .obj .po .pox
80 libcpp.a
: $(libcpp_a_OBJS
)
82 $(AR
) $(ARFLAGS
) libcpp.a
$(libcpp_a_OBJS
)
85 makedepend
$(EXEEXT
): $(makedepend_OBJS
) libcpp.a ..
/libiberty
/libiberty.a
86 @
rm -f makedepend
$(EXEEXT
)
87 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o makedepend
$(EXEEXT
) \
88 $(makedepend_OBJS
) libcpp.a ..
/libiberty
/libiberty.a \
89 $(LIBINTL
) $(LIBICONV
)
91 # Rules to rebuild the configuration
93 Makefile
: $(srcdir)/Makefile.in config.status
94 $(SHELL
) .
/config.status Makefile
96 config.status
: $(srcdir)/configure
97 $(SHELL
) .
/config.status
--recheck
99 $(srcdir)/configure
: @MAINT@
$(srcdir)/aclocal.m4
100 cd
$(srcdir) && $(AUTOCONF
)
102 $(srcdir)/aclocal.m4
: @MAINT@
$(srcdir)/..
/config
/acx.m4 \
103 $(srcdir)/..
/config
/gettext.m4
$(srcdir)/configure.ac
104 cd
$(srcdir) && $(ACLOCAL
) -I ..
/config
107 test -f config.h ||
(rm -f stamp-h1
&& $(MAKE
) stamp-h1
)
109 stamp-h1
: $(srcdir)/config.in config.status
111 $(SHELL
) .
/config.status config.h
113 $(srcdir)/config.in
: @MAINT@
$(srcdir)/configure
114 cd
$(srcdir) && $(AUTOHEADER
)
118 # Installation rules and other phony targets
120 # These rule has to look for .gmo modules in both srcdir and
121 # the cwd, and has to check that we actually have a catalog
122 # for each language, in case they weren't built or included
123 # with the distribution.
125 @
$(mkinstalldirs
) $(DESTDIR
)$(datadir); \
126 cats
="$(CATALOGS)"; for cat in
$$cats; do \
127 lang
=`basename $$cat | sed 's/\.gmo$$//'`; \
128 if
[ -f
$$cat ] ||
[ -f
$(srcdir)/$$cat ]; then \
129 dir=$(localedir
)/$$lang/LC_MESSAGES
; \
130 $(mkinstalldirs
) $(DESTDIR
)$$dir || exit
1; \
134 install-strip
install: all installdirs
135 cats
="$(CATALOGS)"; for cat in
$$cats; do \
136 lang
=`basename $$cat | sed 's/\.gmo$$//'`; \
137 if
[ -f
$$cat ]; then
:; \
138 elif
[ -f
$(srcdir)/$$cat ]; then cat
=$(srcdir)/$$cat; \
141 dir=$(localedir
)/$$lang/LC_MESSAGES
; \
142 echo
$(INSTALL_DATA
) $$cat $(DESTDIR
)$$dir/$(PACKAGE
).mo
; \
143 $(INSTALL_DATA
) $$cat $(DESTDIR
)$$dir/$(PACKAGE
).mo
; \
150 -rm -f makedepend
$(EXEEXT
) libcpp.a
$(srcdir)/autom4te.cache
153 -rm -f config.h stamp-h1 config.status config.cache config.log \
154 configure.lineno configure.status.lineno Makefile
156 maintainer-clean
: distclean
157 @echo
"This command is intended for maintainers to use"
158 @echo
"it deletes files that may require special tools to rebuild."
159 -rm -f
$(srcdir)/configure
$(srcdir)/aclocal.m4
169 update-po
: $(CATALOGS
:.gmo
=.pox
)
171 .PHONY
: installdirs install install-strip
mostlyclean clean distclean \
172 maintainer-clean
check installcheck dvi html
info install-info \
173 install-man update-po
175 # Implicit rules and I18N
178 $(CC
) $(DEFS
) $(INCLUDES
) $(CPPFLAGS
) $(CFLAGS
) -c
$<
180 # N.B. We do not attempt to copy these into $(srcdir).
182 -test -d po || mkdir po
183 $(GMSGFMT
) --statistics
-o
$@
$<
185 # The new .po has to be gone over by hand, so we deposit it into
186 # build/po with a different extension.
187 # If build/po/$(PACKAGE).pot exists, use it (it was just created),
188 # else use the one in srcdir.
190 -test -d po || mkdir po
191 $(MSGMERGE
) $< `if test -f po/$(PACKAGE).pot; \
192 then echo po/$(PACKAGE).pot; \
193 else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o
$@
195 # Rule for regenerating the message template.
196 po
/$(PACKAGE
).pot
: $(libcpp_a_SOURCES
)
197 -test -d
$(srcdir)/po || mkdir
$(srcdir)/po
198 $(XGETTEXT
) --default-domain
=$(PACKAGE
) \
199 --keyword
=cpp_error
,3 --keyword
=cpp_errno
,3 \
200 --keyword
=cpp_error_with_line
,5 \
201 --copyright-holder
="Free Software Foundation, Inc." \
202 --msgid-bugs-address
="http://gcc.gnu.org/bugs.html" \
203 --language
=c
-o po
/$(PACKAGE
).pot
$^
206 # Tell versions [3.59,3.63) of GNU make to not export all variables.
207 # Otherwise a system limit (for SysV at least) may be exceeded.
212 top_srcdir
= $(srcdir)/..
213 top_incdir
= $(srcdir)/..
/include
214 libcpp_incdir
= $(srcdir)/..
/libcpp
/include
216 COMMON_DEPS
= config.h
$(srcdir)/system.h
$(srcdir)/internal.h \
217 $(top_incdir
)/libiberty.h
$(top_incdir
)/ansidecl.h \
218 $(top_incdir
)/filenames.h
$(top_incdir
)/safe-ctype.h \
219 $(libcpp_incdir
)/symtab.h
$(top_incdir
)/obstack.h \
220 $(libcpp_incdir
)/line-map.h
$(libcpp_incdir
)/cpplib.h \
221 $(libcpp_incdir
)/cpp-id-data.h
$(top_incdir
)/getopt.h
223 charset.o
: $(srcdir)/charset.c
$(COMMON_DEPS
) $(srcdir)/ucnid.h
224 directives.o
: $(srcdir)/directives.c
$(COMMON_DEPS
) $(libcpp_incdir
)/mkdeps.h
225 errors.o
: $(srcdir)/errors.c
$(COMMON_DEPS
)
226 expr.o
: $(srcdir)/expr.c
$(COMMON_DEPS
)
228 files.o
: $(srcdir)/files.c
$(COMMON_DEPS
) $(libcpp_incdir
)/mkdeps.h \
229 $(top_incdir
)/hashtab.h
$(top_incdir
)/md5.h
231 identifiers.o
: $(srcdir)/identifiers.c
$(COMMON_DEPS
)
232 init.o
: $(srcdir)/init.c
$(COMMON_DEPS
) $(libcpp_incdir
)/mkdeps.h
233 lex.o
: $(srcdir)/lex.c
$(COMMON_DEPS
)
234 line-map.o
: $(srcdir)/line-map.c
$(COMMON_DEPS
)
235 macro.o
: $(srcdir)/macro.c
$(COMMON_DEPS
)
236 makedepend.o
: $(srcdir)/makedepend.c
$(COMMON_DEPS
)
237 mkdeps.o
: $(srcdir)/mkdeps.c
$(COMMON_DEPS
)
239 pch.o
: $(srcdir)/pch.c
$(COMMON_DEPS
) \
240 $(top_incdir
)/hashtab.h
$(libcpp_incdir
)/mkdeps.h
242 symtab.o
: $(srcdir)/symtab.c
$(COMMON_DEPS
)
243 traditional.o
: $(srcdir)/traditional.c
$(COMMON_DEPS
)