I have lately been pondering the benefits of using project build tools such as make or Ant. Granted, this is not of immediate import to Perl, since there's no such thing as a perlc required for us to fiddle with, Thank Larry!

However, what I found myself doing in a hurry the other day was writing a project build script using Perl. This wasn't the first time either, which made me start chanting the Laziness is a Virtue mantra again...

And so it was, looking back on a long & mostly fruitful history of projects that apparently I had cobbled together using such things as make (most often), and then on occasion smatterings of shell scripts (always sh for compatability, though at the CMDline I use bash or tcsh for convenience..) , Ant a few times recently, and lots-O-hacked Perl code with system calls galone; meditating upon this I had a minor epiphany..

Thinking about how lovely it is to see something like the CPAN module in action determining system characteristics to adapt to perform an installation properly, I'm thinking Why would I use anything other than Perl?

Now I could have put this under Cool New Uses for Perl or under SoPW, but as a meditation I feel it's more of an opinion thing..

In the end I'm sure we all end us using What Works For Us anyway, but for the sake of conjecture, what are we monks using for project build scripts in Java, C, C++, C#(ack!), etc..? And wouldn't Perl be a more standardized way of implementing that (assuming you used modules rather than my bad example)?



Wait! This isn't a Parachute, this is a Backpack!

Replies are listed 'Best First'.
Re: make vs. Perl vs. sh vs. Ant
by Zaxo (Archbishop) on Sep 08, 2001 at 07:15 UTC

    If you examine the build structure of CPAN modules, you will find make under the hood. Makefile.PL is an ExtUtils::MakeMaker script which makes a Makefile from which make makes the module. (That last sentence took on a life of its own.)

    The rule-based structure of make, and its filetime pruning, are just what's needed in a build engine. Nothing prevents perl from duplicating that, but why bother? All the things perl does well are available to the Makefile writer through the shell. Scripts can be executed by path, and oneliners through 'perl -e'.

    The h2xs tool will set up a Makefile.PL for you. MakeMaker support is provided, and you will wind up with a distribution tree very like the ones on CPAN.

    After Compline,
    Zaxo

Re: make vs. Perl vs. sh vs. Ant
by seesik (Initiate) on Sep 08, 2001 at 08:02 UTC
    i've been using ant for all of my java projects. for those of you that are unfamiliar with this tool, check out the ant project page. its selling point is generally considered to be its config files, which are stored in xml and are pretty intuitive; relatively cross-platform stuff as long as you have a jre on your box. just fyi.