• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Makefile for the gettext-tools/libgettextpo subdirectory of GNU gettext
2## Copyright (C) 1995-1998, 2000-2016, 2019-2020 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 <https://www.gnu.org/licenses/>.
16
17## Process this file with automake to produce Makefile.in.
18
19AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies subdir-objects
20EXTRA_DIST =
21BUILT_SOURCES =
22MOSTLYCLEANFILES = core *.stackdump
23MOSTLYCLEANDIRS =
24CLEANFILES =
25DISTCLEANFILES =
26MAINTAINERCLEANFILES =
27SUFFIXES =
28
29lib_LTLIBRARIES = libgettextpo.la
30
31nodist_include_HEADERS = gettext-po.h
32
33noinst_LTLIBRARIES =
34
35nodist_noinst_HEADERS = config.h
36
37AM_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
43DEFS = -DIN_LIBGETTEXTPO=1 -DOMIT_SETLOCALE_LOCK=1 @DEFS@
44
45# libgettextpo contains the public API for PO files.
46libgettextpo_la_SOURCES = \
47  gettext-po.c \
48  $(libgettextpo_la_AUXSOURCES)
49# These are auxiliary sources whose symbols should not be exported.
50libgettextpo_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-python.c \
69  ../src/format-python-brace.c \
70  ../src/format-java.c \
71  ../src/format-java-printf.c \
72  ../src/format-csharp.c \
73  ../src/format-javascript.c \
74  ../src/format-scheme.c \
75  ../src/format-lisp.c \
76  ../src/format-elisp.c \
77  ../src/format-librep.c \
78  ../src/format-ruby.c \
79  ../src/format-sh.c \
80  ../src/format-awk.c \
81  ../src/format-lua.c \
82  ../src/format-pascal.c \
83  ../src/format-smalltalk.c \
84  ../src/format-qt.c \
85  ../src/format-qt-plural.c \
86  ../src/format-kde.c \
87  ../src/format-kde-kuit.c \
88  ../src/format-boost.c \
89  ../src/format-tcl.c \
90  ../src/format-perl.c \
91  ../src/format-perl-brace.c \
92  ../src/format-php.c \
93  ../src/format-gcc-internal.c \
94  ../src/format-gfc-internal.c \
95  ../src/format.c \
96  ../src/plural-exp.c \
97  ../src/plural-eval.c \
98  ../src/msgl-check.c \
99  ../src/sentence.c
100
101# Libtool's library version information for libgettextpo.
102# See the libtool documentation, section "Library interface versions".
103LTV_CURRENT=5
104LTV_REVISION=7
105LTV_AGE=5
106
107# How to build libgettextpo.la.
108# Don't make it depend on libgettextsrc.la or libgettextlib.la, since they
109# define an uncontrolled amount of symbols.
110libgettextpo_la_LIBADD = libgnu.la $(WOE32_LIBADD) $(LTLIBUNISTRING)
111libgettextpo_la_LDFLAGS = \
112  -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
113  -rpath $(libdir) \
114  @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
115
116# Tell the mingw or Cygwin linker which symbols to export.
117if WOE32DLL
118libgettextpo_la_SOURCES += ../woe32dll/gettextpo-exports.c
119libgettextpo_la_LDFLAGS += -Wl,--export-all-symbols
120endif
121
122# OS/2 does not support a DLL name longer than 8 characters.
123if OS2
124libgettextpo_la_LDFLAGS += -os2dllname gtpo
125endif
126
127# Specify installation directory, for --enable-relocatable.
128if RELOCATABLE_VIA_LD
129# This is needed, because libgettextpo depends on libintl.
130libgettextpo_la_LDFLAGS += `$(RELOCATABLE_LDFLAGS) $(libdir)`
131endif
132
133# Support for relocatability.
134RELOCATABLE_LIBRARY_PATH = $(libdir)
135
136# Version information according to Woe32 conventions.
137EXTRA_DIST += libgettextpo.rc
138if WOE32
139WOE32_LIBADD = libgettextpo.res.lo
140libgettextpo.res.lo : $(srcdir)/libgettextpo.rc
141	$(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
142MOSTLYCLEANFILES += libgettextpo.res.lo
143else
144WOE32_LIBADD =
145endif
146
147# Hide symbols that are defined by libgettextpo_la_AUXSOURCES or libgnu.la
148# from the global namespace, by prefixing them with "libgettextpo_".
149all check install: config.h
150config.h: $(BUILT_SOURCES)
151	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
152	  : "Avoid double inclusion, to avoid a warning about redefinition of DLL_VARIABLE."; \
153	  echo '#ifndef GTPO_CONFIG_H'; \
154	  echo '#define GTPO_CONFIG_H'; \
155	  echo; \
156	  echo '#include "../config.h"'; \
157	  : "Turn all gettext() calls into dgettext() calls."; \
158	  echo '#define DEFAULT_TEXT_DOMAIN "gettext-tools"'; \
159	  : "All code is collected in a single library,"; \
160	  : "No references to variables in other libraries exist."; \
161	  echo '#undef DLL_VARIABLE'; \
162	  echo '#define DLL_VARIABLE'; \
163	  echo; \
164	  echo '#endif /* GTPO_CONFIG_H */'; \
165	} > config.h && \
166	if test -n "$(HAVE_GLOBAL_SYMBOL_PIPE)"; then \
167	  { \
168	    for f in $(libgettextpo_la_AUXSOURCES) $(libgnu_la_SOURCES) $(libgnu_la_LIBADD); do \
169	      case $$f in \
170	        *.c | *.$(OBJEXT) | *.lo ) \
171	          sf=`echo "$$f" | sed -e 's,\\.[^.]*$$,,'`.c; \
172	          test -f $$sf || sf=$(srcdir)/$$sf; \
173	          of=`echo "$$f" | sed -e 's,^.*/,,' -e 's,\\.[^.]*$$,,'`.$(OBJEXT); \
174	          $(COMPILE) $(DEFS) -c $$sf || { rm -f config.h; exit 1; }; \
175	          sh ./exported.sh $$of 1>&5; \
176	          rm -f $$of `echo "$$of" | sed -e 's,\\.$(OBJEXT)$$,.lo,'`; \
177	          ;; \
178	      esac; \
179	    done; \
180	  } 5>&1 1>&2 \
181	    | sed -e 's,.* ,,' | grep -v '@' | LC_ALL=C sort | LC_ALL=C uniq \
182	    | sed -e 's,^obstack_free$$,__obstack_free,' \
183	    | sed -e 's,^\(.*\)$$,#define \1 libgettextpo_\1,' > config.h-t && \
184	  if test -f config.h; then \
185	    cat config.h-t >> config.h; \
186	    rm -f config.h-t; \
187	  else \
188	    rm -f config.h-t; \
189	    exit 1; \
190	  fi \
191	fi
192MOSTLYCLEANFILES += config.h config.h-t
193
194# Special rules for installable include files that export variables.
195
196EXTRA_DIST += gettext-po.in.h
197BUILT_SOURCES += gettext-po.h
198CLEANFILES += gettext-po.h
199gettext-po.h: gettext-po.in.h
200if WOE32DLL
201	sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/' $(srcdir)/gettext-po.in.h > gettext-po.h-tmp
202else
203	cp $(srcdir)/gettext-po.in.h gettext-po.h-tmp
204endif
205	mv gettext-po.h-tmp gettext-po.h
206
207# Allow users to use "gnulib-tool --update".
208EXTRA_DIST += gnulib-m4/gnulib-cache.m4
209
210# A small set of gnulib modules is needed here as well.
211include Makefile.gnulib
212