Hi, monks.

I'm trying to rewrite rake, "build language" so it would fit within perl. If you don't know what is rake here you find all the info:

Rake project main page:
http://rake.rubyforge.org/

Rake syntax:
http://rake.rubyforge.org/files/doc/rakefile_rdoc.html

Rake tutorial:
http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial

In general it's a embedded domain specific language doing same things as the unix make util but it is using only ruby language

The source code of what I've done till this moment is available at
http://manta.univ.gda.pl/~ksuchoms/pake-final.tar.gz
You will find there:

pake - main app, definition of method available in Pakefile try running: ./pake -T
./pake test3
./pake program

I would like to know if I there are any other perl syntax rules which I could use in the Pakefile (Pakefile is like Makefile). Right now creating dependencies looks like this:

desc "task simply prints test";
task {
     print "test\n";
} "test";

task {
     print "test1\n";
     use Pod::Html;
} "test1" => "test";

desc "another boring description";
task {
     print "test2\n";
} "test2"=> "test";

task{
     print "test3\n";
} "test3" => "test2", "test1" ;

task method registers new task for example with the name test3 which depends on test2 and test1.

Secondly I would like to know how exactly the sort routine works. Because I don't understand how the $a $b variables are passed to the anonymous subroutine. I would like to create $task variable within the anonymous subroutine I'm passing to the task method.

I would like to know if you have some other idea how to create pure perl make tool.

Thanks, Krzysiek.


In reply to Perl - make tool by Krzysiek

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.