Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Makefile. #436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

alissa-huskey
Copy link

I initially created this fork becaus when I ran make install the VERSION variable was not updated in todo.sh. So todo -V would produce:

TODO.TXT Command Line Interface v@DEV_VERSION@
...

But now I can't reproduce the problem. Shrug.

So instead: Here's a nicer Makefile if you want it!

Usage features:

  • Separate make build command that creates and populates the todo.txt_cli-*/ directory (and is in turn called by make dist.
  • A new make help command that lists all public targets.

Implementation changes:

  • VERSION-FILE is no longer generated every time make is run, only when required (by build/dist/clean etc, but test).
  • Refactored the dist target into separate file targets which is more atomic and make idiomatic. This may or may not be desirable as some people might find it confusing.
  • I added a bunch of missing .PHONY declarations.
  • Added lots of comments.

You can verify that the dist files are still generated correctly with the following:

mkdir -p tmp && cd tmp
git clone git@github.com:todotxt/todo.txt-cli.git todo
git clone --branch makefile git@github.com:alissa-huskey/todo.txt-cli.git todo-fork
mkdir dist dist-fork
make -C todo dist && make -C todo-fork dist
tar xzvf todo/*.tar.gz --directory ./dist && tar xzvf todo-fork/*.tar.gz --directory dist-fork

# confirm they contain the same files
diff <(ls dist/todo*/) <(ls dist-fork/todo*/)

# confirm the contents of all files are the same
for f in dist/todo*/*; do diff -w ${f} dist-fork/todo*/${f##*/} ; done

Hope you find it useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant