Initial support of curlbuild.h and curlrules.h which allows
[platform/upstream/curl.git] / ares / Makefile.am
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 is for libcurl's generated curl/curlbuild.h file
17 # $(top_builddir) is for c-ares's generated config.h file
18 # $(top_srcdir) is for c-ares's lib/setup.h and other "c-ares-private" files
19
20 if CURLDEBUG
21 INCLUDES = -I$(top_builddir)/../include \
22            -I$(top_builddir)            \
23            -I$(top_srcdir)
24 else
25 INCLUDES = -I$(top_builddir) \
26            -I$(top_srcdir)
27 endif
28
29 lib_LTLIBRARIES = libcares.la
30
31 man_MANS = $(MANPAGES)
32
33 MSVCFILES = vc/vc.dsw vc/acountry/acountry.dsp vc/adig/adig.dsp \
34  vc/ahost/ahost.dsp vc/areslib/areslib.dsp vc/areslib/areslib.dsw
35
36 if DEBUGBUILD
37 PROGS =
38 else
39 PROGS = ahost adig acountry
40 endif
41
42 noinst_PROGRAMS =$(PROGS)
43
44 # adig and ahost are just sample programs and thus not mentioned with the
45 # regular sources and headers
46 EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj         \
47  Makefile.m32 Makefile.netware Makefile.vc6 $(man_MANS) $(MSVCFILES)       \
48  config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz
49
50 pkgconfigdir = $(libdir)/pkgconfig
51 pkgconfig_DATA = libcares.pc
52
53 VER=-version-info 2:0:0
54 # This flag accepts an argument of the form current[:revision[:age]]. So,
55 # passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
56 # 1.
57 #
58 # If either revision or age are omitted, they default to 0. Also note that age
59 # must be less than or equal to the current interface number.
60 #
61 # Here are a set of rules to help you update your library version information: 
62 #
63 # 1.Start with version information of 0:0:0 for each libtool library.
64 #
65 # 2.Update the version information only immediately before a public release of
66 # your software. More frequent updates are unnecessary, and only guarantee
67 # that the current interface number gets larger faster.
68 #
69 # 3.If the library source code has changed at all since the last update, then
70 # increment revision (c:r+1:a)
71 #
72 # 4.If any interfaces have been added, removed, or changed since the last
73 # update, increment current, and set revision to 0. (c+1:r=0:a)
74 #
75 # 5.If any interfaces have been added since the last public release, then
76 # increment age. (c:r:a+1)
77 #
78 # 6.If any interfaces have been removed since the last public release, then
79 # set age to 0. (c:r:a=0)
80 #
81
82 if NO_UNDEFINED
83 # The -no-undefined flag is crucial for this to build fine on some platforms
84 UNDEF = -no-undefined
85 endif
86
87
88 libcares_la_LDFLAGS = $(UNDEF) $(VER)
89
90 # Makefile.inc provides the CSOURCES and HHEADERS defines
91 include Makefile.inc
92
93 libcares_la_SOURCES = $(CSOURCES) $(HHEADERS)
94
95 # where to install the c-ares headers
96 libcares_ladir = $(includedir)
97 # what headers to install on 'make install':
98 libcares_la_HEADERS = ares.h ares_version.h ares_dns.h
99
100 ahost_SOURCES = ahost.c ares_getopt.c ares_getopt.h
101 ahost_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
102
103 adig_SOURCES = adig.c ares_getopt.c ares_getopt.h
104 adig_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
105
106 acountry_SOURCES = acountry.c ares_getopt.c ares_getopt.h
107 acountry_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
108
109 # Make files named *.dist replace the file without .dist extension
110 dist-hook:
111         find $(distdir) -name "*.dist" -exec rm {} \;
112         (distit=`find $(srcdir) -name "*.dist"`; \
113         for file in $$distit; do \
114           strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
115           cp $$file $(distdir)$$strip; \
116         done)