Re: pp only to create executable when source has changed
by LanX (Saint) on Dec 01, 2012 at 20:22 UTC
|
| [reply] |
|
| [reply] |
|
| [reply] |
Re: pp only to create executable when source has changed
by hippo (Bishop) on Dec 01, 2012 at 23:13 UTC
|
Is there a reason not to use make for this? | [reply] |
|
Thx for the help
I'm not sure what you mean by this, I'm creating multiple executables. Every executable is doing it's own task and its started on a regular basis by the Windows taskmanager. Although the scripts are several hundred lines of code it takes easily 45 minutes to build the corresponding executable. I created a batch script to create all executables, what I like to see that it only creates new executables if the related source .pl file has changed
Is that possible with make? Does it record the creation date of the source?
| [reply] |
|
| [reply] |
Re: pp only to create executable when source has changed
by space_monk (Chaplain) on Dec 02, 2012 at 08:57 UTC
|
Adding more information to the succinct comment by hippo, I would have thought that all your projects would use Makefiles to be built in any event, so why not simply add a rule to build the .exe file using pp whenever the parent source file has changed?
A Monk aims to give answers to those who have none, and to learn from those who know more.
| [reply] |
Re: pp only to create executable when source has changed
by muba (Priest) on Dec 02, 2012 at 19:44 UTC
|
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";
}
}
| [reply] [d/l] |
|
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?
| [reply] [d/l] [select] |
|
| [reply] [d/l] [select] |
|
|
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)
| [reply] |
|
| [reply] |