1 ## Makefile for the gettext-tools/libgettextpo subdirectory of GNU gettext
2 ## Copyright (C) 1995-1998, 2000-2011, 2015-2016 Free Software Foundation, Inc.
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.
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.
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/>.
17 ## Process this file with automake to produce Makefile.in.
19 AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies subdir-objects
22 MOSTLYCLEANFILES = core *.stackdump
26 MAINTAINERCLEANFILES =
29 lib_LTLIBRARIES = libgettextpo.la
31 nodist_include_HEADERS = gettext-po.h
35 nodist_noinst_HEADERS = config.h
39 -I.. -I$(top_srcdir) \
40 -I../src -I$(top_srcdir)/src \
41 -I../intl -I$(top_srcdir)/../gettext-runtime/intl
43 DEFS = -DIN_LIBGETTEXTPO=1 @DEFS@
45 # libgettextpo contains the public API for PO files.
46 libgettextpo_la_SOURCES = \
48 $(libgettextpo_la_AUXSOURCES)
49 # These are auxiliary sources whose symbols should not be exported.
50 libgettextpo_la_AUXSOURCES = \
57 ../src/write-catalog.c \
59 ../src/open-catalog.c \
62 ../src/po-gram-gen.c \
64 ../src/read-catalog-abstract.c \
65 ../src/read-catalog.c \
66 ../src/plural-table.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 \
79 ../src/format-pascal.c \
82 ../src/format-perl.c \
83 ../src/format-perl-brace.c \
85 ../src/format-gcc-internal.c \
86 ../src/format-gfc-internal.c \
88 ../src/format-qt-plural.c \
90 ../src/format-kde-kuit.c \
91 ../src/format-boost.c \
95 ../src/plural-eval.c \
99 # Libtool's library version information for libgettextpo.
100 # See the libtool documentation, section "Library interface versions".
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) \
112 @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
114 # Tell the mingw or Cygwin linker which symbols to export.
116 libgettextpo_la_SOURCES += ../woe32dll/gettextpo-exports.c
117 libgettextpo_la_LDFLAGS += -Wl,--export-all-symbols
120 # OS/2 does not support a DLL name longer than 8 characters.
122 libgettextpo_la_LDFLAGS += -os2dllname gtpo
125 # Version information according to Woe32 conventions.
126 EXTRA_DIST += libgettextpo.rc
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
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'; \
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'; \
153 echo '#endif /* GTPO_CONFIG_H */'; \
155 if test -n "$(HAVE_GLOBAL_SYMBOL_PIPE)"; then \
157 for f in $(libgettextpo_la_AUXSOURCES) $(libgnu_la_SOURCES) $(libgnu_la_LIBADD); do \
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,'`; \
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; \
181 MOSTLYCLEANFILES += config.h config.h-t
183 # Special rules for installable include files that export variables.
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
190 sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/' $(srcdir)/gettext-po.in.h > gettext-po.h-tmp
192 cp $(srcdir)/gettext-po.in.h gettext-po.h-tmp
194 mv gettext-po.h-tmp gettext-po.h
196 # Allow users to use "gnulib-tool --update".
197 EXTRA_DIST += gnulib-m4/gnulib-cache.m4
199 # A small set of gnulib modules is needed here as well.
200 include Makefile.gnulib