Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: pp only to create executable when source has changed

by muba (Priest)
on Dec 02, 2012 at 19:44 UTC ( #1006753=note: print w/ replies, xml ) Need Help??


in reply to pp only to create executable when source has changed

my %files = "source1.pl" => " source1.exe", "source2.pl" => " source2.exe", ... "source375.pl" => " source375.exe", ); while (my ($source, $exe) = keys %files) { my ($source, $exe) = splice(@ARGV, 0, 2); if (-m $source > -m $exe) { system "pp -o $exe --link=C:\strawberry\c\bin\libmysql_.dll -x + -c -vvv $source"; } }


Comment on Re: pp only to create executable when source has changed
Download Code
Re^2: pp only to create executable when source has changed (pseudocode)
by LanX (Canon) on Dec 02, 2012 at 20:20 UTC
    Sorry but

        if (-m $source > -m $exe) {

    where do I find the docs of this -m function?

    UPDATE:

         while (my ($source, $exe) = keys %files) {

    did you really mean keys? not each?

             my ($source, $exe) = splice(@ARGV, 0, 2);

    and now your directly overwriting the loop vars?

    Cheers Rolf

      You raise valid points. -m should have been -M, keys should have been each, and that splice line shouldn't be there at all. My bad.

        Thanks for pointing me to -M, I didn't know that it exists.

        OTOH it's practically useless because it only counts in days, it's very hard to imagine a valid usecase!

        (Beside maybe log-rotation on a daily basis)

        forget my last remarks, wrong tests indicated complete days, but actually floats are fine!

        Cheers Rolf

Re^2: pp only to create executable when source has changed
by gepebril69 (Beadle) on Dec 04, 2012 at 00:28 UTC

    Aha, I get it, you make a script that checks the date of modification of a file. If the modification time of the .pl (perl script) is greater than the corresponding .exe (executable file), you generate a new executable.

    Never looked at the problem from this angle. But this wont help you 100% on the dependencies, like when I require a .pl, which store the genetal subroutines. So now I get the use and power of a make file

    So final stage is finding a good example of a makefile using PAR:Packer, so pp instead of cc so I can parse my code into)

      Has anyone an idea of how to do this as GNU make seems to be quite complex for a newbie like me and all examples are in C.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006753]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2015-07-07 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls