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