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