build: fix portability of mancheck and checksrc targets

At least FreeBSD preserves cwd across makefile lines, so rules
consisting of more than one "cd X; do_something" must be explicitly run
in a subshell to avoid this. This problem caused the Cirrus FreeBSD
build to fail when parallel make jobs were enabled.
This commit is contained in:
Dan Fandrich 2023-09-01 14:51:32 -07:00
parent 78e0938fcc
commit 5949369c9f
2 changed files with 5 additions and 5 deletions

View File

@ -54,7 +54,7 @@ pdf: $(PDFPAGES)
echo "converted $< to $@")
mancheck:
@cd $(top_srcdir)/docs/libcurl/opts && ls `awk -F, '!/OBSOLETE/ && /^ CINIT/ { a=substr($$1, 9); print "CURLOPT_" a ".3"}' $(top_srcdir)/include/curl/curl.h`
@(cd $(top_srcdir)/docs/libcurl/opts && ls `awk -F, '!/OBSOLETE/ && /^ CINIT/ { a=substr($$1, 9); print "CURLOPT_" a ".3"}' $(top_srcdir)/include/curl/curl.h`)
rm -f in_temp
@(for a in $(man_MANS); do echo $$a >>in_temp; done)
sort in_temp > in_makefile

View File

@ -117,10 +117,10 @@ event-test: perlcheck all
echo "converted $< to $@")
checksrc:
cd libtest && $(MAKE) checksrc
cd unit && $(MAKE) checksrc
cd server && $(MAKE) checksrc
cd http && $(MAKE) checksrc
(cd libtest && $(MAKE) checksrc)
(cd unit && $(MAKE) checksrc)
(cd server && $(MAKE) checksrc)
(cd http && $(MAKE) checksrc)
if CURLDEBUG
# for debug builds, we scan the sources on all regular make invokes