1## Makefile for the gettext-tools/libgettextpo subdirectory of GNU gettext
2## Copyright (C) 1995-1998, 2000-2006 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 2, or (at your option)
7## 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, write to the Free Software Foundation,
16## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18## Process this file with automake to produce Makefile.in.
19
20AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies
21EXTRA_DIST =
22BUILT_SOURCES =
23MOSTLYCLEANFILES = core *.stackdump
24CLEANFILES =
25DISTCLEANFILES =
26SUFFIXES =
27
28lib_LTLIBRARIES = libgettextpo.la
29
30nodist_include_HEADERS = gettext-po.h
31
32noinst_LTLIBRARIES =
33
34nodist_noinst_HEADERS = config.h
35
36AM_CPPFLAGS = \
37  -I. -I$(srcdir) \
38  -I.. -I$(top_srcdir) \
39  -I../src -I$(top_srcdir)/src \
40  -I../intl -I$(top_srcdir)/../gettext-runtime/intl
41
42# libgettextpo contains the public API for PO files.
43libgettextpo_la_SOURCES = \
44  gettext-po.c \
45  $(libgettextpo_la_AUXSOURCES)
46# These are auxiliary sources whose symbols should not be exported.
47libgettextpo_la_AUXSOURCES = \
48  ../src/str-list.c \
49  ../src/dir-list.c \
50  ../src/message.c \
51  ../src/msgl-ascii.c \
52  ../src/po-error.c \
53  ../src/po-xerror.c \
54  ../src/write-catalog.c \
55  ../src/write-po.c \
56  ../src/open-catalog.c \
57  ../src/po-charset.c \
58  ../src/po-lex.c \
59  ../src/po-gram-gen.c \
60  ../src/read-po.c \
61  ../src/read-catalog-abstract.c \
62  ../src/read-catalog.c \
63  ../src/plural-table.c \
64  ../src/format-c.c \
65  ../src/format-sh.c \
66  ../src/format-python.c \
67  ../src/format-lisp.c \
68  ../src/format-elisp.c \
69  ../src/format-librep.c \
70  ../src/format-scheme.c \
71  ../src/format-java.c \
72  ../src/format-csharp.c \
73  ../src/format-awk.c \
74  ../src/format-pascal.c \
75  ../src/format-ycp.c \
76  ../src/format-tcl.c \
77  ../src/format-perl.c \
78  ../src/format-perl-brace.c \
79  ../src/format-php.c \
80  ../src/format-gcc-internal.c \
81  ../src/format-qt.c \
82  ../src/format-boost.c \
83  ../src/format.c \
84  ../src/plural-exp.c \
85  ../src/plural-eval.c \
86  ../src/msgl-check.c
87
88# Libtool's library version information for libgettextpo.
89# See the libtool documentation, section "Library interface versions".
90LTV_CURRENT=3
91LTV_REVISION=0
92LTV_AGE=3
93
94# How to build libgettextpo.la.
95# Don't make it depend on libgettextsrc.la or libgettextlib.la, since they
96# define an uncontrolled amount of symbols.
97libgettextpo_la_LIBADD = libgnu.la
98libgettextpo_la_LDFLAGS = \
99  -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
100  -rpath $(libdir) \
101  @LTLIBINTL@ @LTLIBICONV@ -lc @LTNOUNDEF@
102
103# Tell the mingw or Cygwin linker which symbols to export.
104if WOE32DLL
105libgettextpo_la_SOURCES += ../woe32dll/gettextpo-exports.c
106libgettextpo_la_LDFLAGS += -Wl,--export-all-symbols
107endif
108
109# Hide symbols that are defined by libgettextpo_la_AUXSOURCES or libgnu.la
110# from the global namespace, by prefixing them with "libgettextpo_".
111all check install: config.h
112config.h: $(BUILT_SOURCES)
113	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
114	  : "Avoid double inclusion, to avoid a warning about redefinition of DLL_VARIABLE."; \
115	  echo '#ifndef GTPO_CONFIG_H'; \
116	  echo '#define GTPO_CONFIG_H'; \
117	  echo; \
118	  echo '#include "../config.h"'; \
119	  : "Turn all gettext() calls into dgettext() calls."; \
120	  echo '#define DEFAULT_TEXT_DOMAIN "gettext-tools"'; \
121	  : "All code is collected in a single library,"; \
122	  : "No references to variables in other libraries exist."; \
123	  echo '#undef DLL_VARIABLE'; \
124	  echo '#define DLL_VARIABLE'; \
125	  echo; \
126	  echo '#endif /* GTPO_CONFIG_H */'; \
127	} > config.h && \
128	if test -n "$(HAVE_GLOBAL_SYMBOL_PIPE)"; then \
129	  { \
130	    for f in $(libgettextpo_la_AUXSOURCES) $(libgnu_la_SOURCES) $(libgnu_la_LIBADD); do \
131	      case $$f in \
132	        *.c | *.$(OBJEXT) | *.lo ) \
133	          sf=`echo "$$f" | sed -e 's,\\.[^.]*$$,,'`.c; \
134	          of=`echo "$$f" | sed -e 's,^.*/,,' -e 's,\\.[^.]*$$,,'`.$(OBJEXT); \
135	          $(COMPILE) -c $(srcdir)/$$sf || { rm -f config.h; exit 1; }; \
136	          sh ./exported.sh $$of 1>&5; \
137	          rm -f $$of; \
138	          ;; \
139	      esac; \
140	    done; \
141	  } 5>&1 \
142	    | sed -e 's,.* ,,' | LC_ALL=C sort | LC_ALL=C uniq \
143	    | sed -e 's,^obstack_free$$,__obstack_free,' \
144	    | sed -e 's,^\(.*\)$$,#define \1 libgettextpo_\1,' > config.h-t && \
145	  if test -f config.h; then \
146	    cat config.h-t >> config.h; \
147	    rm -f config.h-t; \
148	  else \
149	    rm -f config.h-t; \
150	    exit 1; \
151	  fi \
152	fi
153MOSTLYCLEANFILES += config.h config.h-t
154
155# Special rules for installable include files that export variables.
156
157EXTRA_DIST += gettext-po.h.in
158BUILT_SOURCES += gettext-po.h
159CLEANFILES += gettext-po.h
160gettext-po.h: gettext-po.h.in
161if WOE32DLL
162	sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/' $(srcdir)/gettext-po.h.in > gettext-po.h-tmp
163else
164	cp $(srcdir)/gettext-po.h.in gettext-po.h-tmp
165endif
166	mv gettext-po.h-tmp gettext-po.h
167
168# A small set of gnulib modules is needed here as well.
169include Makefile.gnulib
170