Makefile.mk: update to use Markdown sources for manual

Closes #14813
This commit is contained in:
Viktor Szakats 2024-09-06 11:36:46 +02:00
parent 9783c4540f
commit f6955e4215
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
2 changed files with 7 additions and 16 deletions

View File

@ -277,13 +277,11 @@ DEL = rm -f $1
COPY = -cp -afv $1 $2
MKDIR = mkdir -p $1
RMDIR = rm -fr $1
WHICH = $(SHELL) -c "command -v $1"
else
DEL = -del 2>NUL /q /f $(subst /,\,$1)
COPY = -copy 2>NUL /y $(subst /,\,$1) $(subst /,\,$2)
MKDIR = -md 2>NUL $(subst /,\,$1)
RMDIR = -rd 2>NUL /q /s $(subst /,\,$1)
WHICH = where $1
endif
all: $(TARGETS)

View File

@ -62,33 +62,26 @@ TOCLEAN := $(curl_OBJECTS)
### Rules
PERL ?= perl
PERL ?= perl
ifneq ($(wildcard tool_hugehelp.c.cvs),)
NROFF ?= groff
TOCLEAN += tool_hugehelp.c
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
# Load DPAGES
include $(PROOT)/docs/cmdline-opts/Makefile.inc
$(PROOT)/docs/cmdline-opts/curl.txt: $(addprefix $(PROOT)/docs/cmdline-opts/,$(DPAGES)) $(PROOT)/scripts/managen
cd $(PROOT)/docs/cmdline-opts && $(PERL) ../../scripts/managen ascii $(DPAGES) > curl.txt
# Necessary for the generated tools_hugehelp.c
CPPFLAGS += -DUSE_MANUAL
ifdef ZLIB
_MKHELPOPT += -c
endif
tool_hugehelp.c: $(PROOT)/docs/curl.1 mkhelp.pl
$(NROFF) -man -Tascii $(MANOPT) $< | \
$(PERL) mkhelp.pl $(_MKHELPOPT) $< > $@
tool_hugehelp.c: $(PROOT)/docs/cmdline-opts/curl.txt mkhelp.pl
$(PERL) mkhelp.pl $(_MKHELPOPT) < $< > $@
else
tool_hugehelp.c:
@echo Creating $@
@$(call COPY, $@.cvs, $@)
endif
endif
ifneq ($(CURL_CA_EMBED),)
TOCLEAN += tool_ca_embed.c