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