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