Imported Upstream version 0.19.8.1
[platform/upstream/gettext.git] / gettext-tools / libgettextpo / Makefile.am
1 ## Makefile for the gettext-tools/libgettextpo subdirectory of GNU gettext
2 ## Copyright (C) 1995-1998, 2000-2011, 2015-2016 Free Software Foundation, Inc.
3 ##
4 ## This program is free software: you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 3 of the License, or
7 ## (at your option) any later version.
8 ##
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ## GNU General Public License for more details.
13 ##
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 ## Process this file with automake to produce Makefile.in.
18
19 AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies subdir-objects
20 EXTRA_DIST =
21 BUILT_SOURCES =
22 MOSTLYCLEANFILES = core *.stackdump
23 MOSTLYCLEANDIRS =
24 CLEANFILES =
25 DISTCLEANFILES =
26 MAINTAINERCLEANFILES =
27 SUFFIXES =
28
29 lib_LTLIBRARIES = libgettextpo.la
30
31 nodist_include_HEADERS = gettext-po.h
32
33 noinst_LTLIBRARIES =
34
35 nodist_noinst_HEADERS = config.h
36
37 AM_CPPFLAGS = \
38   -I. -I$(srcdir) \
39   -I.. -I$(top_srcdir) \
40   -I../src -I$(top_srcdir)/src \
41   -I../intl -I$(top_srcdir)/../gettext-runtime/intl
42
43 DEFS = -DIN_LIBGETTEXTPO=1 @DEFS@
44
45 # libgettextpo contains the public API for PO files.
46 libgettextpo_la_SOURCES = \
47   gettext-po.c \
48   $(libgettextpo_la_AUXSOURCES)
49 # These are auxiliary sources whose symbols should not be exported.
50 libgettextpo_la_AUXSOURCES = \
51   ../src/str-list.c \
52   ../src/dir-list.c \
53   ../src/message.c \
54   ../src/msgl-ascii.c \
55   ../src/po-error.c \
56   ../src/po-xerror.c \
57   ../src/write-catalog.c \
58   ../src/write-po.c \
59   ../src/open-catalog.c \
60   ../src/po-charset.c \
61   ../src/po-lex.c \
62   ../src/po-gram-gen.c \
63   ../src/read-po.c \
64   ../src/read-catalog-abstract.c \
65   ../src/read-catalog.c \
66   ../src/plural-table.c \
67   ../src/format-c.c \
68   ../src/format-sh.c \
69   ../src/format-python.c \
70   ../src/format-python-brace.c \
71   ../src/format-lisp.c \
72   ../src/format-elisp.c \
73   ../src/format-librep.c \
74   ../src/format-scheme.c \
75   ../src/format-java.c \
76   ../src/format-javascript.c \
77   ../src/format-csharp.c \
78   ../src/format-awk.c \
79   ../src/format-pascal.c \
80   ../src/format-ycp.c \
81   ../src/format-tcl.c \
82   ../src/format-perl.c \
83   ../src/format-perl-brace.c \
84   ../src/format-php.c \
85   ../src/format-gcc-internal.c \
86   ../src/format-gfc-internal.c \
87   ../src/format-qt.c \
88   ../src/format-qt-plural.c \
89   ../src/format-kde.c \
90   ../src/format-kde-kuit.c \
91   ../src/format-boost.c \
92   ../src/format-lua.c \
93   ../src/format.c \
94   ../src/plural-exp.c \
95   ../src/plural-eval.c \
96   ../src/msgl-check.c \
97   ../src/sentence.c
98
99 # Libtool's library version information for libgettextpo.
100 # See the libtool documentation, section "Library interface versions".
101 LTV_CURRENT=5
102 LTV_REVISION=4
103 LTV_AGE=5
104
105 # How to build libgettextpo.la.
106 # Don't make it depend on libgettextsrc.la or libgettextlib.la, since they
107 # define an uncontrolled amount of symbols.
108 libgettextpo_la_LIBADD = libgnu.la $(WOE32_LIBADD) $(LTLIBUNISTRING)
109 libgettextpo_la_LDFLAGS = \
110   -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
111   -rpath $(libdir) \
112   @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
113
114 # Tell the mingw or Cygwin linker which symbols to export.
115 if WOE32DLL
116 libgettextpo_la_SOURCES += ../woe32dll/gettextpo-exports.c
117 libgettextpo_la_LDFLAGS += -Wl,--export-all-symbols
118 endif
119
120 # OS/2 does not support a DLL name longer than 8 characters.
121 if OS2
122 libgettextpo_la_LDFLAGS += -os2dllname gtpo
123 endif
124
125 # Version information according to Woe32 conventions.
126 EXTRA_DIST += libgettextpo.rc
127 if WOE32
128 WOE32_LIBADD = libgettextpo.res.lo
129 libgettextpo.res.lo : $(srcdir)/libgettextpo.rc
130         $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) `$(SHELL) $(top_srcdir)/../windows/windres-options --escape $(VERSION)` -i $(srcdir)/libgettextpo.rc -o libgettextpo.res.lo --output-format=coff
131 MOSTLYCLEANFILES += libgettextpo.res.lo
132 else
133 WOE32_LIBADD =
134 endif
135
136 # Hide symbols that are defined by libgettextpo_la_AUXSOURCES or libgnu.la
137 # from the global namespace, by prefixing them with "libgettextpo_".
138 all check install: config.h
139 config.h: $(BUILT_SOURCES)
140         { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
141           : "Avoid double inclusion, to avoid a warning about redefinition of DLL_VARIABLE."; \
142           echo '#ifndef GTPO_CONFIG_H'; \
143           echo '#define GTPO_CONFIG_H'; \
144           echo; \
145           echo '#include "../config.h"'; \
146           : "Turn all gettext() calls into dgettext() calls."; \
147           echo '#define DEFAULT_TEXT_DOMAIN "gettext-tools"'; \
148           : "All code is collected in a single library,"; \
149           : "No references to variables in other libraries exist."; \
150           echo '#undef DLL_VARIABLE'; \
151           echo '#define DLL_VARIABLE'; \
152           echo; \
153           echo '#endif /* GTPO_CONFIG_H */'; \
154         } > config.h && \
155         if test -n "$(HAVE_GLOBAL_SYMBOL_PIPE)"; then \
156           { \
157             for f in $(libgettextpo_la_AUXSOURCES) $(libgnu_la_SOURCES) $(libgnu_la_LIBADD); do \
158               case $$f in \
159                 *.c | *.$(OBJEXT) | *.lo ) \
160                   sf=`echo "$$f" | sed -e 's,\\.[^.]*$$,,'`.c; \
161                   test -f $$sf || sf=$(srcdir)/$$sf; \
162                   of=`echo "$$f" | sed -e 's,^.*/,,' -e 's,\\.[^.]*$$,,'`.$(OBJEXT); \
163                   $(COMPILE) $(DEFS) -c $$sf || { rm -f config.h; exit 1; }; \
164                   sh ./exported.sh $$of 1>&5; \
165                   rm -f $$of `echo "$$of" | sed -e 's,\\.$(OBJEXT)$$,.lo,'`; \
166                   ;; \
167               esac; \
168             done; \
169           } 5>&1 \
170             | sed -e 's,.* ,,' | LC_ALL=C sort | LC_ALL=C uniq \
171             | sed -e 's,^obstack_free$$,__obstack_free,' \
172             | sed -e 's,^\(.*\)$$,#define \1 libgettextpo_\1,' > config.h-t && \
173           if test -f config.h; then \
174             cat config.h-t >> config.h; \
175             rm -f config.h-t; \
176           else \
177             rm -f config.h-t; \
178             exit 1; \
179           fi \
180         fi
181 MOSTLYCLEANFILES += config.h config.h-t
182
183 # Special rules for installable include files that export variables.
184
185 EXTRA_DIST += gettext-po.in.h
186 BUILT_SOURCES += gettext-po.h
187 CLEANFILES += gettext-po.h
188 gettext-po.h: gettext-po.in.h
189 if WOE32DLL
190         sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/' $(srcdir)/gettext-po.in.h > gettext-po.h-tmp
191 else
192         cp $(srcdir)/gettext-po.in.h gettext-po.h-tmp
193 endif
194         mv gettext-po.h-tmp gettext-po.h
195
196 # Allow users to use "gnulib-tool --update".
197 EXTRA_DIST += gnulib-m4/gnulib-cache.m4
198
199 # A small set of gnulib modules is needed here as well.
200 include Makefile.gnulib