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