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