xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | #*************************************************************************** |
| 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 | |
| 25 | HTMLPAGES = testcurl.html runtests.html |
| 26 | PDFPAGES = testcurl.pdf runtests.pdf |
| 27 | MANDISTPAGES = runtests.1.dist testcurl.1.dist |
| 28 | |
| 29 | EXTRA_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 | |
| 39 | DISTCLEANFILES = 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). |
| 44 | if BUILD_UNITTESTS |
| 45 | BUILD_UNIT = unit |
| 46 | DIST_UNIT = |
| 47 | else |
| 48 | BUILD_UNIT = |
| 49 | DIST_UNIT = unit |
| 50 | endif |
| 51 | |
| 52 | SUBDIRS = certs data server libtest $(BUILD_UNIT) |
| 53 | DIST_SUBDIRS = $(SUBDIRS) $(DIST_UNIT) |
| 54 | |
| 55 | PERLFLAGS = -I$(srcdir) |
| 56 | |
| 57 | CLEANFILES = .http.pid .https.pid .ftp.pid .ftps.pid $(MANDISTPAGES) |
| 58 | |
| 59 | MAN2HTML= roffit $< >$@ |
| 60 | |
| 61 | curl: |
| 62 | @cd $(top_builddir) && $(MAKE) |
| 63 | |
| 64 | if CROSSCOMPILING |
| 65 | TEST = @echo "NOTICE: we can't run the tests when cross-compiling!" |
| 66 | else # if not cross-compiling: |
| 67 | TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl |
| 68 | TEST_Q = -a -s |
| 69 | TEST_AM = -a -am |
| 70 | TEST_F = -a -p -r |
| 71 | TEST_T = -a -t |
| 72 | TEST_E = -a -e |
| 73 | |
| 74 | # !flaky means that it'll skip all tests using the flaky keyword |
| 75 | TEST_NF = -a -p !flaky |
| 76 | |
| 77 | # special CI target derived from nonflaky with CI-specific flags |
| 78 | TEST_CI = $(TEST_NF) -rm |
| 79 | endif |
| 80 | |
| 81 | # make sure that PERL is pointing to an executable |
| 82 | perlcheck: |
| 83 | @if ! test -x "$(PERL)"; then echo "No perl!"; exit 2; fi |
| 84 | |
| 85 | test: perlcheck all |
| 86 | $(TEST) $(TFLAGS) |
| 87 | |
| 88 | quiet-test: perlcheck all |
| 89 | $(TEST) $(TEST_Q) $(TFLAGS) |
| 90 | |
| 91 | am-test: perlcheck all |
| 92 | $(TEST) $(TEST_AM) $(TFLAGS) |
| 93 | |
| 94 | ci-test: perlcheck all |
| 95 | $(TEST) $(TEST_CI) $(TFLAGS) |
| 96 | |
| 97 | full-test: perlcheck all |
| 98 | $(TEST) $(TEST_F) $(TFLAGS) |
| 99 | |
| 100 | nonflaky-test: perlcheck all |
| 101 | $(TEST) $(TEST_NF) $(TFLAGS) |
| 102 | |
| 103 | torture-test: perlcheck all |
| 104 | $(TEST) $(TEST_T) $(TFLAGS) |
| 105 | |
| 106 | event-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 | |
| 119 | checksrc: |
| 120 | cd libtest && $(MAKE) checksrc |
| 121 | cd unit && $(MAKE) checksrc |
| 122 | cd server && $(MAKE) checksrc |
| 123 | |
| 124 | if CURLDEBUG |
| 125 | # for debug builds, we scan the sources on all regular make invokes |
| 126 | all-local: checksrc |
| 127 | endif |