include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
add_custom_command(OUTPUT "${MANPAGE}"
- COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" "./gen.pl" mainpage ${DPAGES} > "${MANPAGE}"
- COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" "./gen.pl" ascii ${DPAGES} > "${ASCIIPAGE}"
+ COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/scripts/managen mainpage ${DPAGES} > "${MANPAGE}"
+ COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/scripts/managen ascii ${DPAGES} > "${ASCIIPAGE}"
VERBATIM
)
add_custom_target(generate-curl.1 ALL DEPENDS "${MANPAGE}")
## Generate
-`./gen.pl mainpage`
+`managen mainpage [list of markdown option file names]`
This command outputs a single huge nroff file, meant to become `curl.1`. The
full curl man page.
-`./gen.pl listhelp`
+`managen ascii [list of markdown option file names]`
+
+This command outputs a single text file, meant to become `curl.txt`. The full
+curl man page in text format, used to build `tool_hugehelp.c`.
+
+`managen listhelp`
Generates a full `curl --help` output for all known command line options.
include Makefile.inc
-EXTRA_DIST = $(DPAGES) MANPAGE.md gen.pl $(SUPPORT) CMakeLists.txt mainpage.idx
+EXTRA_DIST = $(DPAGES) MANPAGE.md $(SUPPORT) CMakeLists.txt mainpage.idx
GEN = $(GN_$(V))
GN_0 = @echo " GENERATE" $@;
GN_1 =
GN_ = $(GN_0)
+MANAGEN=$(abs_top_srcdir)/scripts/managen
+
if BUILD_DOCS
CLEANFILES = $(MANPAGE) $(ASCIIPAGE)
endif
-$(MANPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc gen.pl
- $(GEN)(rm -f $(MANPAGE) && (cd $(srcdir) && @PERL@ ./gen.pl mainpage $(DPAGES)) > manpage.tmp.$$$$ && mv manpage.tmp.$$$$ $(MANPAGE))
+$(MANPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN)
+ $(GEN)(rm -f $(MANPAGE) && (cd $(srcdir) && @PERL@ $(MANAGEN) mainpage $(DPAGES)) > manpage.tmp.$$$$ && mv manpage.tmp.$$$$ $(MANPAGE))
-$(ASCIIPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc gen.pl
- $(GEN)(rm -f $(ASCIIPAGE) && (cd $(srcdir) && @PERL@ ./gen.pl ascii $(DPAGES)) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE))
+$(ASCIIPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN)
+ $(GEN)(rm -f $(ASCIIPAGE) && (cd $(srcdir) && @PERL@ $(MANAGEN) ascii $(DPAGES)) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE))
listhelp:
- ./gen.pl listhelp $(DPAGES) > $(top_builddir)/src/tool_listhelp.c
+ $(MANAGEN) listhelp $(DPAGES) > $(top_builddir)/src/tool_listhelp.c
+
+listcats:
+ @$(MANAGEN) listcats $(DPAGES)
###########################################################################
EXTRA_DIST = coverage.sh completion.pl firefox-db2pem.sh checksrc.pl \
- mk-ca-bundle.pl schemetable.c cd2nroff nroff2cd cdall cd2cd
+ mk-ca-bundle.pl schemetable.c cd2nroff nroff2cd cdall cd2cd managen
ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@
FISH_FUNCTIONS_DIR = @FISH_FUNCTIONS_DIR@
This script generates the manpage.
-Example: gen.pl <command> [files] > curl.1
+Example: managen <command> [files] > curl.1
Dev notes:
.\\" *
.\\" **************************************************************************
.\\"
-.\\" DO NOT EDIT. Generated by the curl project gen.pl man page generator.
+.\\" DO NOT EDIT. Generated by the curl project managen man page generator.
.\\"
.TH curl 1 "$date" "curl $version" "curl Manual"
HEADER
return;
}
- print "Usage: gen.pl <mainpage/ascii/listhelp/single FILE/protos/listcats> [files]\n";
+ print "Usage: managen <mainpage/ascii/listhelp/single FILE/protos/listcats> [files]\n";
}
#------------------------------------------------------------------------
/*
* The bitmask output is generated with the following command
------------------------------------------------------------
- cd $srcroot/docs/cmdline-opts
- ./gen.pl listcats *.d
+ make -C docs/cmdline-opts listcats
*/
#define CURLHELP_HIDDEN 1u << 0u
</name>
<command type="perl">
-%SRCDIR/../docs/cmdline-opts/gen.pl listhelp %SRCDIR/../docs/cmdline-opts/*.md
+%SRCDIR/../scripts/managen listhelp %SRCDIR/../docs/cmdline-opts/*.md
</command>
</client>