build adjustments: commit 9e24b9c7 follow-up
[platform/upstream/curl.git] / lib / Makefile.am
1 #***************************************************************************
2 #                                  _   _ ____  _
3 #  Project                     ___| | | |  _ \| |
4 #                             / __| | | | |_) | |
5 #                            | (__| |_| |  _ <| |___
6 #                             \___|\___/|_| \_\_____|
7 #
8 # Copyright (C) 1998 - 2012, 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 DSP = vc6libcurl.dsp
25 VCPROJ = libcurl.vcproj
26
27 DOCS = README.encoding README.memoryleak README.ares README.curlx       \
28  README.hostip README.multi_socket README.httpauth README.pipelining    \
29  README.curl_off_t README.pingpong
30
31 CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
32
33 EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 $(DSP)                 \
34  vc6libcurl.dsw config-win32.h config-win32ce.h config-riscos.h            \
35  config-mac.h curl_config.h.in makefile.dj config-dos.h libcurl.plist      \
36  libcurl.rc config-amigaos.h makefile.amiga                                \
37  Makefile.netware nwlib.c nwos.c libcurl.imp msvcproj.head msvcproj.foot   \
38  config-win32ce.h config-os400.h setup-os400.h config-symbian.h            \
39  Makefile.Watcom config-tpf.h $(DOCS) $(VCPROJ) mk-ca-bundle.pl            \
40  mk-ca-bundle.vbs firefox-db2pem.sh $(CMAKE_DIST) config-vxworks.h         \
41  Makefile.vxworks config-vms.h checksrc.pl
42
43 CLEANFILES = $(DSP) $(VCPROJ)
44
45 lib_LTLIBRARIES = libcurl.la
46 LIBCURL_LIBS = @LIBCURL_LIBS@
47
48 # This might hold -Werror
49 CFLAGS += @CURL_CFLAG_EXTRAS@
50
51 CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@
52
53 # Specify our include paths here, and do it relative to $(top_srcdir) and
54 # $(top_builddir), to ensure that these paths which belong to the library
55 # being currently built and tested are searched before the library which
56 # might possibly already be installed in the system.
57 #
58 # $(top_builddir)/include/curl for generated curlbuild.h included from curl.h
59 # $(top_builddir)/include for generated curlbuild.h included from lib/setup.h
60 # $(top_srcdir)/include is for libcurl's external include files
61 # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
62 # $(top_srcdir)/lib is for libcurl's lib/setup.h and other "private" files
63 # $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file
64 # $(top_srcdir)/ares is for in-tree c-ares's external include files
65
66 if USE_EMBEDDED_ARES
67 INCLUDES = -I$(top_builddir)/include/curl \
68            -I$(top_builddir)/include      \
69            -I$(top_srcdir)/include        \
70            -I$(top_builddir)/lib          \
71            -I$(top_srcdir)/lib            \
72            -I$(top_builddir)/ares         \
73            -I$(top_srcdir)/ares
74 else
75 INCLUDES = -I$(top_builddir)/include/curl \
76            -I$(top_builddir)/include      \
77            -I$(top_srcdir)/include        \
78            -I$(top_builddir)/lib          \
79            -I$(top_srcdir)/lib
80 endif
81
82 AM_CPPFLAGS =
83
84 # Mostly for Windows build targets, when building libcurl library
85 if USE_CPPFLAG_BUILDING_LIBCURL
86 AM_CPPFLAGS += -DBUILDING_LIBCURL
87 endif
88
89 # Mostly for Windows build targets, when building static libcurl
90 if USE_CPPFLAG_CURL_STATICLIB
91 AM_CPPFLAGS += -DCURL_STATICLIB
92 endif
93
94 if SONAME_BUMP
95 #
96 # Bumping of SONAME conditionally may seem like a weird thing to do, and yeah
97 # it is. The problem is that we try to avoid the bump as hard as possible, but
98 # yet it is still necessary for a few rare situations. The configure script will
99 # attempt to figure out these situations, and it can be forced to consider this
100 # to be such a case! See README.curl_off_t for further details.
101 #
102 # This conditional soname bump SHOULD be removed at next "proper" bump.
103 #
104 VERSIONINFO=-version-info 7:0:2
105 else
106 VERSIONINFO=-version-info 6:0:2
107 endif
108
109 # This flag accepts an argument of the form current[:revision[:age]]. So,
110 # passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
111 # 1.
112 #
113 # Here's the simplified rule guide on how to change -version-info:
114 # (current version is C:R:A)
115 #
116 # 1. if there are only source changes, use C:R+1:A
117 # 2. if interfaces were added use C+1:0:A+1
118 # 3. if interfaces were removed, then use C+1:0:0
119 #
120 # For the full guide on libcurl ABI rules, see docs/libcurl/ABI
121
122 if NO_UNDEFINED
123 # The -no-undefined flag is crucial to build fine on some platforms
124 UNDEF = -no-undefined
125 endif
126
127 if MIMPURE
128 # This is for gcc on Solaris (8+ ?) to avoid "relocations remain against
129 # allocatable but non-writable sections" problems.
130 MIMPURE = -mimpure-text
131 endif
132
133 if VERSIONED_SYMBOLS
134 VERSIONED_SYMBOLS = -Wl,--version-script=libcurl.vers
135 endif
136
137 libcurl_la_LDFLAGS = $(UNDEF) $(VERSIONINFO) $(MIMPURE) $(VERSIONED_SYMBOLS) $(LIBCURL_LIBS)
138
139 if DOING_CURL_SYMBOL_HIDING
140 libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_HIDDEN_SYMBOLS
141 libcurl_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_CURL_SYMBOL_HIDING)
142 else
143 libcurl_la_CPPFLAGS = $(AM_CPPFLAGS)
144 libcurl_la_CFLAGS = $(AM_CFLAGS)
145 endif
146
147 # unit testing static library built only along with unit tests
148 if BUILD_UNITTESTS
149 noinst_LTLIBRARIES = libcurlu.la
150 else
151 noinst_LTLIBRARIES =
152 endif
153
154 libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DUNITTESTS
155 libcurlu_la_LDFLAGS = -static $(LIBCURL_LIBS)
156 libcurlu_la_CFLAGS = $(AM_CFLAGS)
157
158 # Makefile.inc provides the CSOURCES and HHEADERS defines
159 include Makefile.inc
160
161 libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
162 libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS)
163
164 WIN32SOURCES = $(CSOURCES)
165 WIN32HEADERS = $(HHEADERS) config-win32.h
166
167 DSPOUT = | awk '{printf("%s\r\n", $$0)}' >> $(DSP)
168 VCPROJOUT = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ)
169
170 $(DSP): msvcproj.head msvcproj.foot Makefile.am
171         echo "creating $(DSP)"
172         @(cp $(srcdir)/msvcproj.head $(DSP); \
173         echo "# Begin Group \"Source Files\"" $(DSPOUT); \
174         echo "" $(DSPOUT); \
175         echo "# PROP Default_Filter \"\"" $(DSPOUT); \
176         win32_srcs='$(WIN32SOURCES)'; \
177         sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \
178         for file in $$sorted_srcs; do \
179         echo "# Begin Source File" $(DSPOUT); \
180         echo "" $(DSPOUT); \
181         echo "SOURCE=.\\"$$file $(DSPOUT); \
182         echo "# End Source File" $(DSPOUT); \
183         done; \
184         echo "# End Group" $(DSPOUT); \
185         echo "# Begin Group \"Header Files\"" $(DSPOUT); \
186         echo "" $(DSPOUT); \
187         echo "# PROP Default_Filter \"\"" $(DSPOUT); \
188         win32_hdrs='$(WIN32HEADERS)'; \
189         sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \
190         for file in $$sorted_hdrs; do \
191         echo "# Begin Source File" $(DSPOUT); \
192         echo "" $(DSPOUT); \
193         echo "SOURCE=.\\"$$file $(DSPOUT); \
194         echo "# End Source File" $(DSPOUT); \
195         done; \
196         echo "# End Group" $(DSPOUT); \
197         cat $(srcdir)/msvcproj.foot $(DSPOUT) )
198
199 $(VCPROJ): vc8proj.head vc8proj.foot Makefile.am
200         echo "creating $(VCPROJ)"
201         @(cp $(srcdir)/vc8proj.head $(VCPROJ); \
202         win32_srcs='$(WIN32SOURCES)'; \
203         sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \
204         for file in $$sorted_srcs; do \
205         echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT); \
206         done; \
207         echo "</Filter><Filter  Name=\"Header Files\">" $(VCPROJOUT); \
208         win32_hdrs='$(WIN32HEADERS)'; \
209         sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \
210         for file in $$sorted_hdrs; do \
211         echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT); \
212         done; \
213         cat $(srcdir)/vc8proj.foot $(VCPROJOUT) )
214
215
216 checksrc:
217         @@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/lib $(CSOURCES) $(HHEADERS)
218
219 if CURLDEBUG
220 # for debug builds, we scan the sources on all regular make invokes
221 all-local: checksrc
222 endif