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