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