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