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
I initially created this fork becaus when I ran
make install
theVERSION
variable was not updated intodo.sh
. Sotodo -V
would produce:But now I can't reproduce the problem. Shrug.
So instead: Here's a nicer Makefile if you want it!
Usage features:
make build
command that creates and populates thetodo.txt_cli-*/
directory (and is in turn called bymake dist
.make help
command that lists all public targets.Implementation changes:
VERSION-FILE
is no longer generated every timemake
is run, only when required (bybuild
/dist
/clean
etc, buttest
).dist
target into separate file targets which is more atomic andmake
idiomatic. This may or may not be desirable as some people might find it confusing..PHONY
declarations.You can verify that the dist files are still generated correctly with the following:
Hope you find it useful!