saintmike has asked for the wisdom of the Perl Monks concerning the following question:

Is there a way to force make install in a Makefile created by either ExtUtils::MakeMaker or Module::Build to actually install all targets again, regardless if they already exist or not?

The default setting for make install is that that if a file already is installed (and wasn't modified), it won't get overwritten ("(skipped)" is displayed).

However, I'd like make install to overwrite the target again, for the purpose of watching it with installwatch -- is there a setting/env variable/make target to do that?

Replies are listed 'Best First'.
Re: MakeMaker/Module::Build force make install
by cog (Parson) on Mar 10, 2005 at 18:33 UTC
    I'm not sure of how to do that (assuming it is possible), but wouldn't a make clean before make install do the trick?
      Nope, unfortunately, this also results in

      Skipping /foo/bar/baz/Module.pm (unchanged)
        Whoops.

        I read make install, but my brain only parsed the make part.

Re: MakeMaker/Module::Build force make install
by Tanktalus (Canon) on Mar 10, 2005 at 19:54 UTC

    Can you "make uninstall" before "make install"? The only caveat here is that I'm not sure that make uninstall is completely clean. That should be ok if you're just about to reinstall anyway.

    Another choice is simply to touch all your source.

    I'm also thinking there is a make option ("man make") to ignore timestamps and rebuild all. I just don't remember it.

      Hmm ... there doesn't seem to be an uninstall target with Makefiles created by Module::Build:

      make uninstall make: don't know how to make uninstall. Stop
      ExtUtils::MakeMaker, on the other hand, supports uninstall.

      Oh, and touching the source doesn't trick make install into installing unchanged targets either:

      Skipping /foo/bar/baz/Module.pm (unchanged)
      Turns out that ExtUtils::Install checks the size and then calls compare of File::Compare which compares the content:
      if ( -f $targetfile && -s _ == $size) { # We have a good chance, we can skip this one $diff = compare($sourcefile, $targetfile); }
        ExtUtils::MakeMaker, on the other hand, supports uninstall
        But doesn't actually remove the files (at least on win32, this might be platform dependent behavior).

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.

        As for the comparing - this is what I call "the computer being too smart." It gets in the way of advanced users who know what they're doing. You may need to add your own target to your makefile which does what you want - largely defeating the entire purpose of a generalised Makefile maker.