1## Makefile for the gettext-runtime/libasprintf subdirectory of GNU gettext 2## Copyright (C) 2002-2007, 2009-2011, 2013, 2016, 2018-2019 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 Lesser General Public License as published by 6## the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. 13## 14## You should have received a copy of the GNU Lesser 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 gnu no-dependencies 20ACLOCAL_AMFLAGS = -I ../../m4 -I ../m4 -I gnulib-m4 21EXTRA_DIST = 22BUILT_SOURCES = 23MOSTLYCLEANFILES = 24 25RM = rm -f 26 27DEFS = -DIN_LIBASPRINTF @DEFS@ 28 29if WOE32 30# On mingw, disable the declarations of *printf functions as aliases to the 31# corresponding __mingw_*printf functions, because 32# - these functions are useless for i18n purposes (not POSIX/XSI compliant), 33# - they pull in a dependency to the libgcc_s_sjlj DLL (through the symbols 34# __udivdi3, __umoddi3). 35DEFS += -D__USE_MINGW_ANSI_STDIO=0 36endif 37 38 39# Library include file. 40 41include_HEADERS = autosprintf.h 42 43all-local $(libasprintf_la_OBJECTS): autosprintf.h 44autosprintf.h: autosprintf.in.h 45 cp $(srcdir)/autosprintf.in.h autosprintf.h 46MOSTLYCLEANFILES += autosprintf.h 47EXTRA_DIST += autosprintf.in.h 48 49dist-hook: 50 rm -f $(distdir)/autosprintf.h 51 52 53# Library code. 54 55lib_LTLIBRARIES = libasprintf.la 56 57noinst_LTLIBRARIES = 58 59libasprintf_la_SOURCES = \ 60 xsize.h xsize.c \ 61 lib-asprintf.h lib-asprintf.c \ 62 autosprintf.h autosprintf.cc 63 64# Sources used only on platforms lacking vasprintf(). 65lib_asprintf_EXTRASOURCES = \ 66 verify.h \ 67 printf-args.h printf-args.c \ 68 printf-parse.h printf-parse.c \ 69 vasnprintf.h vasnprintf.c asnprintf.c \ 70 vasprintf.h vasprintf.c asprintf.c 71lib-asprintf.lo: $(lib_asprintf_EXTRASOURCES) 72EXTRA_DIST += $(lib_asprintf_EXTRASOURCES) 73 74 75# Version information according to Woe32 conventions. 76EXTRA_DIST += libasprintf.rc 77if WOE32 78WOE32_LIBADD = libasprintf.res.lo 79# This rule is executed only on Woe32 systems. 80# Use $(RC) with libtool, $(WINDRES) when not using libtool. 81# The following sed expressions come from the windres-options script. They are 82# inlined here, so that they can be written in a Makefile without requiring a 83# temporary file. They must contain literal newlines rather than semicolons, 84# so that they work with the sed-3.02 that is shipped with MSYS. 85libasprintf.res.lo: $(srcdir)/libasprintf.rc 86 nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \ 87 sed_extract_major='/^[0-9]/{'$${nl}'s/^\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ 88 sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ 89 sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ 90 $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \ 91 "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ 92 "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ 93 "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ 94 "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ 95 -i $(srcdir)/libasprintf.rc -o libasprintf.res.lo --output-format=coff 96MOSTLYCLEANFILES += libasprintf.res.lo 97else 98WOE32_LIBADD = 99endif 100libasprintf_la_LIBADD = $(WOE32_LIBADD) 101libasprintf_la_DEPENDENCIES = $(WOE32_LIBADD) 102 103# How to build libasprintf. 104# With libtool 1.5.14, on some platforms, like BeOS, "libtool --tag=CXX" fails 105# to create a shared library, however "libtool --tag=CC" succeeds. 106libasprintf_la_LDFLAGS = @LTNOUNDEF@ 107libasprintf.la: $(libasprintf_la_OBJECTS) $(libasprintf_la_DEPENDENCIES) 108 $(AM_V_GEN)$(CXXLINK) -rpath $(libdir) $(libasprintf_la_LDFLAGS) $(libasprintf_la_OBJECTS) $(libasprintf_la_LIBADD) $(LIBS) || \ 109 $(LINK) -rpath $(libdir) $(libasprintf_la_LDFLAGS) $(libasprintf_la_OBJECTS) $(libasprintf_la_LIBADD) $(LIBS) 110 111 112# A small set of gnulib modules is needed here as well. 113include Makefile.gnulib 114 115# Allow users to use "gnulib-tool --update". 116EXTRA_DIST += gnulib-m4/gnulib-cache.m4 117 118 119# Clean up after Solaris cc. 120clean-local: 121 rm -rf SunWS_cache 122 123 124# Documentation. 125 126# List of -I options referring to directories that contain texinfo sources 127# used by this directory. 128# Should contain at least one -I option, to work around a bug in texi2dvi 1.13, 129# see <https://lists.gnu.org/archive/html/bug-automake/2009-04/msg00029.html>. 130TEXINCLUDES = -I . 131 132MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@ 133MAKEINFOFLAGS = $(TEXINCLUDES) --no-split 134 135info_TEXINFOS = autosprintf.texi 136# List of texinfo sources @included by autosprintf.texi. 137autosprintf_TEXINFOS = lgpl.texi gpl.texi fdl.texi 138 139# We distribute only the HTML documentation. 140# The user can generate the others, via 141# make autosprintf.ps 142# make autosprintf.pdf 143 144all-local: html-local 145install-data-local: install-html 146installdirs-local: installdirs-html 147uninstall-local: uninstall-html 148 149# CLEANFILES: autosprintf.{dvi,ps,pdf,html} are already known to automake. 150 151 152# Documentation in DVI format. 153 154# The install-dvi target is already defined by automake. 155 156installdirs-dvi: 157 $(MKDIR_P) $(DESTDIR)$(dvidir) 158 159uninstall-dvi: 160 $(RM) $(DESTDIR)$(dvidir)/autosprintf.dvi 161 162# Temporary index files. automake removes only the predefined ones by itself. 163MOSTLYCLEANFILES += 164 165 166# Documentation in Postscript format. 167 168# Override of automake's definition: 169#DVIPS = @DVIPS@ 170DVIPS = @DVIPS@ -D600 171 172autosprintf.ps: autosprintf.dvi 173 $(DVIPS) -o $@ `if test -f autosprintf.dvi; then echo autosprintf.dvi; else echo $(srcdir)/autosprintf.dvi; fi` 174 175# The install-ps target is already defined by automake. 176 177installdirs-ps: 178 $(MKDIR_P) $(DESTDIR)$(psdir) 179 180uninstall-ps: 181 $(RM) $(DESTDIR)$(psdir)/autosprintf.ps 182 183 184# Documentation in Portable Document Format. 185 186# The install-pdf target is already defined by automake. 187 188installdirs-pdf: 189 $(MKDIR_P) $(DESTDIR)$(pdfdir) 190 191uninstall-pdf: 192 $(RM) $(DESTDIR)$(pdfdir)/autosprintf.pdf 193 194 195# Documentation in HTML format. 196 197TEXI2HTML = @PERL@ $(top_srcdir)/../../build-aux/texi2html 198 199HTMLS = autosprintf_all.html 200 201html-local: $(HTMLS) 202 203# Override of automake's definition. 204# We want to use texi2html, not makeinfo --html. 205autosprintf_all.html: autosprintf.texi $(autosprintf_TEXINFOS) 206 $(TEXI2HTML) $(TEXINCLUDES) -no-sec-nav -no-menu -toc-links -number -monolithic $(srcdir)/autosprintf.texi 207 mv autosprintf.html autosprintf_all.html 208 209# The install-html target is already defined by automake. 210 211installdirs-html: 212 $(MKDIR_P) $(DESTDIR)$(htmldir) 213 214uninstall-html: 215 $(RM) $(DESTDIR)$(htmldir)/autosprintf.html 216 217EXTRA_DIST += autosprintf_all.html 218 219 220# Windows support. 221 222EXTRA_DIST += INSTALL.windows 223