OSDN Git Service

* Fix for g++/15861
[pf3gnuchains/gcc-fork.git] / libcpp / Makefile.am
1 localedir = $(datadir)/locale
2 ACLOCAL_AMFLAGS = -I ../config
3 AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir) @INCINTL@ \
4         -I$(srcdir)/include -DLOCALEDIR="\"$(localedir)\""
5
6 noinst_LIBRARIES = libcpp.a
7 libcpp_a_SOURCES = \
8         charset.c directives.c errors.c expr.c files.c \
9         identifiers.c init.c lex.c line-map.c macro.c mkdeps.c \
10         pch.c symtab.c traditional.c
11
12 noinst_HEADERS = \
13         include/cpplib.h include/line-map.h include/mkdeps.h \
14         include/symtab.h internal.h system.h ucnid.h
15
16 LIBINTL = @LIBINTL@
17 LIBICONV = @LIBICONV@
18 noinst_PROGRAMS = makedepend
19 makedepend_LDADD = libcpp.a ../libiberty/libiberty.a $(LIBINTL) $(LIBICONV)
20
21 XGETTEXT = @XGETTEXT@
22 GMSGFMT = @GMSGFMT@
23 MSGMERGE = msgmerge
24 CATALOGS = @CATALOGS@
25
26 all-local: build-po
27
28 if ENABLE_NLS
29 build-po: $(CATALOGS)
30 update-po: $(CATALOGS:.gmo=.pox)
31 else
32 build-po:
33 update-po:
34 endif
35
36 # N.B. We do not attempt to copy these into $(srcdir).
37 .po.gmo:
38         -test -d po || mkdir po
39         $(GMSGFMT) --statistics -o $@ $<
40
41 # The new .po has to be gone over by hand, so we deposit it into
42 # build/po with a different extension.
43 # If build/po/$(PACKAGE).pot exists, use it (it was just created),
44 # else use the one in srcdir.
45 .po.pox:
46         -test -d po || mkdir po
47         $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \
48                         then echo po/$(PACKAGE).pot; \
49                         else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
50
51 # This rule has to look for .gmo modules in both srcdir and
52 # the cwd, and has to check that we actually have a catalog
53 # for each language, in case they weren't built or included
54 # with the distribution.
55 install-data-local:
56         $(mkinstalldirs) $(DESTDIR)$(datadir)
57         cats="$(CATALOGS)"; for cat in $$cats; do \
58           lang=`basename $$cat | sed 's/\.gmo$$//'`; \
59           if [ -f $$cat ]; then :; \
60           elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
61           else continue; \
62           fi; \
63           dir=$(localedir)/$$lang/LC_MESSAGES; \
64           echo $(mkinstalldirs) $(DESTDIR)$$dir; \
65           $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
66           echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
67           $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
68         done
69
70 # Rule for regenerating the message template (gcc.pot).
71 # Instead of forcing everyone to edit POTFILES.in, which proved impractical,
72 # this rule has no dependencies and always regenerates libcpp.pot.  This is
73 # relatively harmless since the .po files do not directly depend on it.
74 .PHONY: po/$(PACKAGE).pot
75 po/$(PACKAGE).pot: $(libcpp_a_SOURCES) $(noinst_HEADERS)
76         -test -d $(srcdir)/po || mkdir $(srcdir)/po
77         $(XGETTEXT) --default-domain=$(PACKAGE) \
78           --keyword=cpp_error,3 --keyword=cpp_errno,3 \
79           --keyword=cpp_error_with_line,5 \
80           --copyright-holder="Free Software Foundation, Inc." \
81           --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
82           --language=c -o po/$(PACKAGE).pot $^