git-extras icon indicating copy to clipboard operation
git-extras copied to clipboard

Revamp makefile

Open apjanke opened this issue 8 years ago • 11 comments

Work-in-progress. Please don't merge yet.

This PR revamps the build process and Makefile as suggested in #463. It gives the user more configuration options for customizing the installation. This will also be useful for packagers like Homebrew, which currently needs to patch the distribution. And it sets things up for local execution and testing of the commands.

This is a good-sized change, so no reason to merge it right away. We can review/discuss/test first.

Closes #463 Closes #442 Closes #228

  • Adds an intermediate make build target that generates working commands in a local build/ dir, so you can test it without installing it
    • make install continues to work as before, automatically calling make build if needed. (You will need to manually make clean if you change the source code between repeated installs from the same source directory.)
  • Adds an option to disable the self-update feature, which is needed by external package managers like Homebrew
  • Adds an option to disable selected commands (as requested in #442, #228)
  • Adds an option to have it skip all or install all commands that conflict with aliases, without prompting. With this you can do a fully noninteractive installation
  • Revises manpage generation code to be consistent between the Makefile and man/manning-up.sh.
  • Generates HTML for the non-man-page documentation, too, and installs it to $PREFIX/share/doc
  • Folds the windows-specific stuff into install.sh and removes the updateForWindows() special case

The separate Makefile.msys still exists; I don't have a setup for testing that.

apjanke avatar Dec 28 '15 20:12 apjanke

:+1:

hemanth avatar Dec 29 '15 04:12 hemanth

Thanks hemanth!

Okay, hold on: I figured out an easy way to do per-file builds for the commands and fix the updated-dependency problem, so they get properly rebuilt on subsequent make installs even without intervening make clean|build. Let me roll that in before you form firm opinions...

apjanke avatar Dec 29 '15 06:12 apjanke

Okay, I've added per-file builds and fixed the dependency problem.

This new mechanism does away with the hardcoded logic for including libraries that was in the Makefile or main command building script and replaces it with #@@ include: @@ directives, so you can see a command's dependencies when looking at the command's source code itself. It then adds a conditional-inclusion directive to support doing the "disable self-update" with this mechanism.

apjanke avatar Dec 30 '15 04:12 apjanke

@spacewander Got some time for this?

hemanth avatar Jan 05 '16 10:01 hemanth

I am reading the diff now. It may take me some time to make a feedback.

spacewander avatar Jan 05 '16 11:01 spacewander

@apjanke
I suggest rewriting tools/build_command from perl to bash. IMHO, we should make git-extras only depend on bash and other coreutils. Perl is out of scope.

spacewander avatar Jan 05 '16 13:01 spacewander

I've rebased the branch on master and addressed most of the line notes.

apjanke avatar Jan 05 '16 20:01 apjanke

I suggest rewriting tools/build_command from perl to bash. IMHO, we should make git-extras only depend on bash and other coreutils. Perl is out of scope.

Hmm. Sorry; I wasn't really thinking about dependencies when I wrote this.

You could probably re-write build_command as a sed command with a bash wrapper around it, especially if you removed the conditional-inclusion feature. I'll see if that's doable.

apjanke avatar Jan 06 '16 02:01 apjanke

Hey, just wanted to check in on the status of this.

We're planning on having a release tomorrow (it's been 1 month since the last release), but we can push this to the next monthly release if it's not ready.

qw3rtman avatar Jan 24 '16 20:01 qw3rtman

Not ready, or close to it. Let's wait until next monthly release.

apjanke avatar Jan 24 '16 22:01 apjanke

Sure, moved it to the next milestone. Thank you so much for this contribution!

qw3rtman avatar Jan 24 '16 23:01 qw3rtman