all: $(MANPAGE)
$(MANPAGE): $(DPAGES) $(OTHERPAGES)
- @PERL@ gen.pl mainpage > $(MANPAGE)
+ @PERL@ $(srcdir)/gen.pl mainpage $(srcdir) > $(MANPAGE)
=end comment
=cut
-my $some_dir=".";
+my $some_dir=$ARGV[1] || ".";
opendir(my $dh, $some_dir) || die "Can't opendir $some_dir: $!";
my @s = grep { /\.d$/ && -f "$some_dir/$_" } readdir($dh);
sub single {
my ($f, $standalone)=@_;
- open(F, "<:crlf", "$f") ||
+ open(F, "<:crlf", "$some_dir/$f") ||
return 1;
my $short;
my $long;
sub getshortlong {
my ($f)=@_;
- open(F, "<:crlf", "$f");
+ open(F, "<:crlf", "$some_dir/$f");
my $short;
my $long;
my $help;
sub header {
my ($f)=@_;
- open(F, "<:crlf", "$f");
+ open(F, "<:crlf", "$some_dir/$f");
my @d;
while(<F>) {
push @d, $_;
}
} while($f);
- print "Usage: gen.pl <mainpage/listhelp/single FILE/protos>\n";
+ print "Usage: gen.pl <mainpage/listhelp/single FILE/protos> [srcdir]\n";
}
#------------------------------------------------------------------------
macos/src/curl_GUSIConfig.cpp macos/src/macos_main.cpp makefile.amiga \
curl.rc Makefile.netware Makefile.inc Makefile.Watcom CMakeLists.txt
-MANPAGE=$(top_srcdir)/docs/curl.1
+MANPAGE=$(top_builddir)/docs/curl.1
README=$(top_srcdir)/docs/MANUAL
MKHELP=$(top_srcdir)/src/mkhelp.pl
HUGE=tool_hugehelp.c
</name>
<command type="perl">
-%SRCDIR/manpage-scan.pl %SRCDIR/..
+%SRCDIR/manpage-scan.pl %SRCDIR/.. %PWD/..
</command>
</client>
use strict;
use warnings;
-# we may get the dir root pointed out
+# we may get the dir roots pointed out
my $root=$ARGV[0] || ".";
+my $buildroot=$ARGV[1] || ".";
my $syms = "$root/docs/libcurl/symbols-in-versions";
my $curlh = "$root/include/curl/curl.h";
my $errors=0;
#########################################################################
# parse the curl.1 man page, extract all documented command line options
-open(R, "<$root/docs/curl.1") ||
+open(R, "<$buildroot/docs/curl.1") ||
die "no input file";
my @manpage; # store all parsed parameters
while(<R>) {