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

how to create a makefile using PAR::Packer

by gepebril69 (Beadle)
on Dec 10, 2012 at 12:12 UTC ( #1008092=perlquestion: print w/ replies, xml ) Need Help??
gepebril69 has asked for the wisdom of the Perl Monks concerning the following question:

Hi there

I'm working with Perl for quite some years on small scripts. As I'm doing a bigger project I see the use using a makefile like people do with C(++) projects.

Is this possible with pp to, and does anyone has an example of how to do this using require files in scripts. I haven't found any example of how to do this on the Net. I must say that I never created a makefile.

Yours sincerely

Albert

Comment on how to create a makefile using PAR::Packer
Re: how to create a makefile using PAR::Packer
by ww (Bishop) on Dec 10, 2012 at 14:55 UTC
    Your SOPW baffles me (perhaps because of my own iggerance or deficient caffination) but some clarification would help:
    1. Would Module::Build work?
    2. How does Par Packer fit your intent?
    3. What is it that you're building that requires a makfile?
    4. How does the concept/functionality of require play a role?

      What does SOPW mean?

      1) I don't want to build Perl modules, but executables

      2) To build executables like: pp -o file.exe --link=C:\strawberry\c\bin\libmysql_.dll -x -c -vvv file.pl

      3) I have a project that consists of several .pl that I want to turn into .exe file (Windows). I can build them with a .bat file containing the pp calls but that does not include dependencies. So I want to make a new .exe if a related .pl file has changed, including the .pl file used by require

      4) When .pl are used within a .pl file the .exe. depends on them aswel

Re: how to create a makefile using PAR::Packer
by karlgoethebier (Curate) on Dec 10, 2012 at 15:18 UTC

    I read this: pp only to create executable when source has changed

    Update: Perhaps this helps:

    Makefile

    hello: hello.pl Foo.pm pp hello.pl -o hello.exe

    Foo.pm

    package Foo; # test1 1;

    hello.pl

    #!/c:/perl/bin/perl use lib q(.); use Foo; print "Hello!\n";

    First call of dmake builds hello.exe. Next call shows `hello' is up to date. Change Foo.pm and run dmake.

    Search

    Update: Another weird use of make ;-) 28.13 make Isn't Just for Programmers! in "Unix Power Tools"

    OK, i've bought the book and i hope Tim doesn't blame...

    manual: ch01.fmt ch02.fmt ch03.fmt lp ch0[1-3].fmt ch01.fmt: ch01 nroff -mm ch01 > ch01.fmt ch02.fmt: ch02 tbl ch02 | nroff -mm > ch02.fmt ch03.fmt: ch03a ch03b ch03c nroff -mm ch03[abc] > ch03.fmt

    Best Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

      Thx for the replay

      What is the use of the Foo.pm in this story and why do you need it?

      In the last example you are using Visual Fox pro examples, why is this?, I thought this was a Perl forum and for me it makes it more confusing?

        Thx for the replay

        My pleasure.

        At pp only to create executable when source has changed you wrote:

        As the projects get bigger it takes longer before executables are created, what I would like and not have found yet is that executables are only created when the source (pl) has been changed. So executables are not recreated when no changes to sources have been made.

        In my simple example Foo.pm is a source file - and only when it is changed, pp is run.

        In the last example you are using Visual Fox pro examples, why is this?

        I can't see any Visual Fox Pro example for the moment, sorry. So i can't answer why this is. Please correct my if i'm wrong.

        I thought this was a Perl forum and for me it makes it more confusing?

        Nothing but the truth, this is a Perl forum - but it doesn't confuse you.

        I hope that helps.

        Best regards, Karl

        Update: P.S.: I'm about loosing my faith...please correct my if i'm wrong.

        «The Crux of the Biscuit is the Apostrophe»

Re: how to create a makefile using PAR::Packer
by Anonymous Monk on Dec 10, 2012 at 23:08 UTC

      Thanks for all help so far, although I don't have the feeling I'm closer to the solution. I think the solution provided aren't either what I'm looking for, or I'm missing some steps so I don't see the solution.

      What I'm looking for is something like this (in own created syntax)

      pp -o file1.exe --link=C:\strawberry\c\bin\libmysql_.dll -x -c -vvv f +ile1.pl dependenc: file_basicfunc.pl, file_vars.pl pp -o file2.exe --link=C:\strawberry\c\bin\libmysql_.dll -x -c -vvv f +ile2.pl dependenc: file_basicfunc.pl, file_vars.pl, file1.pl pp -o file3.exe --link=C:\strawberry\c\bin\libmysql_.dll -x -c -vvv f +ile3.pl dependenc: file_basicfunc.pl, file_vars.pl

      Unfortunately I have to do this project on Windows

      Or is it possible to create .exe on Linux used for Windows, my guts say no

        "Or is it possible to create .exe on Linux used for Windows, my guts say no"

        Your guts and the documentation are in agreement. See PAR::FAQ or http://par.perl.org.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2014-09-18 19:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (121 votes), past polls