1#***************************************************************************
2#                                  _   _ ____  _
3#  Project                     ___| | | |  _ \| |
4#                             / __| | | | |_) | |
5#                            | (__| |_| |  _ <| |___
6#                             \___|\___/|_| \_\_____|
7#
8# Copyright (C) 1998 - 2018, 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 https://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
23AUTOMAKE_OPTIONS = foreign
24
25ACLOCAL_AMFLAGS = -I m4
26
27CMAKE_DIST = CMakeLists.txt CMake/CMakeConfigurableFile.in      \
28 CMake/CurlTests.c CMake/FindGSS.cmake CMake/OtherTests.cmake   \
29 CMake/Platforms/WindowsCache.cmake CMake/Utilities.cmake       \
30 CMake/Macros.cmake              \
31 CMake/CurlSymbolHiding.cmake CMake/FindCARES.cmake             \
32 CMake/FindLibSSH2.cmake CMake/FindNGHTTP2.cmake                \
33 CMake/FindMbedTLS.cmake CMake/cmake_uninstall.cmake.in         \
34 CMake/curl-config.cmake.in
35
36VC6_LIBTMPL = projects/Windows/VC6/lib/libcurl.tmpl
37VC6_LIBDSP = projects/Windows/VC6/lib/libcurl.dsp.dist
38VC6_LIBDSP_DEPS = $(VC6_LIBTMPL) Makefile.am lib/Makefile.inc
39VC6_SRCTMPL = projects/Windows/VC6/src/curl.tmpl
40VC6_SRCDSP = projects/Windows/VC6/src/curl.dsp.dist
41VC6_SRCDSP_DEPS = $(VC6_SRCTMPL) Makefile.am src/Makefile.inc
42
43VC7_LIBTMPL = projects/Windows/VC7/lib/libcurl.tmpl
44VC7_LIBVCPROJ = projects/Windows/VC7/lib/libcurl.vcproj.dist
45VC7_LIBVCPROJ_DEPS = $(VC7_LIBTMPL) Makefile.am lib/Makefile.inc
46VC7_SRCTMPL = projects/Windows/VC7/src/curl.tmpl
47VC7_SRCVCPROJ = projects/Windows/VC7/src/curl.vcproj.dist
48VC7_SRCVCPROJ_DEPS = $(VC7_SRCTMPL) Makefile.am src/Makefile.inc
49
50VC71_LIBTMPL = projects/Windows/VC7.1/lib/libcurl.tmpl
51VC71_LIBVCPROJ = projects/Windows/VC7.1/lib/libcurl.vcproj.dist
52VC71_LIBVCPROJ_DEPS = $(VC71_LIBTMPL) Makefile.am lib/Makefile.inc
53VC71_SRCTMPL = projects/Windows/VC7.1/src/curl.tmpl
54VC71_SRCVCPROJ = projects/Windows/VC7.1/src/curl.vcproj.dist
55VC71_SRCVCPROJ_DEPS = $(VC71_SRCTMPL) Makefile.am src/Makefile.inc
56
57VC8_LIBTMPL = projects/Windows/VC8/lib/libcurl.tmpl
58VC8_LIBVCPROJ = projects/Windows/VC8/lib/libcurl.vcproj.dist
59VC8_LIBVCPROJ_DEPS = $(VC8_LIBTMPL) Makefile.am lib/Makefile.inc
60VC8_SRCTMPL = projects/Windows/VC8/src/curl.tmpl
61VC8_SRCVCPROJ = projects/Windows/VC8/src/curl.vcproj.dist
62VC8_SRCVCPROJ_DEPS = $(VC8_SRCTMPL) Makefile.am src/Makefile.inc
63
64VC9_LIBTMPL = projects/Windows/VC9/lib/libcurl.tmpl
65VC9_LIBVCPROJ = projects/Windows/VC9/lib/libcurl.vcproj.dist
66VC9_LIBVCPROJ_DEPS = $(VC9_LIBTMPL) Makefile.am lib/Makefile.inc
67VC9_SRCTMPL = projects/Windows/VC9/src/curl.tmpl
68VC9_SRCVCPROJ = projects/Windows/VC9/src/curl.vcproj.dist
69VC9_SRCVCPROJ_DEPS = $(VC9_SRCTMPL) Makefile.am src/Makefile.inc
70
71VC10_LIBTMPL = projects/Windows/VC10/lib/libcurl.tmpl
72VC10_LIBVCXPROJ = projects/Windows/VC10/lib/libcurl.vcxproj.dist
73VC10_LIBVCXPROJ_DEPS = $(VC10_LIBTMPL) Makefile.am lib/Makefile.inc
74VC10_SRCTMPL = projects/Windows/VC10/src/curl.tmpl
75VC10_SRCVCXPROJ = projects/Windows/VC10/src/curl.vcxproj.dist
76VC10_SRCVCXPROJ_DEPS = $(VC10_SRCTMPL) Makefile.am src/Makefile.inc
77
78VC11_LIBTMPL = projects/Windows/VC11/lib/libcurl.tmpl
79VC11_LIBVCXPROJ = projects/Windows/VC11/lib/libcurl.vcxproj.dist
80VC11_LIBVCXPROJ_DEPS = $(VC11_LIBTMPL) Makefile.am lib/Makefile.inc
81VC11_SRCTMPL = projects/Windows/VC11/src/curl.tmpl
82VC11_SRCVCXPROJ = projects/Windows/VC11/src/curl.vcxproj.dist
83VC11_SRCVCXPROJ_DEPS = $(VC11_SRCTMPL) Makefile.am src/Makefile.inc
84
85VC12_LIBTMPL = projects/Windows/VC12/lib/libcurl.tmpl
86VC12_LIBVCXPROJ = projects/Windows/VC12/lib/libcurl.vcxproj.dist
87VC12_LIBVCXPROJ_DEPS = $(VC12_LIBTMPL) Makefile.am lib/Makefile.inc
88VC12_SRCTMPL = projects/Windows/VC12/src/curl.tmpl
89VC12_SRCVCXPROJ = projects/Windows/VC12/src/curl.vcxproj.dist
90VC12_SRCVCXPROJ_DEPS = $(VC12_SRCTMPL) Makefile.am src/Makefile.inc
91
92VC14_LIBTMPL = projects/Windows/VC14/lib/libcurl.tmpl
93VC14_LIBVCXPROJ = projects/Windows/VC14/lib/libcurl.vcxproj.dist
94VC14_LIBVCXPROJ_DEPS = $(VC14_LIBTMPL) Makefile.am lib/Makefile.inc
95VC14_SRCTMPL = projects/Windows/VC14/src/curl.tmpl
96VC14_SRCVCXPROJ = projects/Windows/VC14/src/curl.vcxproj.dist
97VC14_SRCVCXPROJ_DEPS = $(VC14_SRCTMPL) Makefile.am src/Makefile.inc
98
99VC15_LIBTMPL = projects/Windows/VC15/lib/libcurl.tmpl
100VC15_LIBVCXPROJ = projects/Windows/VC15/lib/libcurl.vcxproj.dist
101VC15_LIBVCXPROJ_DEPS = $(VC15_LIBTMPL) Makefile.am lib/Makefile.inc
102VC15_SRCTMPL = projects/Windows/VC15/src/curl.tmpl
103VC15_SRCVCXPROJ = projects/Windows/VC15/src/curl.vcxproj.dist
104VC15_SRCVCXPROJ_DEPS = $(VC15_SRCTMPL) Makefile.am src/Makefile.inc
105
106VC_DIST = projects/README                           \
107 projects/build-openssl.bat                         \
108 projects/build-wolfssl.bat                         \
109 projects/checksrc.bat                              \
110 projects/Windows/VC6/curl-all.dsw                  \
111 projects/Windows/VC6/lib/libcurl.dsw               \
112 projects/Windows/VC6/src/curl.dsw                  \
113 projects/Windows/VC7/curl-all.sln                  \
114 projects/Windows/VC7/lib/libcurl.sln               \
115 projects/Windows/VC7/src/curl.sln                  \
116 projects/Windows/VC7.1/curl-all.sln                \
117 projects/Windows/VC7.1/lib/libcurl.sln             \
118 projects/Windows/VC7.1/src/curl.sln                \
119 projects/Windows/VC8/curl-all.sln                  \
120 projects/Windows/VC8/lib/libcurl.sln               \
121 projects/Windows/VC8/src/curl.sln                  \
122 projects/Windows/VC9/curl-all.sln                  \
123 projects/Windows/VC9/lib/libcurl.sln               \
124 projects/Windows/VC9/src/curl.sln                  \
125 projects/Windows/VC10/curl-all.sln                 \
126 projects/Windows/VC10/lib/libcurl.sln              \
127 projects/Windows/VC10/lib/libcurl.vcxproj.filters  \
128 projects/Windows/VC10/src/curl.sln                 \
129 projects/Windows/VC10/src/curl.vcxproj.filters     \
130 projects/Windows/VC11/curl-all.sln                 \
131 projects/Windows/VC11/lib/libcurl.sln              \
132 projects/Windows/VC11/lib/libcurl.vcxproj.filters  \
133 projects/Windows/VC11/src/curl.sln                 \
134 projects/Windows/VC11/src/curl.vcxproj.filters     \
135 projects/Windows/VC12/curl-all.sln                 \
136 projects/Windows/VC12/lib/libcurl.sln              \
137 projects/Windows/VC12/lib/libcurl.vcxproj.filters  \
138 projects/Windows/VC12/src/curl.sln                 \
139 projects/Windows/VC12/src/curl.vcxproj.filters     \
140 projects/Windows/VC14/curl-all.sln                 \
141 projects/Windows/VC14/lib/libcurl.sln              \
142 projects/Windows/VC14/lib/libcurl.vcxproj.filters  \
143 projects/Windows/VC14/src/curl.sln                 \
144 projects/Windows/VC14/src/curl.vcxproj.filters     \
145 projects/Windows/VC15/curl-all.sln                 \
146 projects/Windows/VC15/lib/libcurl.sln              \
147 projects/Windows/VC15/lib/libcurl.vcxproj.filters  \
148 projects/Windows/VC15/src/curl.sln                 \
149 projects/Windows/VC15/src/curl.vcxproj.filters     \
150 projects/generate.bat                              \
151 projects/wolfssl_options.h                         \
152 projects/wolfssl_override.props
153
154WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \
155 winbuild/MakefileBuild.vc winbuild/Makefile.vc
156
157EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \
158 RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework \
159 scripts/updatemanpages.pl $(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) \
160 lib/libcurl.vers.in buildconf.bat scripts/coverage.sh scripts/completion.pl
161
162CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \
163 $(VC71_LIBVCPROJ) $(VC71_SRCVCPROJ) $(VC8_LIBVCPROJ) $(VC8_SRCVCPROJ) \
164 $(VC9_LIBVCPROJ) $(VC9_SRCVCPROJ) $(VC10_LIBVCXPROJ) $(VC10_SRCVCXPROJ) \
165 $(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ) \
166 $(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ) $(VC15_LIBVCXPROJ) $(VC15_SRCVCXPROJ)
167
168bin_SCRIPTS = curl-config
169
170SUBDIRS = lib src
171DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs
172
173pkgconfigdir = $(libdir)/pkgconfig
174pkgconfig_DATA = libcurl.pc
175
176# List of files required to generate VC IDE .dsp, .vcproj and .vcxproj files
177include lib/Makefile.inc
178include src/Makefile.inc
179
180dist-hook:
181	rm -rf $(top_builddir)/tests/log
182	find $(distdir) -name "*.dist" -exec rm {} \;
183	(distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \
184	for file in $$distit; do \
185	  strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
186	  cp -p $$file $(distdir)$$strip; \
187	done)
188
189html:
190	cd docs && $(MAKE) html
191
192pdf:
193	cd docs && $(MAKE) pdf
194
195check: test examples check-docs
196
197if CROSSCOMPILING
198test-full: test
199test-torture: test
200
201test:
202	@echo "NOTICE: we can't run the tests when cross-compiling!"
203
204else
205
206test:
207	@(cd tests; $(MAKE) all quiet-test)
208
209test-full:
210	@(cd tests; $(MAKE) all full-test)
211
212test-nonflaky:
213	@(cd tests; $(MAKE) all nonflaky-test)
214
215test-torture:
216	@(cd tests; $(MAKE) all torture-test)
217
218test-event:
219	@(cd tests; $(MAKE) all event-test)
220
221test-am:
222	@(cd tests; $(MAKE) all am-test)
223
224endif
225
226examples:
227	@(cd docs/examples; $(MAKE) check)
228
229check-docs:
230	@(cd docs/libcurl; $(MAKE) check)
231
232# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
233# must contain the following line:
234# %_topdir /home/loic/local/rpm
235# and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc.
236#
237# cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS
238#
239# If additional configure flags are needed to build the package, add the
240# following in ~/.rpmmacros
241# %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS}
242# and run make rpm in the following way:
243# AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm
244#
245
246rpms:
247	$(MAKE) RPMDIST=curl rpm
248	$(MAKE) RPMDIST=curl-ssl rpm
249
250rpm:
251	RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \
252	cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \
253	cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \
254	rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \
255	mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \
256	mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
257
258#
259# Build a Solaris pkgadd format file
260# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format
261# file (which ends up back in this directory).
262# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do
263# pkgadd -d ./HAXXcurl-*
264#
265
266# gak - libtool requires an absolute directory, hence the pwd below...
267pkgadd:
268	umask 022 ; \
269	$(MAKE) install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \
270	cat COPYING > $(srcdir)/packages/Solaris/copyright ; \
271	cd $(srcdir)/packages/Solaris && $(MAKE) package
272
273#
274# Build a cygwin binary tarball installation file
275# resulting .tar.bz2 file will end up at packages/Win32/cygwin
276cygwinbin:
277	$(MAKE) -C packages/Win32/cygwin cygwinbin
278
279# We extend the standard install with a custom hook:
280install-data-hook:
281	cd include && $(MAKE) install
282	cd docs && $(MAKE) install
283	cd docs/libcurl && $(MAKE) install
284
285# We extend the standard uninstall with a custom hook:
286uninstall-hook:
287	cd include && $(MAKE) uninstall
288	cd docs && $(MAKE) uninstall
289	cd docs/libcurl && $(MAKE) uninstall
290
291ca-bundle: lib/mk-ca-bundle.pl
292	@echo "generating a fresh ca-bundle.crt"
293	@perl $< -b -l -u lib/ca-bundle.crt
294
295ca-firefox: lib/firefox-db2pem.sh
296	@echo "generating a fresh ca-bundle.crt"
297	./lib/firefox-db2pem.sh lib/ca-bundle.crt
298
299checksrc:
300	cd lib && $(MAKE) checksrc
301	cd src && $(MAKE) checksrc
302	cd tests && $(MAKE) checksrc
303	cd include/curl && $(MAKE) checksrc
304	cd docs/examples && $(MAKE) checksrc
305
306.PHONY: vc-ide
307
308vc-ide: $(VC6_LIBDSP_DEPS) $(VC6_SRCDSP_DEPS) $(VC7_LIBVCPROJ_DEPS) \
309 $(VC7_SRCVCPROJ_DEPS) $(VC71_LIBVCPROJ_DEPS) $(VC71_SRCVCPROJ_DEPS) \
310 $(VC8_LIBVCPROJ_DEPS) $(VC8_SRCVCPROJ_DEPS) $(VC9_LIBVCPROJ_DEPS) \
311 $(VC9_SRCVCPROJ_DEPS) $(VC10_LIBVCXPROJ_DEPS) $(VC10_SRCVCXPROJ_DEPS) \
312 $(VC11_LIBVCXPROJ_DEPS) $(VC11_SRCVCXPROJ_DEPS) $(VC12_LIBVCXPROJ_DEPS) \
313 $(VC12_SRCVCXPROJ_DEPS) $(VC14_LIBVCXPROJ_DEPS) $(VC14_SRCVCXPROJ_DEPS) \
314 $(VC15_LIBVCXPROJ_DEPS) $(VC15_SRCVCXPROJ_DEPS)
315	@(win32_lib_srcs='$(LIB_CFILES)'; \
316	win32_lib_hdrs='$(LIB_HFILES) config-win32.h'; \
317	win32_lib_rc='$(LIB_RCFILES)'; \
318	win32_lib_vauth_srcs='$(LIB_VAUTH_CFILES)'; \
319	win32_lib_vauth_hdrs='$(LIB_VAUTH_HFILES)'; \
320	win32_lib_vtls_srcs='$(LIB_VTLS_CFILES)'; \
321	win32_lib_vtls_hdrs='$(LIB_VTLS_HFILES)'; \
322	win32_src_srcs='$(CURL_CFILES)'; \
323	win32_src_hdrs='$(CURL_HFILES)'; \
324	win32_src_rc='$(CURL_RCFILES)'; \
325	win32_src_x_srcs='$(CURLX_CFILES)'; \
326	win32_src_x_hdrs='$(CURLX_HFILES) ../lib/config-win32.h'; \
327	\
328	sorted_lib_srcs=`for file in $$win32_lib_srcs; do echo $$file; done | sort`; \
329	sorted_lib_hdrs=`for file in $$win32_lib_hdrs; do echo $$file; done | sort`; \
330	sorted_lib_vauth_srcs=`for file in $$win32_lib_vauth_srcs; do echo $$file; done | sort`; \
331	sorted_lib_vauth_hdrs=`for file in $$win32_lib_vauth_hdrs; do echo $$file; done | sort`; \
332	sorted_lib_vtls_srcs=`for file in $$win32_lib_vtls_srcs; do echo $$file; done | sort`; \
333	sorted_lib_vtls_hdrs=`for file in $$win32_lib_vtls_hdrs; do echo $$file; done | sort`; \
334	sorted_src_srcs=`for file in $$win32_src_srcs; do echo $$file; done | sort`; \
335	sorted_src_hdrs=`for file in $$win32_src_hdrs; do echo $$file; done | sort`; \
336	sorted_src_x_srcs=`for file in $$win32_src_x_srcs; do echo $$file; done | sort`; \
337	sorted_src_x_hdrs=`for file in $$win32_src_x_hdrs; do echo $$file; done | sort`; \
338	\
339	awk_code='\
340function gen_element(type, dir, file)\
341{\
342  sub(/vauth\//, "", file);\
343  sub(/vtls\//, "", file);\
344\
345  spaces="    ";\
346  if(dir == "lib\\vauth" || dir == "lib\\vtls")\
347    tabs="				";\
348  else\
349    tabs="			";\
350\
351  if(type == "dsp") {\
352    printf("# Begin Source File\r\n");\
353    printf("\r\n");\
354    printf("SOURCE=..\\..\\..\\..\\%s\\%s\r\n", dir, file);\
355    printf("# End Source File\r\n");\
356  }\
357  else if(type == "vcproj1") {\
358    printf("%s<File\r\n", tabs);\
359    printf("%s	RelativePath=\"..\\..\\..\\..\\%s\\%s\">\r\n",\
360           tabs, dir, file);\
361    printf("%s</File>\r\n", tabs);\
362  }\
363  else if(type == "vcproj2") {\
364    printf("%s<File\r\n", tabs);\
365    printf("%s	RelativePath=\"..\\..\\..\\..\\%s\\%s\"\r\n",\
366           tabs, dir, file);\
367    printf("%s>\r\n", tabs);\
368    printf("%s</File>\r\n", tabs);\
369  }\
370  else if(type == "vcxproj") {\
371    i = index(file, ".");\
372    ext = substr(file, i == 0 ? 0 : i + 1);\
373\
374    if(ext == "c")\
375      printf("%s<ClCompile Include=\"..\\..\\..\\..\\%s\\%s\" />\r\n",\
376             spaces, dir, file);\
377    else if(ext == "h")\
378      printf("%s<ClInclude Include=\"..\\..\\..\\..\\%s\\%s\" />\r\n",\
379             spaces, dir, file);\
380    else if(ext == "rc")\
381      printf("%s<ResourceCompile Include=\"..\\..\\..\\..\\%s\\%s\" />\r\n",\
382      spaces, dir, file);\
383  }\
384}\
385\
386{\
387\
388  if($$0 == "CURL_LIB_C_FILES") {\
389    split(lib_srcs, arr);\
390    for(val in arr) gen_element(proj_type, "lib", arr[val]);\
391  }\
392  else if($$0 == "CURL_LIB_H_FILES") {\
393    split(lib_hdrs, arr);\
394    for(val in arr) gen_element(proj_type, "lib", arr[val]);\
395  }\
396  else if($$0 == "CURL_LIB_RC_FILES") {\
397    split(lib_rc, arr);\
398    for(val in arr) gen_element(proj_type, "lib", arr[val]);\
399  }\
400  else if($$0 == "CURL_LIB_VAUTH_C_FILES") {\
401    split(lib_vauth_srcs, arr);\
402    for(val in arr) gen_element(proj_type, "lib\\vauth", arr[val]);\
403  }\
404  else if($$0 == "CURL_LIB_VAUTH_H_FILES") {\
405    split(lib_vauth_hdrs, arr);\
406    for(val in arr) gen_element(proj_type, "lib\\vauth", arr[val]);\
407  }\
408  else if($$0 == "CURL_LIB_VTLS_C_FILES") {\
409    split(lib_vtls_srcs, arr);\
410    for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\
411  }\
412  else if($$0 == "CURL_LIB_VTLS_H_FILES") {\
413    split(lib_vtls_hdrs, arr);\
414    for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\
415  }\
416  else if($$0 == "CURL_SRC_C_FILES") {\
417    split(src_srcs, arr);\
418    for(val in arr) gen_element(proj_type, "src", arr[val]);\
419  }\
420  else if($$0 == "CURL_SRC_H_FILES") {\
421    split(src_hdrs, arr);\
422    for(val in arr) gen_element(proj_type, "src", arr[val]);\
423  }\
424  else if($$0 == "CURL_SRC_RC_FILES") {\
425    split(src_rc, arr);\
426    for(val in arr) gen_element(proj_type, "src", arr[val]);\
427  }\
428  else if($$0 == "CURL_SRC_X_C_FILES") {\
429    split(src_x_srcs, arr);\
430    for(val in arr) {\
431      sub(/..\/lib\//, "", arr[val]);\
432      gen_element(proj_type, "lib", arr[val]);\
433    }\
434  }\
435  else if($$0 == "CURL_SRC_X_H_FILES") {\
436    split(src_x_hdrs, arr);\
437    for(val in arr) {\
438      sub(/..\/lib\//, "", arr[val]);\
439      gen_element(proj_type, "lib", arr[val]);\
440    }\
441  }\
442  else\
443    printf("%s\r\n", $$0);\
444}';\
445	\
446	echo "generating '$(VC6_LIBDSP)'"; \
447	awk -v proj_type=dsp \
448		-v lib_srcs="$$sorted_lib_srcs" \
449		-v lib_hdrs="$$sorted_lib_hdrs" \
450		-v lib_rc="$$win32_lib_rc" \
451		-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
452		-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
453		-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
454		-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
455		"$$awk_code" $(srcdir)/$(VC6_LIBTMPL) > $(VC6_LIBDSP) || { exit 1; }; \
456	\
457	echo "generating '$(VC6_SRCDSP)'"; \
458	awk -v proj_type=dsp \
459		-v src_srcs="$$sorted_src_srcs" \
460		-v src_hdrs="$$sorted_src_hdrs" \
461		-v src_rc="$$win32_src_rc" \
462		-v src_x_srcs="$$sorted_src_x_srcs" \
463		-v src_x_hdrs="$$sorted_src_x_hdrs" \
464		"$$awk_code" $(srcdir)/$(VC6_SRCTMPL) > $(VC6_SRCDSP) || { exit 1; }; \
465	\
466	echo "generating '$(VC7_LIBVCPROJ)'"; \
467	awk -v proj_type=vcproj1 \
468		-v lib_srcs="$$sorted_lib_srcs" \
469		-v lib_hdrs="$$sorted_lib_hdrs" \
470		-v lib_rc="$$win32_lib_rc" \
471		-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
472		-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
473		-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
474		-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
475		"$$awk_code" $(srcdir)/$(VC7_LIBTMPL) > $(VC7_LIBVCPROJ) || { exit 1; }; \
476	\
477	echo "generating '$(VC7_SRCVCPROJ)'"; \
478	awk -v proj_type=vcproj1 \
479		-v src_srcs="$$sorted_src_srcs" \
480		-v src_hdrs="$$sorted_src_hdrs" \
481		-v src_rc="$$win32_src_rc" \
482		-v src_x_srcs="$$sorted_src_x_srcs" \
483		-v src_x_hdrs="$$sorted_src_x_hdrs" \
484		"$$awk_code" $(srcdir)/$(VC7_SRCTMPL) > $(VC7_SRCVCPROJ) || { exit 1; }; \
485	\
486	echo "generating '$(VC71_LIBVCPROJ)'"; \
487	awk -v proj_type=vcproj1 \
488		-v lib_srcs="$$sorted_lib_srcs" \
489		-v lib_hdrs="$$sorted_lib_hdrs" \
490		-v lib_rc="$$win32_lib_rc" \
491		-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
492		-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
493		-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
494		-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
495		"$$awk_code" $(srcdir)/$(VC71_LIBTMPL) > $(VC71_LIBVCPROJ) || { exit 1; }; \
496	\
497	echo "generating '$(VC71_SRCVCPROJ)'"; \
498	awk -v proj_type=vcproj1 \
499		-v src_srcs="$$sorted_src_srcs" \
500		-v src_hdrs="$$sorted_src_hdrs" \
501		-v src_rc="$$win32_src_rc" \
502		-v src_x_srcs="$$sorted_src_x_srcs" \
503		-v src_x_hdrs="$$sorted_src_x_hdrs" \
504		"$$awk_code" $(srcdir)/$(VC71_SRCTMPL) > $(VC71_SRCVCPROJ) || { exit 1; }; \
505	\
506	echo "generating '$(VC8_LIBVCPROJ)'"; \
507	awk -v proj_type=vcproj2 \
508		-v lib_srcs="$$sorted_lib_srcs" \
509		-v lib_hdrs="$$sorted_lib_hdrs" \
510		-v lib_rc="$$win32_lib_rc" \
511		-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
512		-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
513		-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
514		-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
515		"$$awk_code" $(srcdir)/$(VC8_LIBTMPL) > $(VC8_LIBVCPROJ) || { exit 1; }; \
516	\
517	echo "generating '$(VC8_SRCVCPROJ)'"; \
518	awk -v proj_type=vcproj2 \
519		-v src_srcs="$$sorted_src_srcs" \
520		-v src_hdrs="$$sorted_src_hdrs" \
521		-v src_rc="$$win32_src_rc" \
522		-v src_x_srcs="$$sorted_src_x_srcs" \
523		-v src_x_hdrs="$$sorted_src_x_hdrs" \
524		"$$awk_code" $(srcdir)/$(VC8_SRCTMPL) > $(VC8_SRCVCPROJ) || { exit 1; }; \
525	\
526	echo "generating '$(VC9_LIBVCPROJ)'"; \
527	awk -v proj_type=vcproj2 \
528		-v lib_srcs="$$sorted_lib_srcs" \
529		-v lib_hdrs="$$sorted_lib_hdrs" \
530		-v lib_rc="$$win32_lib_rc" \
531		-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
532		-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
533		-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
534		-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
535		"$$awk_code" $(srcdir)/$(VC9_LIBTMPL) > $(VC9_LIBVCPROJ) || { exit 1; }; \
536	\
537	echo "generating '$(VC9_SRCVCPROJ)'"; \
538	awk -v proj_type=vcproj2 \
539		-v src_srcs="$$sorted_src_srcs" \
540		-v src_hdrs="$$sorted_src_hdrs" \
541		-v src_rc="$$win32_src_rc" \
542		-v src_x_srcs="$$sorted_src_x_srcs" \
543		-v src_x_hdrs="$$sorted_src_x_hdrs" \
544		"$$awk_code" $(srcdir)/$(VC9_SRCTMPL) > $(VC9_SRCVCPROJ) || { exit 1; }; \
545	\
546	echo "generating '$(VC10_LIBVCXPROJ)'"; \
547	awk -v proj_type=vcxproj \
548		-v lib_srcs="$$sorted_lib_srcs" \
549		-v lib_hdrs="$$sorted_lib_hdrs" \
550		-v lib_rc="$$win32_lib_rc" \
551		-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
552		-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
553		-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
554		-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
555		"$$awk_code" $(srcdir)/$(VC10_LIBTMPL) > $(VC10_LIBVCXPROJ) || { exit 1; }; \
556	\
557	echo "generating '$(VC10_SRCVCXPROJ)'"; \
558	awk -v proj_type=vcxproj \
559		-v src_srcs="$$sorted_src_srcs" \
560		-v src_hdrs="$$sorted_src_hdrs" \
561		-v src_rc="$$win32_src_rc" \
562		-v src_x_srcs="$$sorted_src_x_srcs" \
563		-v src_x_hdrs="$$sorted_src_x_hdrs" \
564		"$$awk_code" $(srcdir)/$(VC10_SRCTMPL) > $(VC10_SRCVCXPROJ) || { exit 1; }; \
565	\
566	echo "generating '$(VC11_LIBVCXPROJ)'"; \
567	awk -v proj_type=vcxproj \
568		-v lib_srcs="$$sorted_lib_srcs" \
569		-v lib_hdrs="$$sorted_lib_hdrs" \
570		-v lib_rc="$$win32_lib_rc" \
571		-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
572		-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
573		-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
574		-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
575		"$$awk_code" $(srcdir)/$(VC11_LIBTMPL) > $(VC11_LIBVCXPROJ) || { exit 1; }; \
576	\
577	echo "generating '$(VC11_SRCVCXPROJ)'"; \
578	awk -v proj_type=vcxproj \
579		-v src_srcs="$$sorted_src_srcs" \
580		-v src_hdrs="$$sorted_src_hdrs" \
581		-v src_rc="$$win32_src_rc" \
582		-v src_x_srcs="$$sorted_src_x_srcs" \
583		-v src_x_hdrs="$$sorted_src_x_hdrs" \
584		"$$awk_code" $(srcdir)/$(VC11_SRCTMPL) > $(VC11_SRCVCXPROJ) || { exit 1; }; \
585	\
586	echo "generating '$(VC12_LIBVCXPROJ)'"; \
587	awk -v proj_type=vcxproj \
588		-v lib_srcs="$$sorted_lib_srcs" \
589		-v lib_hdrs="$$sorted_lib_hdrs" \
590		-v lib_rc="$$win32_lib_rc" \
591		-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
592		-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
593		-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
594		-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
595		"$$awk_code" $(srcdir)/$(VC12_LIBTMPL) > $(VC12_LIBVCXPROJ) || { exit 1; }; \
596	\
597	echo "generating '$(VC12_SRCVCXPROJ)'"; \
598	awk -v proj_type=vcxproj \
599		-v src_srcs="$$sorted_src_srcs" \
600		-v src_hdrs="$$sorted_src_hdrs" \
601		-v src_rc="$$win32_src_rc" \
602		-v src_x_srcs="$$sorted_src_x_srcs" \
603		-v src_x_hdrs="$$sorted_src_x_hdrs" \
604		"$$awk_code" $(srcdir)/$(VC12_SRCTMPL) > $(VC12_SRCVCXPROJ) || { exit 1; }; \
605	\
606	echo "generating '$(VC14_LIBVCXPROJ)'"; \
607	awk -v proj_type=vcxproj \
608		-v lib_srcs="$$sorted_lib_srcs" \
609		-v lib_hdrs="$$sorted_lib_hdrs" \
610		-v lib_rc="$$win32_lib_rc" \
611		-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
612		-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
613		-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
614		-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
615		"$$awk_code" $(srcdir)/$(VC14_LIBTMPL) > $(VC14_LIBVCXPROJ) || { exit 1; }; \
616	\
617	echo "generating '$(VC14_SRCVCXPROJ)'"; \
618	awk -v proj_type=vcxproj \
619		-v src_srcs="$$sorted_src_srcs" \
620		-v src_hdrs="$$sorted_src_hdrs" \
621		-v src_rc="$$win32_src_rc" \
622		-v src_x_srcs="$$sorted_src_x_srcs" \
623		-v src_x_hdrs="$$sorted_src_x_hdrs" \
624		"$$awk_code" $(srcdir)/$(VC14_SRCTMPL) > $(VC14_SRCVCXPROJ) || { exit 1; }; \
625	\
626	echo "generating '$(VC15_LIBVCXPROJ)'"; \
627	awk -v proj_type=vcxproj \
628		-v lib_srcs="$$sorted_lib_srcs" \
629		-v lib_hdrs="$$sorted_lib_hdrs" \
630		-v lib_rc="$$win32_lib_rc" \
631		-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
632		-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
633		-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
634		-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
635		"$$awk_code" $(srcdir)/$(VC15_LIBTMPL) > $(VC15_LIBVCXPROJ) || { exit 1; }; \
636	\
637	echo "generating '$(VC15_SRCVCXPROJ)'"; \
638	awk -v proj_type=vcxproj \
639		-v src_srcs="$$sorted_src_srcs" \
640		-v src_hdrs="$$sorted_src_hdrs" \
641		-v src_rc="$$win32_src_rc" \
642		-v src_x_srcs="$$sorted_src_x_srcs" \
643		-v src_x_hdrs="$$sorted_src_x_hdrs" \
644		"$$awk_code" $(srcdir)/$(VC15_SRCTMPL) > $(VC15_SRCVCXPROJ) || { exit 1; };)
645
646tidy:
647	(cd src && $(MAKE) tidy)
648	(cd lib && $(MAKE) tidy)
649