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)
### 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