aboutsummaryrefslogtreecommitdiff
path: root/docs/cmdline-opts
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2017-02-06 22:47:41 +0100
committerDan Fandrich <dan@coneharvesters.com>2017-02-06 23:37:05 +0100
commitedb2d028551e54a4f328a8798353ca3cffef875e (patch)
treea187fce8ae180f6d7d847117ac3ee1c303fe5f71 /docs/cmdline-opts
parent88bdd7cf6fba438bbb3d89641bf03b14e8feead6 (diff)
cmdline-opts: Fixed build and test in out of source tree builds
Diffstat (limited to 'docs/cmdline-opts')
-rw-r--r--docs/cmdline-opts/Makefile.am2
-rwxr-xr-xdocs/cmdline-opts/gen.pl10
2 files changed, 6 insertions, 6 deletions
diff --git a/docs/cmdline-opts/Makefile.am b/docs/cmdline-opts/Makefile.am
index 3467de156..c844bca4f 100644
--- a/docs/cmdline-opts/Makefile.am
+++ b/docs/cmdline-opts/Makefile.am
@@ -73,4 +73,4 @@ EXTRA_DIST = $(DPAGES) MANPAGE.md gen.pl $(OTHERPAGES)
all: $(MANPAGE)
$(MANPAGE): $(DPAGES) $(OTHERPAGES)
- @PERL@ gen.pl mainpage > $(MANPAGE)
+ @PERL@ $(srcdir)/gen.pl mainpage $(srcdir) > $(MANPAGE)
diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl
index 89a5df845..91e893f3e 100755
--- a/docs/cmdline-opts/gen.pl
+++ b/docs/cmdline-opts/gen.pl
@@ -16,7 +16,7 @@ Unfortunately it seems some perls like msysgit can't handle a global input-only
=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);
@@ -101,7 +101,7 @@ sub added {
sub single {
my ($f, $standalone)=@_;
- open(F, "<:crlf", "$f") ||
+ open(F, "<:crlf", "$some_dir/$f") ||
return 1;
my $short;
my $long;
@@ -235,7 +235,7 @@ sub single {
sub getshortlong {
my ($f)=@_;
- open(F, "<:crlf", "$f");
+ open(F, "<:crlf", "$some_dir/$f");
my $short;
my $long;
my $help;
@@ -281,7 +281,7 @@ sub indexoptions {
sub header {
my ($f)=@_;
- open(F, "<:crlf", "$f");
+ open(F, "<:crlf", "$some_dir/$f");
my @d;
while(<F>) {
push @d, $_;
@@ -371,7 +371,7 @@ sub getargs {
}
} while($f);
- print "Usage: gen.pl <mainpage/listhelp/single FILE/protos>\n";
+ print "Usage: gen.pl <mainpage/listhelp/single FILE/protos> [srcdir]\n";
}
#------------------------------------------------------------------------