Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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.exe", "" => " source2.exe", ... "" => " 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"; } }

Replies are listed 'Best First'.
Re^2: pp only to create executable when source has changed (pseudocode)
by LanX (Bishop) 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?


         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 (Scribe) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006753]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2018-02-24 13:08 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (310 votes). Check out past polls.