OBJECT => 'PPPort$(OBJ_EXT) module2$(OBJ_EXT) module3$(OBJ_EXT)',
XSPROTOARG => '-noprototypes',
'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" },
- 'clean' => { FILES => 'ppport.h'},
+ 'clean' => { FILES => [qw(ppport.h ppport_h)]},
);
sub MY::postamble {
+ return <<"EOM";
- my $pmfile = 'PPPort.pm' ;
+ppport.h: ppport_h
+ \$(TOUCH) ppport_h
- my $retval = <<"EOM";
-
-ppport.h: ppport_h.PL
- \$(PERL) "-I\$(PERL_ARCHLIB)" "-I\$(PERL_LIB)" ppport_h.PL
-
-PPPort.xs module2.\$(OBJ_EXT) module3.\$(OBJ_EXT) : ppport.h
- -\$(TOUCH) \$@
+PPPort.xs module2\$(OBJ_EXT) module3\$(OBJ_EXT): ppport.h
EOM
-
- return $retval;
}
-my $pmfile = 'PPPort.pm';
package Devel::PPPort;
sub bootstrap {};
-require qq[$pmfile];
-WriteFile(qq[ppport.h]);
+require "PPPort.pm";
+WriteFile("ppport.tmp");
+{
+ local $/;
+ my $old = '';
+ my $new = '';
+ $old = <FH> if open(FH, "ppport.h"); close FH;
+ $new = <FH> if open(FH, "ppport.tmp"); close FH;
+ if ($old ne $new) {
+ unlink("ppport.h");
+ rename("ppport.tmp", "ppport.h");
+ }
+ unlink("ppport.tmp");
+}
+