1 ## Makefile for the gettext-tools/libgettextpo subdirectory of GNU gettext
2 ## Copyright (C) 1995-1998, 2000-2011, 2015 Free Software Foundation,
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.
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.
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/>.
18 ## Process this file with automake to produce Makefile.in.
20 AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies subdir-objects
23 MOSTLYCLEANFILES = core *.stackdump
27 MAINTAINERCLEANFILES =
30 lib_LTLIBRARIES = libgettextpo.la
32 nodist_include_HEADERS = gettext-po.h
36 nodist_noinst_HEADERS = config.h
40 -I.. -I$(top_srcdir) \
41 -I../src -I$(top_srcdir)/src \
42 -I../intl -I$(top_srcdir)/../gettext-runtime/intl
44 DEFS = -DIN_LIBGETTEXTPO=1 @DEFS@
46 # libgettextpo contains the public API for PO files.
47 libgettextpo_la_SOURCES = \
49 $(libgettextpo_la_AUXSOURCES)
50 # These are auxiliary sources whose symbols should not be exported.
51 libgettextpo_la_AUXSOURCES = \
58 ../src/write-catalog.c \
60 ../src/open-catalog.c \
63 ../src/po-gram-gen.c \
65 ../src/read-catalog-abstract.c \
66 ../src/read-catalog.c \
67 ../src/plural-table.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 \
80 ../src/format-pascal.c \
83 ../src/format-perl.c \
84 ../src/format-perl-brace.c \
86 ../src/format-gcc-internal.c \
87 ../src/format-gfc-internal.c \
89 ../src/format-qt-plural.c \
91 ../src/format-kde-kuit.c \
92 ../src/format-boost.c \
96 ../src/plural-eval.c \
100 # Libtool's library version information for libgettextpo.
101 # See the libtool documentation, section "Library interface versions".
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) \
113 @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
115 # Tell the mingw or Cygwin linker which symbols to export.
117 libgettextpo_la_SOURCES += ../woe32dll/gettextpo-exports.c
118 libgettextpo_la_LDFLAGS += -Wl,--export-all-symbols
121 # Version information according to Woe32 conventions.
122 EXTRA_DIST += libgettextpo.rc
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
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'; \
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'; \
149 echo '#endif /* GTPO_CONFIG_H */'; \
151 if test -n "$(HAVE_GLOBAL_SYMBOL_PIPE)"; then \
153 for f in $(libgettextpo_la_AUXSOURCES) $(libgnu_la_SOURCES) $(libgnu_la_LIBADD); do \
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,'`; \
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; \
177 MOSTLYCLEANFILES += config.h config.h-t
179 # Special rules for installable include files that export variables.
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
186 sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/' $(srcdir)/gettext-po.in.h > gettext-po.h-tmp
188 cp $(srcdir)/gettext-po.in.h gettext-po.h-tmp
190 mv gettext-po.h-tmp gettext-po.h
192 # Allow users to use "gnulib-tool --update".
193 EXTRA_DIST += gnulib-m4/gnulib-cache.m4
195 # A small set of gnulib modules is needed here as well.
196 include Makefile.gnulib