Attached is my Makefile.PL, with a few MY::* methods to allow the use of
Objective-C.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Mac::BridgeSupport',
VERSION_FROM => 'lib/Mac/BridgeSupport.pm',
ABSTRACT_FROM => 'lib/Mac/BridgeSupport.pm',
AUTHOR => 'Sherm Pendley <[email protected]@gmail.com>',
LIBS => ['-lobjc'],
INC => '-I.',
XS => { 'BridgeSupport.xs' => 'BridgeSupport.m' },
OBJECT => '$(O_FILES)',
);
# Add some required machinery to support .m files
package MY;
sub c_o {
my $inherited = shift->SUPER::c_o(@_);
$inherited .= <<'EOMESS';
.m$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.m
EOMESS
$inherited;
}
sub xs_c {
my $inherited = shift->SUPER::xs_c(@_);
$inherited .= <<'EOMESS';
.xs.m:
$(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $(XSUBPP_EXTRA_ARGS) $*.xs >
$*.xsm && $(MV) $*.xsm $*.m
EOMESS
$inherited;
}
sub init_dirscan {
my $self = shift;
$self->SUPER::init_dirscan;
foreach my $name ($self->lsdir($self->curdir)) {
next unless $name =~ /\.m$/;
push @{$self->{'C'}}, $name;
$name =~ s/\.m$/$self->{'OBJ_EXT'}/;
push @{$self->{'O_FILES'}}, $name;
}
}