xref: /netbsd-src/external/gpl2/gettext/dist/gettext-runtime/libasprintf/Makefile.am (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1## Makefile for the gettext-runtime/libasprintf subdirectory of GNU gettext
2## Copyright (C) 2002-2006 Free Software Foundation, Inc.
3##
4## This program is free software; you can redistribute it and/or modify it
5## under the terms of the GNU Library General Public License as published
6## by 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 GNU
12## Library General Public License for more details.
13##
14## You should have received a copy of the GNU Library General Public
15## License along with this program; if not, write to the Free Software
16## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17## USA.
18
19## Process this file with automake to produce Makefile.in.
20
21AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies
22ACLOCAL_AMFLAGS = -I ../../m4 -I ../m4
23EXTRA_DIST =
24MOSTLYCLEANFILES =
25
26RM = rm -f
27
28
29# Library include file.
30
31include_HEADERS = autosprintf.h
32
33all-local $(libasprintf_la_OBJECTS): autosprintf.h
34autosprintf.h: autosprintf.h.in
35	cp $(srcdir)/autosprintf.h.in autosprintf.h
36MOSTLYCLEANFILES += autosprintf.h
37EXTRA_DIST += autosprintf.h.in
38
39dist-hook:
40	rm -f $(distdir)/autosprintf.h
41
42
43# Library code.
44
45lib_LTLIBRARIES = libasprintf.la
46
47libasprintf_la_SOURCES = \
48  lib-asprintf.h lib-asprintf.c \
49  autosprintf.h autosprintf.cc
50
51# Sources used only on platforms lacking vasprintf().
52lib_asprintf_EXTRASOURCES = \
53  xsize.h \
54  printf-args.h printf-args.c \
55  printf-parse.h printf-parse.c \
56  vasnprintf.h vasnprintf.c asnprintf.c \
57  vasprintf.h vasprintf.c asprintf.c
58lib-asprintf.lo: $(lib_asprintf_EXTRASOURCES)
59EXTRA_DIST += $(lib_asprintf_EXTRASOURCES)
60
61
62# How to build libasprintf.
63# With libtool 1.5.14, on some platforms, like BeOS, "libtool --tag=CXX" fails
64# to create a shared library, however "libtool --tag=CC" succeeds.
65libasprintf_la_LDFLAGS = @LTNOUNDEF@
66libasprintf.la: $(libasprintf_la_OBJECTS) $(libasprintf_la_DEPENDENCIES)
67	$(CXXLINK) -rpath $(libdir) $(libasprintf_la_LDFLAGS) $(libasprintf_la_OBJECTS) $(libasprintf_la_LIBADD) $(LIBS) || \
68	$(LINK) -rpath $(libdir) $(libasprintf_la_LDFLAGS) $(libasprintf_la_OBJECTS) $(libasprintf_la_LIBADD) $(LIBS)
69
70
71# >>> gnulib module alloca.
72EXTRA_DIST += alloca_.h
73
74# The following is needed in order to create an <alloca.h> when the system
75# doesn't have one that works with the given compiler.
76all-local $(libasprintf_la_OBJECTS): @ALLOCA_H@
77alloca.h: alloca_.h
78	cp $(srcdir)/alloca_.h alloca.h
79MOSTLYCLEANFILES += alloca.h
80# <<< gnulib module alloca.
81
82
83# Clean up after Solaris cc.
84clean-local:
85	rm -rf SunWS_cache
86
87
88# Documentation.
89
90MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
91MAKEINFOFLAGS = --no-split
92
93info_TEXINFOS = autosprintf.texi
94
95# We distribute only the HTML documentation.
96# The user can generate the others, via
97#   make autosprintf.ps
98#   make autosprintf.pdf
99
100all-local: html-local
101install-data-local: install-html
102installdirs-local: installdirs-html
103uninstall-local: uninstall-html
104
105CLEANFILES = autosprintf.pdf
106# autosprintf.dvi and autosprintf.ps are already known to automake.
107
108
109# Documentation in DVI format.
110
111# The install-dvi target is already defined by automake.
112
113installdirs-dvi:
114	$(mkdir_p) $(DESTDIR)$(dvidir)
115
116uninstall-dvi:
117	$(RM) $(DESTDIR)$(dvidir)/autosprintf.dvi
118
119# Temporary index files. automake removes only the predefined ones by itself.
120MOSTLYCLEANFILES +=
121
122
123# Documentation in Postscript format.
124
125# Override of automake's definition:
126#DVIPS = @DVIPS@
127DVIPS = @DVIPS@ -D600
128
129autosprintf.ps: autosprintf.dvi
130	$(DVIPS) -o $@ `if test -f autosprintf.dvi; then echo autosprintf.dvi; else echo $(srcdir)/autosprintf.dvi; fi`
131
132# The install-ps target is already defined by automake.
133
134installdirs-ps:
135	$(mkdir_p) $(DESTDIR)$(psdir)
136
137uninstall-ps:
138	$(RM) $(DESTDIR)$(psdir)/autosprintf.ps
139
140
141# Documentation in Portable Document Format.
142
143SUFFIXES = .pdf
144
145# The install-pdf target is already defined by automake.
146
147installdirs-pdf:
148	$(mkdir_p) $(DESTDIR)$(pdfdir)
149
150uninstall-pdf:
151	$(RM) $(DESTDIR)$(pdfdir)/autosprintf.pdf
152
153
154# Documentation in HTML format.
155
156TEXI2HTML = @PERL@ $(srcdir)/texi2html
157
158HTMLS = autosprintf_all.html
159
160html-local: $(HTMLS)
161
162# Override of automake's definition.
163# We want to use texi2html, not makeinfo --html.
164autosprintf_all.html: autosprintf.texi
165	$(TEXI2HTML) -expandinfo -number -monolithic `if test -f autosprintf.texi; then echo autosprintf.texi; else echo $(srcdir)/autosprintf.texi; fi`
166	mv autosprintf.html autosprintf_all.html
167
168# The install-html target is already defined by automake.
169
170installdirs-html:
171	$(mkdir_p) $(DESTDIR)$(htmldir)
172
173uninstall-html:
174	$(RM) $(DESTDIR)$(htmldir)/autosprintf.html
175
176EXTRA_DIST += texi2html autosprintf_all.html
177
178
179# Woe32 support.
180
181EXTRA_DIST += README.woe32
182