xref: /curl/Makefile.am (revision 41c03b4c)
1#***************************************************************************
2#                                  _   _ ____  _
3#  Project                     ___| | | |  _ \| |
4#                             / __| | | | |_) | |
5#                            | (__| |_| |  _ <| |___
6#                             \___|\___/|_| \_\_____|
7#
8# Copyright (C) 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.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# SPDX-License-Identifier: curl
22#
23###########################################################################
24
25AUTOMAKE_OPTIONS = foreign
26
27ACLOCAL_AMFLAGS = -I m4
28
29CMAKE_DIST =                                    \
30 CMake/cmake_uninstall.cmake.in                 \
31 CMake/CMakeConfigurableFile.in                 \
32 CMake/curl-config.cmake.in                     \
33 CMake/CurlSymbolHiding.cmake                   \
34 CMake/CurlTests.c                              \
35 CMake/FindBearSSL.cmake                        \
36 CMake/FindBrotli.cmake                         \
37 CMake/FindCARES.cmake                          \
38 CMake/FindGSS.cmake                            \
39 CMake/FindLibPSL.cmake                         \
40 CMake/FindLibSSH2.cmake                        \
41 CMake/FindMbedTLS.cmake                        \
42 CMake/FindMSH3.cmake                           \
43 CMake/FindNGHTTP2.cmake                        \
44 CMake/FindNGHTTP3.cmake                        \
45 CMake/FindNGTCP2.cmake                         \
46 CMake/FindQUICHE.cmake                         \
47 CMake/FindWolfSSL.cmake                        \
48 CMake/FindZstd.cmake                           \
49 CMake/Macros.cmake                             \
50 CMake/OtherTests.cmake                         \
51 CMake/PickyWarnings.cmake                      \
52 CMake/Platforms/WindowsCache.cmake             \
53 CMake/Utilities.cmake                          \
54 CMakeLists.txt
55
56VC_DIST = projects/README.md                           \
57 projects/build-openssl.bat                            \
58 projects/build-wolfssl.bat                            \
59 projects/checksrc.bat                                 \
60 projects/generate.bat                                 \
61 projects/wolfssl_options.h                            \
62 projects/wolfssl_override.props
63
64WINBUILD_DIST = winbuild/README.md winbuild/gen_resp_file.bat \
65 winbuild/MakefileBuild.vc winbuild/Makefile.vc winbuild/makedebug.cmd
66
67PLAN9_DIST = plan9/include/mkfile \
68 plan9/include/mkfile             \
69 plan9/mkfile.proto               \
70 plan9/mkfile                     \
71 plan9/README                     \
72 plan9/lib/mkfile.inc             \
73 plan9/lib/mkfile                 \
74 plan9/src/mkfile.inc             \
75 plan9/src/mkfile
76
77EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in       \
78 RELEASE-NOTES buildconf libcurl.pc.in $(CMAKE_DIST) $(VC_DIST)         \
79 $(WINBUILD_DIST) $(PLAN9_DIST) lib/libcurl.vers.in buildconf.bat       \
80 libcurl.def Dockerfile
81
82CLEANFILES = $(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ) \
83 $(VC14_10_LIBVCXPROJ) $(VC14_10_SRCVCXPROJ)       \
84 $(VC14_20_LIBVCXPROJ) $(VC14_20_SRCVCXPROJ)       \
85 $(VC14_30_LIBVCXPROJ) $(VC14_30_SRCVCXPROJ)
86
87bin_SCRIPTS = curl-config
88
89SUBDIRS = lib docs src scripts
90DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs
91
92pkgconfigdir = $(libdir)/pkgconfig
93pkgconfig_DATA = libcurl.pc
94
95# List of files required to generate VC IDE .dsp, .vcproj and .vcxproj files
96include lib/Makefile.inc
97include src/Makefile.inc
98
99dist-hook:
100	rm -rf $(top_builddir)/tests/log
101	find $(distdir) -name "*.dist" -exec rm {} \;
102	(distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \
103	for file in $$distit; do \
104	  strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
105	  cp -p $$file $(distdir)$$strip; \
106	done)
107
108check: test examples check-docs
109
110if CROSSCOMPILING
111test-full: test
112test-torture: test
113
114test:
115	@echo "NOTICE: we can't run the tests when cross-compiling!"
116
117else
118
119test:
120	@(cd tests; $(MAKE) all quiet-test)
121
122test-full:
123	@(cd tests; $(MAKE) all full-test)
124
125test-nonflaky:
126	@(cd tests; $(MAKE) all nonflaky-test)
127
128test-torture:
129	@(cd tests; $(MAKE) all torture-test)
130
131test-event:
132	@(cd tests; $(MAKE) all event-test)
133
134test-am:
135	@(cd tests; $(MAKE) all am-test)
136
137test-ci:
138	@(cd tests; $(MAKE) all ci-test)
139
140endif
141
142examples:
143	@(cd docs/examples; $(MAKE) check)
144
145check-docs:
146	@(cd docs/libcurl; $(MAKE) check)
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
162rpms:
163	$(MAKE) RPMDIST=curl rpm
164	$(MAKE) RPMDIST=curl-ssl rpm
165
166rpm:
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 absolute directory, hence the pwd below...
183pkgadd:
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
192cygwinbin:
193	$(MAKE) -C packages/Win32/cygwin cygwinbin
194
195# We extend the standard install with a custom hook:
196if BUILD_DOCS
197install-data-hook:
198	(cd include && $(MAKE) install)
199	(cd docs && $(MAKE) install)
200	(cd docs/libcurl && $(MAKE) install)
201else
202install-data-hook:
203	(cd include && $(MAKE) install)
204	(cd docs && $(MAKE) install)
205endif
206
207# We extend the standard uninstall with a custom hook:
208uninstall-hook:
209	(cd include && $(MAKE) uninstall)
210	(cd docs && $(MAKE) uninstall)
211	(cd docs/libcurl && $(MAKE) uninstall)
212
213ca-bundle: $(srcdir)/scripts/mk-ca-bundle.pl
214	@echo "generating a fresh ca-bundle.crt"
215	@perl $(srcdir)/scripts/mk-ca-bundle.pl -b -l -u lib/ca-bundle.crt
216
217ca-firefox: $(srcdir)/scripts/firefox-db2pem.sh
218	@echo "generating a fresh ca-bundle.crt"
219	$(srcdir)/scripts/firefox-db2pem.sh lib/ca-bundle.crt
220
221checksrc:
222	(cd lib && $(MAKE) checksrc)
223	(cd src && $(MAKE) checksrc)
224	(cd tests && $(MAKE) checksrc)
225	(cd include/curl && $(MAKE) checksrc)
226	(cd docs/examples && $(MAKE) checksrc)
227	(cd packages && $(MAKE) checksrc)
228
229tidy:
230	(cd src && $(MAKE) tidy)
231	(cd lib && $(MAKE) tidy)
232