| 1 | #!/usr/bin/env perl | ||||||||||
| 2 | |||||||||||
| 3 | # Copyright (c) 2015-2019 Christian Jaeger, copying@christianjaeger.ch | ||||||||||
| 4 | # This is free software. See the file COPYING.md that came bundled | ||||||||||
| 5 | # with this file. | ||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use warnings FATAL => 'uninitialized'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | use Cwd 'abs_path'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | our ($mydir, $myname); | |||||||||
| 13 | |||||||||||
| 14 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=3 SCAR=11.7
| |||||||||||
| 15 | 1 | ▶ | my $location = (-l $0) ? abs_path($0) : $0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 1 | ▶ | $location =~ /(.*?)([^\/]+?)_?\z/s or die "?"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 1 | ($mydir, $myname) = ($1, $2); | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 1 | ▶ | unless ($ENV{SUB_CALL_TAIL}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 1 | ▶ | use lib "./meta"; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | 1 | require FunctionalPerl::TailExpand; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 1 | ▶ | chdir $mydir or die "chdir $mydir: $!"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | |||||||||||
| 27 | 1 | my $inbase = ".."; | |||||||||
| 28 | 1 | my $outbase = "www"; | |||||||||
| 29 | 1 | my $configpath = "./gen-config.pl"; | |||||||||
| 30 | |||||||||||
| 31 | # make it work by default without Sub::Call::Tail: | ||||||||||
| 32 | 1 | ▶ | my $prefix = $ENV{SUB_CALL_TAIL} ? "" : "."; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | |||||||||||
| 34 | 1 | my $gen = "../${prefix}htmlgen/gen"; | |||||||||
| 35 | |||||||||||
| 36 | 1 | ▶ | exec $^X, $gen, $configpath, $inbase, $outbase, @ARGV | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | or die | ||||||||||
| 38 | "possibly missing '$gen', run 'meta/tail-expand' (or simply 'make test') first"; | ||||||||||