[Catalyst] Adding build scripts to Makefile.PL
Bill Moseley
moseley at hank.org
Tue May 11 13:49:02 GMT 2010
On Mon, May 10, 2010 at 9:31 PM, Florian Ragwitz <rafl at debian.org> wrote:
> On Mon, May 10, 2010 at 06:15:03PM -0700, Bill Moseley wrote:
> > I have a number of scrips that need to be run when building an
> > application. For example, I have a script that minifies javascript
> and
> > css. In many cases it's a real Makefile dependency -- need to run a
> > command to turn one file into another -- but in some cases don't know
> the
> > sources of the targets (i.e. a script just finds all .css files and
> > minifies them) so might just want to run a command every time "make"
> is
> > run.
>
> You can do globbing in your Makefile.PL, or use a script to just find
> the files, and have a target that depends on whatever the script
> outputed, or whatever.
>
Ok, thanks. Do you have an example you can share? Thankfully it's been
years since I created a Makefile by hand. ;)
Will that work in cases where there's no direct input and output files?
Seems I remember using .PHONEY targets when I needed to run programs that
didn't alway produce a direct output -- that or create flag files to compare
against.
I have build scripts that combine .js and .css files into collections and
then outputs four versions (text, gzipped, and both with a version string),
another that extracts text to localize from javascript and validates that
the strings can be looked up in a db, one that builds jemplate files and
another that builds .js from other sources. Some use File::Find to find
sources and others use config files. Another processes images and other
media. The source file list can be very large, of course.
> Anyone have examples of how to set this up in Makefile.PL (which uses
> > Module::Install)?
>
> Module::Install has a postamble() command to add makefile snippets to
> the generated Makefile.PL
>
I've used postamble to add new targets ("make foo") but I'm not clear how to
make just "make" depend on them. Maybe that's not the correct approach,
but I want our existing tools that build RPMs to run this code as part of
the normal make process .
Thanks,
-- =
Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100511/9d7be=
6be/attachment.htm
More information about the Catalyst
mailing list