Commit Diff


commit - d41dea1012db6fe7ea90ac1c709762018dc15b14
commit + 719c5cd4886f88086368503b5aabff0e7480e1ef
blob - d85f1e636143b57f9cd089cdf2460674409d1ea6
blob + c4418647f67f8d838b1b1eb29309c9d26bc449fd
--- Makefile
+++ Makefile
@@ -1,7 +1,16 @@
-CLIBS = -lcurses
-CFLAGS = -Wall -Wextra -Werror -O2
+CLIBS=-lcurses
+CFLAGS=-Wall -Wextra -Werror -O2
+PREFIX=/usr
+INSTALL=install -Ds
 
-all : rover
+all: rover
 
-rover : rover.c config.h
+rover: rover.c config.h
 	$(CC) $(CFLAGS) -o $@ $< $(CLIBS)
+
+install: rover
+	$(INSTALL) rover $(PREFIX)/bin/rover
+
+.PHONE: clean
+clean:
+	$(RM) rover
blob - d75a98df9c8e4618942971645035711fdd49f272
blob + ef4442c874012b3929057cb7765b4526519a5d8f
--- README.md
+++ README.md
@@ -21,9 +21,15 @@ Quick Start
  $ make
  ```
 
+ Installing:
+ ```
+ $ # Requires write access to $(PREFIX)/bin/.
+ $ make install
+ ```
+
  Running:
  ```
- $ ./rover
+ $ rover
  ```
 
  Using:
@@ -55,24 +61,24 @@ header file.
 Configuration
 =============
 
+ By default, rover is installed to `/usr/bin/rover`. To change this and other
+build options, such as the name of the curses library, please edit `Makefile`
+before executing `make` or specify the options during invocation. For example,
+to link against `libncurses.so` and install to `/opt/bin/rover`:
+ ```
+ make CLIBS=-lncurses PREFIX=/opt install
+ ```
+
  Rover configuration (mostly key bindings and colors) can only be changed
 by editing the file `config.h` and rebuilding the binary (with `make`).
 
  Note that the external programs executed by some Rover commands may be changed
-via the appropriated environment variables. For example, to specify an editor:
+via the appropriate environment variables. For example, to specify an editor:
  ```
- $ EDITOR=vi ./rover
+ $ EDITOR=vi rover
  ```
 
- You may also want to "install" Rover by copying it somewhere on your $PATH. The
-only file that needs to be copied is `rover`:
- ```
- $ cp rover /usr/bin
- $ # Now the "./" prefix is no longer necessary.
- $ rover
- ```
 
-
 Copyright
 =========