6dffbd9c920f88e2fc58d15200149f5a219314b7
[platform/upstream/curl.git] / lib / Makefile.am
1 #***************************************************************************
2 #                                  _   _ ____  _
3 #  Project                     ___| | | |  _ \| |
4 #                             / __| | | | |_) | |
5 #                            | (__| |_| |  _ <| |___
6 #                             \___|\___/|_| \_\_____|
7 #
8 # Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
9 #
10 # This software is licensed as described in the file COPYING, which
11 # you should have received as part of this distribution. The terms
12 # are also available at http://curl.haxx.se/docs/copyright.html.
13 #
14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 # copies of the Software, and permit persons to whom the Software is
16 # furnished to do so, under the terms of the COPYING file.
17 #
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
20 #
21 ###########################################################################
22 AUTOMAKE_OPTIONS = foreign nostdinc
23
24 DOCS = README.encoding README.memoryleak README.ares README.curlx       \
25  README.hostip README.multi_socket README.httpauth README.pipelining    \
26  README.curl_off_t README.pingpong
27
28 CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
29
30 EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 config-win32.h      \
31  config-win32ce.h config-riscos.h config-mac.h curl_config.h.in         \
32  makefile.dj config-dos.h libcurl.plist libcurl.rc config-amigaos.h     \
33  makefile.amiga Makefile.netware nwlib.c nwos.c config-win32ce.h        \
34  config-os400.h setup-os400.h config-symbian.h Makefile.Watcom          \
35  config-tpf.h $(DOCS) mk-ca-bundle.pl mk-ca-bundle.vbs $(CMAKE_DIST)    \
36  firefox-db2pem.sh config-vxworks.h Makefile.vxworks checksrc.pl        \
37  objnames-test08.sh objnames-test10.sh objnames.inc
38
39 lib_LTLIBRARIES = libcurl.la
40
41 if BUILD_UNITTESTS
42 noinst_LTLIBRARIES = libcurlu.la
43 else
44 noinst_LTLIBRARIES =
45 endif
46
47 # This might hold -Werror
48 CFLAGS += @CURL_CFLAG_EXTRAS@
49
50 # Specify our include paths here, and do it relative to $(top_srcdir) and
51 # $(top_builddir), to ensure that these paths which belong to the library
52 # being currently built and tested are searched before the library which
53 # might possibly already be installed in the system.
54 #
55 # $(top_builddir)/include/curl for generated curlbuild.h included from curl.h
56 # $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h
57 # $(top_srcdir)/include is for libcurl's external include files
58 # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
59 # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "private" files
60 # $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file
61 # $(top_srcdir)/ares is for in-tree c-ares's external include files
62
63 AM_CPPFLAGS = -I$(top_builddir)/include/curl \
64               -I$(top_builddir)/include      \
65               -I$(top_srcdir)/include        \
66               -I$(top_builddir)/lib          \
67               -I$(top_srcdir)/lib
68
69 if USE_EMBEDDED_ARES
70 AM_CPPFLAGS += -I$(top_builddir)/ares        \
71                -I$(top_srcdir)/ares
72 endif
73
74 # Prevent LIBS from being used for all link targets
75 LIBS = $(BLANK_AT_MAKETIME)
76
77 if SONAME_BUMP
78 #
79 # Bumping of SONAME conditionally may seem like a weird thing to do, and yeah
80 # it is. The problem is that we try to avoid the bump as hard as possible, but
81 # yet it is still necessary for a few rare situations. The configure script will
82 # attempt to figure out these situations, and it can be forced to consider this
83 # to be such a case! See README.curl_off_t for further details.
84 #
85 # This conditional soname bump SHOULD be removed at next "proper" bump.
86 #
87 VERSIONINFO=-version-info 8:0:3
88 else
89 VERSIONINFO=-version-info 7:0:3
90 endif
91
92 # This flag accepts an argument of the form current[:revision[:age]]. So,
93 # passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
94 # 1.
95 #
96 # Here's the simplified rule guide on how to change -version-info:
97 # (current version is C:R:A)
98 #
99 # 1. if there are only source changes, use C:R+1:A
100 # 2. if interfaces were added use C+1:0:A+1
101 # 3. if interfaces were removed, then use C+1:0:0
102 #
103 # For the full guide on libcurl ABI rules, see docs/libcurl/ABI
104
105 AM_CPPFLAGS += -DBUILDING_LIBCURL
106 AM_LDFLAGS =
107 AM_CFLAGS =
108
109 libcurl_la_CPPFLAGS_EXTRA =
110 libcurl_la_LDFLAGS_EXTRA =
111 libcurl_la_CFLAGS_EXTRA =
112
113 if CURL_LT_SHLIB_USE_VERSION_INFO
114 libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO)
115 endif
116
117 if CURL_LT_SHLIB_USE_NO_UNDEFINED
118 libcurl_la_LDFLAGS_EXTRA += -no-undefined
119 endif
120
121 if CURL_LT_SHLIB_USE_MIMPURE_TEXT
122 libcurl_la_LDFLAGS_EXTRA += -mimpure-text
123 endif
124
125 if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS
126 libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers
127 endif
128
129 if USE_CPPFLAG_CURL_STATICLIB
130 libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
131 endif
132
133 if DOING_CURL_SYMBOL_HIDING
134 libcurl_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS
135 libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING)
136 endif
137
138 libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA)
139 libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS)
140 libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA)
141
142 libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS
143 libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS)
144 libcurlu_la_CFLAGS = $(AM_CFLAGS)
145
146 # Makefile.inc provides the CSOURCES and HHEADERS defines
147 include Makefile.inc
148
149 libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
150 libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS)
151
152 checksrc:
153         @@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/lib $(CSOURCES) $(HHEADERS)
154
155 if CURLDEBUG
156 # for debug builds, we scan the sources on all regular make invokes
157 all-local: checksrc
158 endif