1AUTOMAKE_OPTIONS = foreign nostdinc 2 3ACLOCAL_AMFLAGS = -I m4 4 5# Specify our include paths here, and do it relative to $(top_srcdir) and 6# $(top_builddir), to ensure that these paths which belong to the library 7# being currently built and tested are searched before the library which 8# might possibly already be installed in the system. 9# 10# When using the low-level hard-hacking memory leak tracking code from 11# libcurl the generated curl/curlbuild.h file must also be reachable. 12# Using the libcurl lowlevel code from within c-ares library is ugly and 13# only works when c-ares is built and linked with a similarly debug-build 14# libcurl, but we do this anyway for convenience. 15# 16# $(top_builddir)/../include/curl for generated curlbuild.h included from curl.h 17# $(top_builddir)/../include is for libcurl's generated curl/curlbuild.h file 18# $(top_srcdir)/../include is for libcurl's external include files 19# $(top_builddir)/../lib is for libcurl's generated lib/curl_config.h file 20# $(top_srcdir)/../lib is for libcurl's lib/setup.h and other "private" files 21# $(top_builddir) is for c-ares's generated ares_config.h file 22# $(top_srcdir) is for c-ares's ares_setup.h and other "c-ares-private" files 23 24if CURLDEBUG 25AM_CPPFLAGS = -I$(top_builddir)/../include/curl \ 26 -I$(top_builddir)/../include \ 27 -I$(top_srcdir)/../include \ 28 -I$(top_builddir)/../lib \ 29 -I$(top_srcdir)/../lib \ 30 -I$(top_builddir) \ 31 -I$(top_srcdir) 32else 33AM_CPPFLAGS = -I$(top_builddir) \ 34 -I$(top_srcdir) 35endif 36 37lib_LTLIBRARIES = libcares.la 38 39man_MANS = $(MANPAGES) 40 41MSVCFILES = vc/vc6aws.dsw vc/acountry/vc6acountry.dsp vc/adig/vc6adig.dsp \ 42 vc/ahost/vc6ahost.dsp vc/cares/vc6cares.dsp vc/cares/vc6cares.dsw \ 43 msvc_ver.inc 44 45if CURLDEBUG 46PROGS = 47else 48PROGS = ahost adig acountry 49endif 50 51noinst_PROGRAMS =$(PROGS) 52 53# adig and ahost are just sample programs and thus not mentioned with the 54# regular sources and headers 55EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \ 56 Makefile.m32 Makefile.netware Makefile.msvc Makefile.Watcom $(man_MANS) \ 57 config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz \ 58 TODO ares_build.h.in cares.rc README.msvc $(MSVCFILES) \ 59 $(CSOURCES) $(HHEADERS) config-dos.h acountry.1 adig.1 ahost.1 INSTALL.md \ 60 CMakeLists.txt ares_build.h.cmake ares_config.h.cmake c-ares-config.cmake.in \ 61 libcares.pc.cmake README.md LICENSE.md RELEASE-PROCEDURE.md 62 63CLEANFILES = $(PDFPAGES) $(HTMLPAGES) 64 65DISTCLEANFILES = ares_build.h 66 67DIST_SUBDIRS = test 68 69pkgconfigdir = $(libdir)/pkgconfig 70pkgconfig_DATA = libcares.pc 71 72CARES_VERSION_INFO = -version-info 6:1:4 73# This flag accepts an argument of the form current[:revision[:age]]. So, 74# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to 75# 1. 76# 77# If either revision or age are omitted, they default to 0. Also note that age 78# must be less than or equal to the current interface number. 79# 80# Here are a set of rules to help you update your library version information: 81# 82# 1.Start with version information of 0:0:0 for each libtool library. 83# 84# 2.Update the version information only immediately before a public release of 85# your software. More frequent updates are unnecessary, and only guarantee 86# that the current interface number gets larger faster. 87# 88# 3.If the library source code has changed at all since the last update, then 89# increment revision (c:r+1:a) 90# 91# 4.If any interfaces have been added, removed, or changed since the last 92# update, increment current, and set revision to 0. (c+1:r=0:a) 93# 94# 5.If any interfaces have been added since the last public release, then 95# increment age. (c:r:a+1) 96# 97# 6.If any interfaces have been removed since the last public release, then 98# set age to 0. (c:r:a=0) 99# 100 101AM_LDFLAGS = 102 103libcares_la_LDFLAGS_EXTRA = 104 105if CARES_LT_SHLIB_USE_VERSION_INFO 106libcares_la_LDFLAGS_EXTRA += $(CARES_VERSION_INFO) 107endif 108 109if CARES_LT_SHLIB_USE_NO_UNDEFINED 110libcares_la_LDFLAGS_EXTRA += -no-undefined 111endif 112 113if CARES_LT_SHLIB_USE_MIMPURE_TEXT 114libcares_la_LDFLAGS_EXTRA += -mimpure-text 115endif 116 117libcares_la_LDFLAGS = $(AM_LDFLAGS) $(libcares_la_LDFLAGS_EXTRA) 118 119# Add -Werror if defined 120CFLAGS += @CARES_CFLAG_EXTRAS@ 121 122if USE_CPPFLAG_CARES_STATICLIB 123AM_CPPFLAGS += $(CPPFLAG_CARES_STATICLIB) 124endif 125 126libcares_la_CFLAGS_EXTRA = 127 128libcares_la_CPPFLAGS_EXTRA = -DCARES_BUILDING_LIBRARY 129 130if DOING_CARES_SYMBOL_HIDING 131libcares_la_CFLAGS_EXTRA += $(CFLAG_CARES_SYMBOL_HIDING) 132libcares_la_CPPFLAGS_EXTRA += -DCARES_SYMBOL_HIDING 133endif 134 135@CODE_COVERAGE_RULES@ 136libcares_la_LDFLAGS += $(CODE_COVERAGE_LDFLAGS) 137libcares_la_CFLAGS_EXTRA += $(CODE_COVERAGE_CFLAGS) 138 139libcares_la_CFLAGS = $(AM_CFLAGS) $(libcares_la_CFLAGS_EXTRA) 140 141libcares_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcares_la_CPPFLAGS_EXTRA) 142 143# Makefile.inc provides the CSOURCES and HHEADERS defines 144include Makefile.inc 145 146libcares_la_SOURCES = $(CSOURCES) $(HHEADERS) 147 148# where to install the c-ares headers 149libcares_ladir = $(includedir) 150# what headers to install on 'make install': 151libcares_la_HEADERS = ares.h ares_version.h ares_dns.h \ 152 ares_build.h ares_rules.h 153 154ahost_SOURCES = ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS) 155ahost_LDADD = $(top_builddir)/libcares.la 156ahost_CFLAGS = $(AM_CFLAGS) 157ahost_CPPFLAGS = $(AM_CPPFLAGS) 158 159adig_SOURCES = adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS) 160adig_LDADD = $(top_builddir)/libcares.la 161adig_CFLAGS = $(AM_CFLAGS) 162adig_CPPFLAGS = $(AM_CPPFLAGS) 163 164acountry_SOURCES = acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS) 165acountry_LDADD = $(top_builddir)/libcares.la 166acountry_CFLAGS = $(AM_CFLAGS) 167acountry_CPPFLAGS = $(AM_CPPFLAGS) 168 169SOURCEDMANDIR = man3 170SOURCEDMANPAGES = ares_init.3 171 172clean-local: clean-sourced-manpages 173 174clean-sourced-manpages: 175 @srcdmandir='$(SOURCEDMANDIR)'; \ 176 echo "rm -rf $(top_builddir)/$$srcdmandir"; \ 177 rm -rf $(top_builddir)/$$srcdmandir 178 179sourced-manpages: clean-sourced-manpages 180 @srcdmandir='$(SOURCEDMANDIR)'; \ 181 srcdmanfiles='$(SOURCEDMANPAGES)'; \ 182 mkdir $(top_builddir)/$$srcdmandir; \ 183 for file in $$srcdmanfiles; do \ 184 if test -f $(top_srcdir)/$$file; then \ 185 echo "cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file"; \ 186 cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file; \ 187 fi; \ 188 done 189 190MAN2HTML = roffit --mandir=. < $< >$@ 191 192SUFFIXES = .3 .html 193 194html: sourced-manpages $(HTMLPAGES) 195 196.3.html: 197 $(MAN2HTML) 198 199pdf: sourced-manpages $(PDFPAGES) 200 201.3.pdf: 202 @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \ 203 groff -Tps -man $< >$$foo.ps; \ 204 ps2pdf $$foo.ps $@; \ 205 rm $$foo.ps; \ 206 echo "converted $< to $@") 207 208# Make files named *.dist replace the file without .dist extension 209dist-hook: 210 find $(distdir) -name "*.dist" -exec rm {} \; 211 (distit=`find $(srcdir) -name "*.dist"`; \ 212 for file in $$distit; do \ 213 strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \ 214 cp $$file $(distdir)$$strip; \ 215 done) 216