Makefile.mk: address minor issues

- Fix `NROFF` auto-detection with certain shell/make-build combinations:

  When a non-MSYS2 GNU Make runs inside an MSYS2 shell, Make executes
  the detection command as-is via `CreateProcess()`. It fails because
  `command` is an `sh` built-in. Ensure to explicitly invoke the shell.

- Initialize user-customizable variables:

  Silences a list of warnings when running GNU Make with the option
  `--warn-undefined-variables`. Another benefit is that it's now easy
  to look up all user-customizable `Makefile.mk` variables by grepping
  for ` ?=` in the curl source tree.

  Suggested-by: Gisle Vanem
  Ref: https://github.com/curl/curl/pull/9764#issuecomment-1330674433

- Fix `MKDIR` invocation:

  Avoid a warning and potential issue in envs without forward-slash
  support.

Closes #10000
This commit is contained in:
Viktor Szakats 2022-12-02 15:20:41 +00:00
parent 73c4f9696a
commit 8fc2423338
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
2 changed files with 17 additions and 8 deletions

View file

@ -84,7 +84,7 @@ NROFF ?= groff
TOCLEAN += tool_hugehelp.c
ifneq ($(shell $(WHICH) $(NROFF)),)
ifneq ($(shell $(call WHICH, $(NROFF))),)
$(PROOT)/docs/curl.1: $(wildcard $(PROOT)/docs/cmdline-opts/*.d)
cd $(PROOT)/docs/cmdline-opts && \
$(PERL) gen.pl mainpage $(notdir $^) > ../curl.1