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