Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add Makefile for easy installation

  • Loading branch information...
commit 0782f0b2876646db36b772a058b20960775a7c91 1 parent d36b1e9
@livibetter authored
Showing with 44 additions and 1 deletion.
  1. +4 −0 CHANGES.mkd
  2. +22 −0 Makefile
  3. +18 −1 README.mkd
View
4 CHANGES.mkd
@@ -1,6 +1,10 @@
Changelog
=========
+## Version 1.0.2 (2012-04-21T17:14:23Z)
+
+ * Add Makefile for easy installation
+
## Version 1.0.1 (2012-01-18T20:42:10Z)
* Make test script print out the testing parameters, such as -P, -p, etc.
View
22 Makefile
@@ -0,0 +1,22 @@
+PREFIX=/usr/local
+DESTDIR=
+
+INSTDIR=$(DESTDIR)$(PREFIX)
+INSTBIN=$(INSTDIR)/bin
+
+all:
+ @echo do nothing. try targets: install, uninstall, or test.
+
+install:
+ test -d $(INSTDIR) || mkdir -p $(INSTDIR)
+ test -d $(INSTBIN) || mkdir -p $(INSTBIN)
+
+ install -m 0755 td.sh $(INSTBIN)
+
+uninstall:
+ rm -f $(INSTBIN)/td.sh
+
+test:
+ ./td-test.sh
+
+.PHONY: all install uninstall test
View
19 README.mkd
@@ -3,6 +3,23 @@ td.sh
Converting seconds to human readable time duration.
+Installation
+------------
+
+By default, to install to `/usr/local`, run:
+
+ $ make install
+
+Or to `/usr`:
+
+ $ make install PREFIX=/usr
+
+Or to your home:
+
+ $ make install PREFIX=$HOME
+
+To uninstall, use `uninstall` target with `PREFIX` if supplied during installation.
+
Usage
-----
@@ -45,7 +62,7 @@ You can source the script to have `print_td` function for better performance:
Tests
-----
-There is a script named `td-test.sh` for testing.
+There is a script named `td-test.sh` for testing, you can also run `make test`.
Links
-----
Please sign in to comment.
Something went wrong with that request. Please try again.