about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThordur Bjornsson <thorduri@secnorth.net>2012-11-05 15:41:52 +0100
committerThordur Bjornsson <thorduri@secnorth.net>2012-11-05 15:42:48 +0100
commit5c96ff2741fb36c5b9e793a55bd8a8a0bef76021 (patch)
tree3a9b4436dfcfc483dbcda2261ff669c1dfe14b9f
parent65780fdfff8cb81e99b7b5ba8d69391d81c97aba (diff)
downloadministat-5c96ff2741fb36c5b9e793a55bd8a8a0bef76021.tar.gz
ministat-5c96ff2741fb36c5b9e793a55bd8a8a0bef76021.tar.xz
ministat-5c96ff2741fb36c5b9e793a55bd8a8a0bef76021.zip
Better install target.
-rw-r--r--Makefile5
-rw-r--r--README.md3
2 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 25d8394..ffed7e8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 CC ?= clang 
-INSTALLPATH ?= /usr/bin
+PREFIX ?= /usr
 
 CFLAGS += -Wall -Werror
 LDFLAGS += -lm
@@ -31,7 +31,8 @@ depend:
 	@echo "Dependencies are automatically generated."
 
 install:
-	install -m 0755 $(OBJ)/$(BIN) $(INSTALLPATH)
+	install -d $(PREFIX)/bin
+	install -m 0755 $(OBJ)/$(BIN) $(PREFIX)/bin/$(BIN)
 
 clean:
 	-rm -rf $(BIN) obj *.core
diff --git a/README.md b/README.md
index 28a9325..0543157 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,8 @@ There should be no dependencies besides the standard libraries and a functional
 
 	$ cd ministat/
 	$ make
-	# INSTALLPATH=/usr/bin make install
+	$ make PREFIX=/usr install
+	install -m 0755 ministat  /usr/bin/ministat
 
 ## Usage
 The FreeBSD man page is very relevant, pursue it [here](http://www.freebsd.org/cgi/man.cgi?ministat).