--- Makefile.in.orig	2007-10-07 19:13:19.000000000 -0500
+++ Makefile.in	2014-09-04 21:17:53.000000000 -0500
@@ -7,14 +7,16 @@
 CC = gcc
 CFLAGS = -Wall
 
-all:
+all: $(RR_OUTPUT)
+$(RR_OUTPUT): $(RR_SOURCE)
 	$(CC) $(CFLAGS) -o $(RR_OUTPUT) $(RR_SOURCE)
 clean:
-	rm -f Makefile config.cache config.status config.h config.log rr
+	rm -f Makefile config.cache config.status config.h config.log $(RR_OUTPUT)
 
 distclean: clean
 
 install: all
-	$(INSTALL) -o 0 -g 0 -m 755 rr ${PREFIX}/bin/
-	$(INSTALL) -o 0 -g 0 -m 644 rr.1 $(MANDIR)/man1/
+	$(INSTALL) -m 755 $(RR_OUTPUT) $(DESTDIR)$(PREFIX)/bin/
+	$(INSTALL) -m 644 rr.1 $(DESTDIR)$(MANDIR)/man1/
 
+.PHONY: all clean distclean install
