Making make depend easy

Autrijus,

I'd like for it to be easy for a Makefile to know all the dependencies
of a pp-generated executable, since mine depends on a large number of
locally maintained .pm files.  I just modified pp by adding a new
option which then results in this code being executed right after the
call to Module::ScanDeps (I named the option -m after gcc's -M, since
-M was already taken for pp, but probably --depend would be better):

    if ($Options->{m}) {
        print join(" \\\n\t", map($map{$_}{file}, keys %map))."\n";
        exit 0;
    }

I then put this into my Makefile:

myapp.dep:
        echo -n "myapp.exe: " > myapp.dep
        $(PP) $(PPFLAGS) -m myapp.pl >> myapp.dep

-include myapp.dep

Probably there is a less kludgy way to do this, and I'd love to see it
in a future release of PAR.  Until then, though, I'm happy to use my
local hack.

Is there already a way to do this that I'm missing?

Thanks,

Barry
0
barry
4/6/2003 3:07:27 AM
perl.par 1177 articles. 0 followers. Follow

0 Replies
852 Views

Similar Articles

[PageSpeed] 18

Reply: