blob: 829e125d25735a69c63da4b45e25eadd9fab7284 [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001#***************************************************************************
2# _ _ ____ _
3# Project ___| | | | _ \| |
4# / __| | | | |_) | |
5# | (__| |_| | _ <| |___
6# \___|\___/|_| \_\_____|
7#
8# Copyright (C) 1998 - 2022, 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
25HTMLPAGES = testcurl.html runtests.html
26PDFPAGES = testcurl.pdf runtests.pdf
27MANDISTPAGES = runtests.1.dist testcurl.1.dist
28
29EXTRA_DIST = ftpserver.pl httpserver.pl secureserver.pl runtests.pl \
30 getpart.pm FILEFORMAT.md README.md stunnel.pem memanalyze.pl testcurl.pl \
31 valgrind.pm ftp.pm sshserver.pl sshhelp.pm pathhelp.pm testcurl.1 runtests.1 \
32 serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl \
33 CMakeLists.txt mem-include-scan.pl valgrind.supp extern-scan.pl \
34 manpage-scan.pl nroff-scan.pl http2-server.pl dictserver.py \
35 negtelnetserver.py smbserver.py util.py \
36 disable-scan.pl manpage-syntax.pl error-codes.pl badsymbols.pl \
37 azure.pm appveyor.pm version-scan.pl options-scan.pl markdown-uppercase.pl
38
39DISTCLEANFILES = configurehelp.pm
40
41# we have two variables here to make sure DIST_SUBDIRS won't get 'unit'
42# added twice as then targets such as 'distclean' misbehave and try to
43# do things twice in that subdir at times (and thus fails).
44if BUILD_UNITTESTS
45BUILD_UNIT = unit
46DIST_UNIT =
47else
48BUILD_UNIT =
49DIST_UNIT = unit
50endif
51
52SUBDIRS = certs data server libtest $(BUILD_UNIT)
53DIST_SUBDIRS = $(SUBDIRS) $(DIST_UNIT)
54
55PERLFLAGS = -I$(srcdir)
56
57CLEANFILES = .http.pid .https.pid .ftp.pid .ftps.pid $(MANDISTPAGES)
58
59MAN2HTML= roffit $< >$@
60
61curl:
62 @cd $(top_builddir) && $(MAKE)
63
64if CROSSCOMPILING
65TEST = @echo "NOTICE: we can't run the tests when cross-compiling!"
66else # if not cross-compiling:
67TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl
68TEST_Q = -a -s
69TEST_AM = -a -am
70TEST_F = -a -p -r
71TEST_T = -a -t
72TEST_E = -a -e
73
74# !flaky means that it'll skip all tests using the flaky keyword
75TEST_NF = -a -p !flaky
76
77# special CI target derived from nonflaky with CI-specific flags
78TEST_CI = $(TEST_NF) -rm
79endif
80
81# make sure that PERL is pointing to an executable
82perlcheck:
83 @if ! test -x "$(PERL)"; then echo "No perl!"; exit 2; fi
84
85test: perlcheck all
86 $(TEST) $(TFLAGS)
87
88quiet-test: perlcheck all
89 $(TEST) $(TEST_Q) $(TFLAGS)
90
91am-test: perlcheck all
92 $(TEST) $(TEST_AM) $(TFLAGS)
93
94ci-test: perlcheck all
95 $(TEST) $(TEST_CI) $(TFLAGS)
96
97full-test: perlcheck all
98 $(TEST) $(TEST_F) $(TFLAGS)
99
100nonflaky-test: perlcheck all
101 $(TEST) $(TEST_NF) $(TFLAGS)
102
103torture-test: perlcheck all
104 $(TEST) $(TEST_T) $(TFLAGS)
105
106event-test: perlcheck all
107 $(TEST) $(TEST_E) $(TFLAGS)
108
109.1.html:
110 $(MAN2HTML)
111
112.1.pdf:
113 @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \
114 groff -Tps -man $< >$$foo.ps; \
115 ps2pdf $$foo.ps $@; \
116 rm $$foo.ps; \
117 echo "converted $< to $@")
118
119checksrc:
120 cd libtest && $(MAKE) checksrc
121 cd unit && $(MAKE) checksrc
122 cd server && $(MAKE) checksrc
123
124if CURLDEBUG
125# for debug builds, we scan the sources on all regular make invokes
126all-local: checksrc
127endif