Skip to content

Commit

Permalink
move Core/*.h* to Basic/lib/
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Nov 11, 2024
1 parent 9f45ec6 commit a1393be
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 37 deletions.
4 changes: 3 additions & 1 deletion Basic/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
script/pdl
lib/PDL/Core/pdl.h
lib/PDL/Core/pdlperl.h
lib/PDL/Types.pm
script/pdl
2 changes: 1 addition & 1 deletion Basic/Bad/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use File::Spec::Functions;
my @pack = (["bad.pd",qw(Bad PDL::Bad)]);

my %hash = pdlpp_stdargs_int(@pack);
$hash{depend} = { 'Bad$(OBJ_EXT)' => catfile(updir, qw(Core pdlperl.h)) };
$hash{depend} = { 'Bad$(OBJ_EXT)' => catfile(updir, qw(lib PDL Core pdlperl.h)) };

undef &MY::postamble; # suppress warning
*MY::postamble = sub {
Expand Down
2 changes: 0 additions & 2 deletions Basic/Core/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
Core.c
pdl.h
pdlperl.h
12 changes: 4 additions & 8 deletions Basic/Core/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,30 @@ undef &MY::postamble; # suppress warning
$text;
};

my $hdeps = join ' ', map catfile(updir, qw(lib PDL Core), $_), qw(pdl.h pdlperl.h pdlcore.h pdlbroadcast.h pdlmagic.h);
my @cfiles = qw(pdlcore pdlapi pdlbroadcast pdlconv pdlmagic pdlaffine pdlutil);
my $cobj = join ' ', map qq{$_\$(OBJ_EXT)}, @cfiles;
WriteMakefile(
NAME => 'PDL::Core',
VERSION_FROM => '../lib/PDL.pm',
PM => {
(map +($_,'$(INST_LIBDIR)/'.$_), qw/Core.pm/),
(map +($_,'$(INST_LIBDIR)/Core/'.$_),
qw/pdl.h pdlperl.h pdlcore.h pdlmagic.h
pdlbroadcast.h ppport.h/
),
},
OBJECT => 'Core$(OBJ_EXT) ' . $cobj,
DEFINE => $pthread_define,
LIBS => [$libs_string],
clean => {'FILES' =>
"pdl.h pdlperl.h Core.c"
"Core.c"
},
INC => join(' ',
PDL::Core::Dev::PDL_INCLUDE(),
map {length($_) ? qq{"$_"} : ()} $pthread_include
),
TYPEMAPS => [PDL::Core::Dev::PDL_TYPEMAP()],
depend => {
'Core$(OBJ_EXT)' => '$(INST_ARCHLIB)$(DFSEP).exists pm_to_blib pdl.h pdlperl.h pdlcore.h',
'Core$(OBJ_EXT)' => '$(INST_ARCHLIB)$(DFSEP).exists pm_to_blib '.$hdeps,
# Core.xs needs blib/arch for -Mblib to work, as well as pm_to_blib
$cobj => 'pdl.h pdlcore.h pdlbroadcast.h pdlmagic.h',
'pdlcore$(OBJ_EXT)' => 'pdlperl.h',
$cobj => $hdeps,
},
NO_MYMETA => 1,
);
1 change: 1 addition & 0 deletions Basic/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ WriteMakefile(
EXE_FILES => \@exe_files,
clean => { FILES => join ' ',
qw(MANIFEST.bak _Inline/ .inlinepdlpp/ .inlinewith/ .pptest/), @cleanup,
(map catfile(qw(lib PDL Core), $_), qw(pdl.h pdlperl.h)),
},
NO_MYMETA => 1,
);
Expand Down
2 changes: 1 addition & 1 deletion Basic/Ufunc/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ my @pack = (["ufunc.pd", qw(Ufunc PDL::Ufunc)]);

my %hash = pdlpp_stdargs_int(@pack);
$hash{LIBS}->[0] .= ' -lm';
$hash{depend} = { 'pp-bandover$(OBJ_EXT)' => catfile(updir, qw(Core pdlperl.h)) };
$hash{depend} = { 'pp-bandover$(OBJ_EXT)' => catfile(updir, qw(lib PDL Core pdlperl.h)) };

undef &MY::postamble; # suppress warning
*MY::postamble = sub {
Expand Down
17 changes: 4 additions & 13 deletions Basic/lib/PDL/Core/Dev.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,8 @@ our @EXPORT = qw( isbigendian
);

# Installation locations
sub PDL_INCLUDE {
my $w = whereami_any();
$w = dirname(dirname $w) if !-f catfile($w, qw(Core pdlcore.h)); # in repo
'"-I'.catdir($w, 'Core').'"'
}
sub PDL_TYPEMAP {
catfile(whereami_any(), qw(Core typemap))
}
sub PDL_INCLUDE { '"-I'.catdir(whereami_any(), 'Core').'"' }
sub PDL_TYPEMAP { catfile(whereami_any(), qw(Core typemap)) }

# The INST are here still just in case we want to change something later.
*PDL_INST_INCLUDE = \&PDL_INCLUDE;
Expand Down Expand Up @@ -89,7 +83,6 @@ EOR
use Cwd qw/abs_path/;
my $MY_FILE = abs_path(__FILE__); # capture at load-time because EUMM chdirs
my $MY_DIR2 = dirname(dirname($MY_FILE));
my $IS_INST = $MY_DIR2 =~ /PDL\W*$/i;
sub whereami_any { $MY_DIR2 } # something containing "Core/Dev.pm"

=head2 isbigendian
Expand Down Expand Up @@ -153,13 +146,11 @@ sub _postamble {
? map "\$($_)", _mod_vars($mod)
: _mod_values($internal, $src, $pref, $multi_c);
if ($internal) {
my $top = File::Spec::Functions::abs2rel(catdir($w, (updir())x2));
my $core = catdir($top, qw(Basic Core));
my $top = File::Spec::Functions::abs2rel(dirname dirname $w);
$pmdep .= join ' ', '',
catfile($top, qw(Basic pm_to_blib)),
catfile($core, qw(pm_to_blib)),
;
$cdep .= join ' ', $ppo, ':', map catfile($core, $_),
$cdep .= join ' ', $ppo, ':', map catfile($top, qw(Basic lib PDL Core), $_),
qw(pdl.h pdlcore.h pdlbroadcast.h pdlmagic.h);
} else {
my $oneliner = _oneliner(qq{exit if \$ENV{DESTDIR}; use PDL::Doc; eval { PDL::Doc::add_module(q{$mod}); }});
Expand Down
2 changes: 1 addition & 1 deletion Basic/Core/pdl.h.PL → Basic/lib/PDL/Core/pdl.h.PL
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use strict;
use warnings;

require '../lib/PDL/Types.pm';
require './lib/PDL/Types.pm';

my $file = shift @ARGV;
print "Extracting $file\n";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use strict;
use warnings;
use Config; # for ivsize

require '../lib/PDL/Types.pm';
require './lib/PDL/Types.pm';

my $file = shift @ARGV;
print "Extracting $file\n";
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@ Basic/Bad/Makefile.PL
Basic/Core/Core.pm
Basic/Core/Core.xs
Basic/Core/Makefile.PL
Basic/Core/pdl.h.PL
Basic/Core/pdlaffine.c
Basic/Core/pdlapi.c
Basic/Core/pdlbroadcast.c
Basic/Core/pdlbroadcast.h
Basic/Core/pdlconv.c
Basic/Core/pdlcore.c
Basic/Core/pdlcore.h
Basic/Core/pdlmagic.c
Basic/Core/pdlmagic.h
Basic/Core/pdlperl.h.PL
Basic/Core/pdlutil.c
Basic/Core/ppport.h
Basic/examples/Benchmark/Bench.pm
Basic/examples/Benchmark/Bench.xs
Basic/examples/Benchmark/Makefile.PL
Expand Down Expand Up @@ -84,6 +78,12 @@ Basic/lib/PDL/Complex/Overloads.pm
Basic/lib/PDL/Config.pm
Basic/lib/PDL/Constants.pm
Basic/lib/PDL/Core/Dev.pm
Basic/lib/PDL/Core/pdl.h.PL
Basic/lib/PDL/Core/pdlbroadcast.h
Basic/lib/PDL/Core/pdlcore.h
Basic/lib/PDL/Core/pdlmagic.h
Basic/lib/PDL/Core/pdlperl.h.PL
Basic/lib/PDL/Core/ppport.h
Basic/lib/PDL/Core/typemap
Basic/lib/PDL/Course.pod
Basic/lib/PDL/Dataflow.pod
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ RCS
\b_eumm/
^Basic/Bad/Bad\..*
^Basic/Core/Core\.c$
^Basic/Core/pdl\.h$
^Basic/Core/pdlperl\.h$
^Basic/lib/PDL/Core/pdl\.h$
^Basic/lib/PDL/Core/pdlperl\.h$
^Basic/Gen/PP/Dump\.pm$
^Basic/Gen/PP/Dump\.pm\.tmp$
^Basic/Gen/pptemplate.pod$
Expand Down
1 change: 0 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ sub coretarget {
[
coregen => [
[ [ qw(Basic) ], [ qw(pm_to_blib) ], ],
[ [ qw(Basic Core) ], [ qw(pm_to_blib) ], ], # for pdl.h etc
]
],
[
Expand Down

0 comments on commit a1393be

Please sign in to comment.