--- Makefile.orig 2011-08-21 20:17:01.000000000 +0800 +++ Makefile 2014-02-21 09:40:52.782172201 +0800 @@ -15,7 +15,7 @@ QUIET_SPARSE = @true endif -PREFIX ?= /usr/local +PREFIX ?= $(DESTDIR)$(PREFIX) CFLAGS ?= -Os -fomit-frame-pointer CFLAGS += -std=c99 -Wall -pedantic -D_BSD_SOURCE LDFLAGS ?= @@ -51,10 +51,10 @@ $(QUIET_CC) $(CFLAGS) -o $(BIN) $(call OBJS,$(SRCS)) $(LDFLAGS) install: all - install -d -o 0 -g 0 -m 755 $(PREFIX)/bin/ - install -o 0 -g 0 -m 755 $(BIN) $(PREFIX)/bin/ - install -d -o 0 -g 0 -m 755 $(PREFIX)/man/man1/ - install -o 0 -g 0 -m 644 $(BIN).1 $(PREFIX)/man/man1/ + install -d -m 755 $(DESTDIR)$(PREFIX)/bin/ + $(BSD_INSTALL_PROGRAM) $(BIN) $(DESTDIR)$(PREFIX)/bin/ + install -d -m 755 $(DESTDIR)$(PREFIX)/man/man1/ + $(BSD_INSTALL_MAN) $(BIN).1 $(DESTDIR)$(PREFIX)/man/man1/ clean: -rm -Rf obj dep *.orig *.rej *~