Here is the (at least tested under Windows) Makefile.PL that I've settled
on:
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
my @list_of_db_files = ('db/ECO','db/NIC','db/Opening');
WriteMakefile(
'NAME' => 'Chess::PGN::EPD',
'VERSION_FROM' => 'EPD.pm', # finds $VERSION
'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'EPD.pm', # retrieve abstract from module
AUTHOR => 'Hugh S. Myers <[EMAIL PROTECTED]>') : ()),
);
sub MY::post_constants {
join("\n",
'INSTALL_DB_FILES=$(INSTALLSITELIB)/Chess/PGN/db',
"DB_FILES=@list_of_db_files");
}
sub MY::postamble { <<'EXTRA';
install :: install.dbfiles
install.dbfiles:: $(DB_FILES)
$(MKPATH) $(INSTALL_DB_FILES)
$(CP) $(DB_FILES) $(INSTALL_DB_FILES)
all :: FORCE
$(PERL) scripts/db.pl
FORCE:
EXTRA
}
Some things to notice here:
1. since 'NIX style paths work under DOS, but not the other way round use
'NIX style. (Also remember that 'NIX is case sensitive.)
2. don't forget rule one for both file names and target!
3. don't count on 'make tardist' to copy empty directories. If in manifest,
you get error message, if not--how would it know?
Lesson: build what you need!
4. count on your script being repeated and change output and action
accordingly. First time says 'Building ... ok', second
time says '... exists'.
--hsm