build: Added Visual Studio 2010 (VC10) project files
[platform/upstream/curl.git] / Makefile.am
1 #***************************************************************************
2 #                                  _   _ ____  _
3 #  Project                     ___| | | |  _ \| |
4 #                             / __| | | | |_) | |
5 #                            | (__| |_| |  _ <| |___
6 #                             \___|\___/|_| \_\_____|
7 #
8 # Copyright (C) 1998 - 2014, 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
23 AUTOMAKE_OPTIONS = foreign
24
25 ACLOCAL_AMFLAGS = -I m4
26
27 CMAKE_DIST = CMakeLists.txt CMake/CMakeConfigurableFile.in              \
28 CMake/CurlCheckCSourceCompiles.cmake CMake/CurlCheckCSourceRuns.cmake   \
29 CMake/CurlTests.c CMake/FindOpenSSL.cmake CMake/FindZLIB.cmake          \
30 CMake/OtherTests.cmake CMake/Platforms/WindowsCache.cmake               \
31 CMake/Utilities.cmake include/curl/curlbuild.h.cmake
32
33 VC6LIBDSP = vs/vc6/lib/vc6libcurl.dsp
34 VC6LIBDSPHEAD = vs/t/lib/vc6_libcurl_dsp.head
35 VC6LIBDSPFOOT = vs/t/lib/vc6_libcurl_dsp.foot
36
37 VC8LIBPRJ = vs/vc8/lib/vc8libcurl.vcproj
38 VC8LIBPRJHEAD = vs/t/lib/vc8_libcurl_prj.head
39 VC8LIBPRJFOOT = vs/t/lib/vc8_libcurl_prj.foot
40
41 VCPROJECTS = projects/README projects/Windows/VC8/lib/libcurl.sln           \
42  projects/Windows/VC8/lib/libcurl.tmpl projects/Windows/VC8/curl.sln        \
43  projects/Windows/VC8/src/curlsrc.tmpl projects/Windows/VC8/src/curlsrc.sln     \
44  projects/Windows/VC9/curl.sln  \
45  projects/Windows/VC9/lib/libcurl.sln projects/Windows/VC9/lib/libcurl.tmpl     \
46  projects/Windows/VC9/src/curlsrc.sln projects/Windows/VC9/src/curlsrc.tmpl
47  projects/Windows/VC10/curl.sln \
48  projects/Windows/VC10/lib/libcurl.sln projects/Windows/VC10/lib/libcurl.tmpl   \
49  projects/Windows/VC10/src/curlsrc.sln projects/Windows/VC10/src/curlsrc.tmpl
50
51 VC_DIST = \
52  vs/t/README \
53  $(VC6LIBDSP) $(VC6LIBDSPHEAD) $(VC6LIBDSPFOOT) \
54  $(VC8LIBPRJ) $(VC8LIBPRJHEAD) $(VC8LIBPRJFOOT) \
55  vs/vc6/vc6curl.dsw \
56  vs/vc6/lib/vc6libcurl.dsw \
57  vs/vc6/src/vc6curltool.dsw \
58  vs/vc6/src/vc6curltool.dsp $(VCPROJECTS)
59
60 VC6LIBDSP_DEPS = $(VC6LIBDSPHEAD) $(VC6LIBDSPFOOT) \
61  Makefile.am lib/Makefile.inc
62
63 VC8LIBPRJ_DEPS = $(VC8LIBPRJHEAD) $(VC8LIBPRJFOOT) \
64  Makefile.am lib/Makefile.inc
65
66 WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat   \
67  winbuild/MakefileBuild.vc winbuild/Makefile.vc                         \
68  winbuild/Makefile.msvc.names
69
70 EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in       \
71  RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework \
72  $(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) lib/libcurl.vers.in
73
74 CLEANFILES = $(VC6LIBDSP) $(VC8LIBPRJ)
75
76 bin_SCRIPTS = curl-config
77
78 SUBDIRS = lib src include
79 DIST_SUBDIRS = $(SUBDIRS) tests packages docs
80
81 pkgconfigdir = $(libdir)/pkgconfig
82 pkgconfig_DATA = libcurl.pc
83
84 # List of libcurl source files required to generate VC IDE dsp and prj files
85 include lib/Makefile.inc
86
87 WIN32SOURCES = $(CSOURCES)
88 WIN32HEADERS = $(HHEADERS) config-win32.h
89
90 dist-hook:
91         rm -rf $(top_builddir)/tests/log
92         find $(distdir) -name "*.dist" -exec rm {} \;
93         (distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \
94         for file in $$distit; do \
95           strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
96           cp $$file $(distdir)$$strip; \
97         done)
98
99 html:
100         cd docs; make html
101
102 pdf:
103         cd docs; make pdf
104
105 check: test examples
106
107 if CROSSCOMPILING
108 test-full: test
109 test-torture: test
110
111 test:
112         @echo "NOTICE: we can't run the tests when cross-compiling!"
113
114 else
115
116 test:
117         @(cd tests; $(MAKE) all quiet-test)
118
119 test-full:
120         @(cd tests; $(MAKE) all full-test)
121
122 test-torture:
123         @(cd tests; $(MAKE) all torture-test)
124
125 test-am:
126         @(cd tests; $(MAKE) all am-test)
127
128 endif
129
130 examples:
131         @(cd docs/examples; $(MAKE) check)
132
133 # This is a hook to have 'make clean' also clean up the docs and the tests
134 # dir. The extra check for the Makefiles being present is necessary because
135 # 'make distcheck' will make clean first in these directories _before_ it runs
136 # this hook.
137 clean-local:
138         @(if test -f tests/Makefile; then cd tests; $(MAKE) clean; fi)
139         @(if test -f docs/Makefile; then cd docs; $(MAKE) clean; fi)
140
141 #
142 # Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
143 # must contain the following line:
144 # %_topdir /home/loic/local/rpm
145 # and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc.
146 #
147 # cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS
148 #
149 # If additional configure flags are needed to build the package, add the
150 # following in ~/.rpmmacros
151 # %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS}
152 # and run make rpm in the following way:
153 # AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm
154 #
155
156 rpms:
157         $(MAKE) RPMDIST=curl rpm
158         $(MAKE) RPMDIST=curl-ssl rpm
159
160 rpm:
161         RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \
162         cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \
163         cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \
164         rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \
165         mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \
166         mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
167
168 #
169 # Build a Solaris pkgadd format file
170 # run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format
171 # file (which ends up back in this directory).
172 # The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do
173 # pkgadd -d ./HAXXcurl-*
174 #
175
176 # gak - libtool requires an absoulte directory, hence the pwd below...
177 pkgadd:
178         umask 022 ; \
179         make install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \
180         cat COPYING > $(srcdir)/packages/Solaris/copyright ; \
181         cd $(srcdir)/packages/Solaris && $(MAKE) package
182
183 #
184 # Build a cygwin binary tarball installation file
185 # resulting .tar.bz2 file will end up at packages/Win32/cygwin
186 cygwinbin:
187         $(MAKE) -C packages/Win32/cygwin cygwinbin
188
189 # We extend the standard install with a custom hook:
190 install-data-hook:
191         cd include && $(MAKE) install
192         cd docs && $(MAKE) install
193
194 # We extend the standard uninstall with a custom hook:
195 uninstall-hook:
196         cd include && $(MAKE) uninstall
197         cd docs && $(MAKE) uninstall
198
199 ca-bundle: lib/mk-ca-bundle.pl
200         @echo "generate a fresh ca-bundle.crt"
201         @perl $< -b -l -u lib/ca-bundle.crt
202
203 ca-firefox: lib/firefox-db2pem.sh
204         @echo "generate a fresh ca-bundle.crt"
205         ./lib/firefox-db2pem.sh lib/ca-bundle.crt
206
207 checksrc:
208         cd lib && $(MAKE) checksrc
209         cd src && $(MAKE) checksrc
210
211 .PHONY: vc6-ide
212
213 vc6-ide:
214         $(MAKE) $(VC6LIBDSP)
215
216 $(VC6LIBDSP): $(VC6LIBDSP_DEPS)
217         @(echo "generating '$(VC6LIBDSP)'"; \
218         \
219         for dir in 'vs' 'vs/vc6' 'vs/vc6/lib'; do \
220           test -d "$$dir" || mkdir "$$dir" || exit 1; \
221         done; \
222         \
223         dir='..\..\..\lib\'; \
224         body='$(VC6LIBDSP)'.body; \
225         win32_srcs='$(WIN32SOURCES)'; \
226         win32_hdrs='$(WIN32HEADERS)'; \
227         sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \
228         sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \
229         \
230         echo "# Begin Group \"Source Files\""  > $$body; \
231         echo ""                               >> $$body; \
232         echo "# PROP Default_Filter \"\""     >> $$body; \
233         for file in $$sorted_srcs; do \
234           echo "# Begin Source File"          >> $$body; \
235           echo ""                             >> $$body; \
236           echo "SOURCE="$$dir$$file           >> $$body; \
237           echo "# End Source File"            >> $$body; \
238         done; \
239         echo "# End Group"                    >> $$body; \
240         echo "# Begin Group \"Header Files\"" >> $$body; \
241         echo ""                               >> $$body; \
242         echo "# PROP Default_Filter \"\""     >> $$body; \
243         for file in $$sorted_hdrs; do \
244           echo "# Begin Source File"          >> $$body; \
245           echo ""                             >> $$body; \
246           echo "SOURCE="$$dir$$file           >> $$body; \
247           echo "# End Source File"            >> $$body; \
248         done; \
249         echo "# End Group"                    >> $$body; \
250         \
251         awk '{ printf("%s\r\n", $$0); }' \
252           $(srcdir)/$(VC6LIBDSPHEAD) $$body $(srcdir)/$(VC6LIBDSPFOOT) \
253           > $(VC6LIBDSP) || { rm -f $$body; exit 1; }; \
254         \
255         rm -f $$body)
256
257 .PHONY: vc8-ide
258
259 vc8-ide:
260         $(MAKE) $(VC8LIBPRJ)
261
262 $(VC8LIBPRJ): $(VC8LIBPRJ_DEPS)
263         @(echo "generating '$(VC8LIBPRJ)'"; \
264         \
265         for dir in 'vs' 'vs/vc8' 'vs/vc8/lib'; do \
266           test -d "$$dir" || mkdir "$$dir" || exit 1; \
267         done; \
268         \
269         dir='..\..\..\lib\'; \
270         body='$(VC8LIBPRJ)'.body; \
271         win32_srcs='$(WIN32SOURCES)'; \
272         win32_hdrs='$(WIN32HEADERS)'; \
273         sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \
274         sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \
275         \
276         echo "%tab%%tab%<Filter Name=\"Source Files\">"  > $$body; \
277         for file in $$sorted_srcs; do \
278           echo "%tab%%tab%%tab%<File RelativePath=\""$$dir$$file"\"></File>" >> $$body; \
279         done; \
280         echo "%tab%%tab%</Filter>"                      >> $$body; \
281         echo "%tab%%tab%<Filter Name=\"Header Files\">" >> $$body; \
282         for file in $$sorted_hdrs; do \
283           echo "%tab%%tab%%tab%<File RelativePath=\""$$dir$$file"\"></File>" >> $$body; \
284         done; \
285         echo "%tab%%tab%</Filter>"                      >> $$body; \
286         \
287         awk '{ gsub(/%tab%/, "\t"); printf("%s\r\n", $$0); }' \
288           $(srcdir)/$(VC8LIBPRJHEAD) $$body $(srcdir)/$(VC8LIBPRJFOOT) \
289           > $(VC8LIBPRJ) || { rm -f $$body; exit 1; }; \
290         \
291         rm -f $$body)
292