Skip to content

Commit

Permalink
Use Make variables for building F77 object files
Browse files Browse the repository at this point in the history
  • Loading branch information
zmughal committed Jan 2, 2022
1 parent 3df864a commit 3441cc9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,18 @@ sub MY::postamble {
my $mycflags = $f77->cflags;
my $orig = pdlpp_postamble(\@pack);
$orig =~ s/:\s*nonlinear\.pd/: nonlinear.pd/;
$orig .= <<EOF;
FC = $mycompiler
FFLAGS = $mycflags
FOPTIMIZE = -O3
FLDFLAGS = -fPIC
EOF

$orig .join "\n",map {
("
$_\$(OBJ_EXT): $_.f
$mycompiler -c -o $_\$(OBJ_EXT) $mycflags -O3 -fPIC $_.f
\$(FC) -c -o \$@ \$(FFLAGS) \$(FOPTIMIZE) \$(FLDFLAGS) \$<
" )} @ffiles;
}

0 comments on commit 3441cc9

Please sign in to comment.