1
## Makefile for the gettext-runtime/libasprintf subdirectory of GNU gettext
2
## Copyright (C) 2002-2004 Free Software Foundation, Inc.
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)
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19
## Process this file with automake to produce Makefile.in.
21
AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies
22
ACLOCAL_AMFLAGS = -I ../../config/m4 -I ../m4
27
# Library include file.
29
include_HEADERS = autosprintf.h
31
all-local $(libasprintf_la_OBJECTS): autosprintf.h
32
autosprintf.h: autosprintf.h.in
33
cp $(srcdir)/autosprintf.h.in autosprintf.h
34
MOSTLYCLEANFILES += autosprintf.h
35
EXTRA_DIST += autosprintf.h.in
38
rm -f $(distdir)/autosprintf.h
43
lib_LTLIBRARIES = libasprintf.la
45
libasprintf_la_SOURCES = \
46
lib-asprintf.h lib-asprintf.c \
47
autosprintf.h autosprintf.cc
49
# Sources used only on platforms lacking vasprintf().
50
lib_asprintf_EXTRASOURCES = \
52
printf-args.h printf-args.c \
53
printf-parse.h printf-parse.c \
54
vasnprintf.h vasnprintf.c asnprintf.c \
55
vasprintf.h vasprintf.c asprintf.c
56
lib-asprintf.lo: $(lib_asprintf_EXTRASOURCES)
57
EXTRA_DIST += $(lib_asprintf_EXTRASOURCES)
60
# >>> gnulib module alloca.
61
EXTRA_DIST += alloca_.h
63
# The following is needed in order to create an <alloca.h> when the system
64
# doesn't have one that works with the given compiler.
65
all-local $(libasprintf_la_OBJECTS): @ALLOCA_H@
67
cp $(srcdir)/alloca_.h alloca.h
68
MOSTLYCLEANFILES += alloca.h
69
# <<< gnulib module alloca.
72
# Clean up after Solaris cc.
79
docdir = $(datadir)/doc/@PACKAGE@
85
MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
86
MAKEINFOFLAGS = --no-split
88
info_TEXINFOS = autosprintf.texi
90
# We distribute only the HTML documentation.
91
# The user can generate the others, via
93
# make autosprintf.pdf
96
install-data-local: install-html
97
installdirs-local: installdirs-html
98
uninstall-local: uninstall-html
100
CLEANFILES = autosprintf.pdf
101
# autosprintf.dvi and autosprintf.ps are already known to automake.
104
# Documentation in DVI format.
106
install-dvi: autosprintf.dvi
107
$(mkinstalldirs) $(DESTDIR)$(dvidir)
108
$(INSTALL_DATA) `if test -f autosprintf.dvi; then echo .; else echo $(srcdir); fi`/autosprintf.dvi $(DESTDIR)$(dvidir)/autosprintf.dvi
111
$(mkinstalldirs) $(DESTDIR)$(dvidir)
114
$(RM) $(DESTDIR)$(dvidir)/autosprintf.dvi
116
# Temporary index files. automake removes only the predefined ones by itself.
120
# Documentation in Postscript format.
122
# Override of automake's definition:
124
DVIPS = @DVIPS@ -D600
126
autosprintf.ps: autosprintf.dvi
127
$(DVIPS) -o $@ `if test -f autosprintf.dvi; then echo autosprintf.dvi; else echo $(srcdir)/autosprintf.dvi; fi`
129
install-ps: autosprintf.ps
130
$(mkinstalldirs) $(DESTDIR)$(psdir)
131
$(INSTALL_DATA) `if test -f autosprintf.ps; then echo .; else echo $(srcdir); fi`/autosprintf.ps $(DESTDIR)$(psdir)/autosprintf.ps
134
$(mkinstalldirs) $(DESTDIR)$(psdir)
137
$(RM) $(DESTDIR)$(psdir)/autosprintf.ps
140
# Documentation in Portable Document Format.
144
install-pdf: autosprintf.pdf
145
$(mkinstalldirs) $(DESTDIR)$(pdfdir)
146
$(INSTALL_DATA) `if test -f autosprintf.pdf; then echo .; else echo $(srcdir); fi`/autosprintf.pdf $(DESTDIR)$(pdfdir)/autosprintf.pdf
149
$(mkinstalldirs) $(DESTDIR)$(pdfdir)
152
$(RM) $(DESTDIR)$(pdfdir)/autosprintf.pdf
155
# Documentation in HTML format.
157
TEXI2HTML = @PERL@ $(srcdir)/texi2html
159
html-local: autosprintf_all.html
161
# Override of automake's definition.
162
# We want to use texi2html, not makeinfo --html.
163
autosprintf_all.html: autosprintf.texi
164
$(TEXI2HTML) -expandinfo -number -monolithic `if test -f autosprintf.texi; then echo autosprintf.texi; else echo $(srcdir)/autosprintf.texi; fi`
165
mv autosprintf.html autosprintf_all.html
167
install-html: autosprintf_all.html
168
$(mkinstalldirs) $(DESTDIR)$(htmldir)
169
$(INSTALL_DATA) `if test -f autosprintf_all.html; then echo .; else echo $(srcdir); fi`/autosprintf_all.html $(DESTDIR)$(htmldir)/autosprintf.html
172
$(mkinstalldirs) $(DESTDIR)$(htmldir)
175
$(RM) $(DESTDIR)$(htmldir)/autosprintf.html
177
EXTRA_DIST += texi2html autosprintf_all.html
182
config.h_vms: config.h.in
183
(echo '#include <vms_jackets.h>'; \
184
sed -e 's/#undef HAVE_ALLOCA$$/#define HAVE_ALLOCA 1/' \
185
-e 's/#undef HAVE_DLFCN_H$$/#define HAVE_DLFCN_H 1/' \
186
-e 's/#undef HAVE_INTTYPES_H$$/#define HAVE_INTTYPES_H 1/' \
187
-e 's/#undef HAVE_LONG_DOUBLE$$/#define HAVE_LONG_DOUBLE 1/' \
188
-e 's/#undef HAVE_LONG_LONG$$/#define HAVE_LONG_LONG 1/' \
189
-e 's/#undef HAVE_MEMORY_H$$/#define HAVE_MEMORY_H 1/' \
190
-e 's/#undef HAVE_POSIX_PRINTF$$/#define HAVE_POSIX_PRINTF 1/' \
191
-e 's/#undef HAVE_PTRDIFF_T$$/#define HAVE_PTRDIFF_T 1/' \
192
-e 's/#undef HAVE_STDLIB_H$$/#define HAVE_STDLIB_H 1/' \
193
-e 's/#undef HAVE_STRINGS_H$$/#define HAVE_STRINGS_H 1/' \
194
-e 's/#undef HAVE_STRING_H$$/#define HAVE_STRING_H 1/' \
195
-e 's/#undef HAVE_SYS_STAT_H$$/#define HAVE_SYS_STAT_H 1/' \
196
-e 's/#undef HAVE_SYS_TYPES_H$$/#define HAVE_SYS_TYPES_H 1/' \
197
-e 's/#undef HAVE_UNISTD_H$$/#define HAVE_UNISTD_H 1/' \
198
-e 's/#undef HAVE_WCHAR_T$$/#define HAVE_WCHAR_T 1/' \
199
-e 's/#undef HAVE_WCSLEN$$/#define HAVE_WCSLEN 1/' \
200
-e 's/#undef HAVE_WINT_T$$/#define HAVE_WINT_T 1/' \
201
-e 's/#undef STDC_HEADERS$$/#define STDC_HEADERS 1/' \
202
< $(srcdir)/config.h.in; echo; echo '#define alloca __ALLOCA') > $@
204
EXTRA_DIST += Makefile.vms config.h_vms
209
config.h.msvc: config.h.in
210
sed -e 's/#undef HAVE_ALLOCA$$/#define HAVE_ALLOCA 1/' \
211
-e 's/#undef HAVE_DECL__SNPRINTF$$/#define HAVE_DECL__SNPRINTF 1/' \
212
-e 's/#undef HAVE_LONG_DOUBLE$$/#define HAVE_LONG_DOUBLE 1/' \
213
-e 's/#undef HAVE_PTRDIFF_T$$/#define HAVE_PTRDIFF_T 1/' \
214
-e 's/#undef HAVE_SNPRINTF$$/#define HAVE_SNPRINTF 1/' \
215
-e 's/#undef HAVE_STDLIB_H$$/#define HAVE_STDLIB_H 1/' \
216
-e 's/#undef HAVE_STRING_H$$/#define HAVE_STRING_H 1/' \
217
-e 's/#undef HAVE_WCHAR_T$$/#define HAVE_WCHAR_T 1/' \
218
-e 's/#undef HAVE_WCSLEN$$/#define HAVE_WCSLEN 1/' \
219
-e 's/#undef HAVE_WINT_T$$/#define HAVE_WINT_T 1/' \
220
-e 's/#undef SIZE_MAX$$/#define SIZE_MAX 2147483647U/' \
221
-e 's/#undef inline$$/#define inline __inline/' \
222
< $(srcdir)/config.h.in > $@
224
autosprintf.h.msvc-shared: autosprintf.h.in windows/dllexport.h
225
sed -e 's/extern \([^"]\)/extern LIBASPRINTF_DLL_EXPORTED \1/' \
226
-e 's/class /class LIBASPRINTF_DLL_EXPORTED /' \
227
-e 's/struct /struct LIBASPRINTF_DLL_EXPORTED /' \
228
-e '/#define _AUTOSPRINTF_H/r windows/dllexport.h' < $(srcdir)/autosprintf.h.in > $@
230
EXTRA_DIST += README.woe32 Makefile.msvc config.h.msvc autosprintf.h.msvc-shared windows/dllexport.h windows/asprintf.rc