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