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