views:

25

answers:

2

It is clear that the target is newer than the source from these two ls comands:

[metaperl@andLinux ~/edan/pkg/gist.el] ls -l ../../wares/gist.el/gist.elc #target
-rw-r--r-- 1 metaperl metaperl 10465 Jul 18 10:56 ../../wares/gist.el/gist.elc
[metaperl@andLinux ~/edan/pkg/gist.el] ls -l yank/gist.el/gist.el #source
-rw-r--r-- 1 metaperl metaperl 13025 Jul 18 10:57 yank/gist.el/gist.el
[metaperl@andLinux ~/edan/pkg/gist.el] 

However when I run makepp -v I am told that this rule depends not only on the listed target, but also on the cd and mv commands.

makepplog: Targets /home/metaperl/edan/wares/gist.el/gist.elc' depend on/usr/local/bin/emacs', /home/metaperl/edan/pkg/gist.el/yank/gist.el/gist.el', /bin/mv'

What aspect of make logic dictates that the actions to produce the target are part of the dependency chain of deciding on whether to make the target?

To my mind, only the listed sources should affect whether or not the target is rebuilt.

The entire makepp -v output is quite long, and exists at: http://gist.github.com/480468

My makepp file:

include main.makepp

#VER
PKG := gist.el
URL := http://github.com/defunkt/$(PKG).git

TARGET := $(WARES)gist.el/gist.elc

$(TARGET) : yank/gist.el/gist.el
    cd $(dir $(input)) && $(BYTECOMPILE) gist.el
    mv $(dir $(input)) $(WARES)
    perl {{
        print 'github username: ';
        my $username = <STDIN>;
        print 'github API token: ';
        my $api_token = <STDIN>;
        system "git config --global github.user $username";
        system "git config --global github.token $api_token";
        use File::Butler;
        my $lines = Butler('init.el', 'read');
        my $loc = sprintf '%s%s', $EDAN_PKG, "$PKG/";
        $lines =~ s/__LOC__/$loc/g;
        $lines =~ s/__PKG__/$PKG/g;
        Butler( $EDAN_EL, prepend => \$lines );
    }}

yank/gist.el/gist.el : yank
    cd yank && git clone http://github.com/defunkt/gist.el.git

yank:
    mkdir yank

$(phony clean):
    $(RM) -rf $(dir $(TARGET)) yank
+1  A: 

With a standard make, the contents of the commands to make a target are not taken into account when deciding whether to rebuild the target. Only the dependencies are taken into account; this can go beyond the source if you have dependencies declared elsewhere.

You don't show your makeppfile, so I can't be sure, but the Parsing command... messages from makepp -v make me suspect that makepp behaves differently from standard make on this count.

Gilles
Gilles you said:The contents of the commands to make a target are not taken into account when deciding whether to rebuild the target.But the log clearly stated:makepplog: Targets /home/metaperl/edan/wares/gist.el/gist.elc' depend on/usr/local/bin/emacs', /home/metaperl/edan/pkg/gist.el/yank/gist.el/gist.el', /bin/mv'...the Mapkeppfile is at pastebin here - http://pastebin.com/QF9tb4FQI dont have enough characters to paste it here.
thequietcenter
@thequietcenter: makepp's behavior differs from standard make (which is what the title of your question seems to be addressing). In fact I thought you were trying to confirm that the behavior that surprised you was indeed an incompatibility between make and makepp. Since makepp claims to be a compatible replacement of make, if you're using the latest version of makepp and don't find the differences amongst the documented incompatibilities, you might want to make a bug report.
Gilles
A: 

makepp will rebuild a target if any of the dependencies have changed or if the command has changes. In your case, I suspect that either some of the variables that you use in the rule to make $(TARGET) have changed or that makepp is seeing that the commands are constructed dynamically and is automatically rebuilding the target. Try using the -m target_newer option to makepp to force it to use the old GNU make method (that is, only re-build if the source is newer than the target).

Link

bta