Skip to content

Commit

Permalink
Merge pull request #308 from sickill/master
Browse files Browse the repository at this point in the history
Separate PREFIX and DESTDIR to allow staged installs
  • Loading branch information
postmodern committed Dec 22, 2014
2 parents ce31d36 + 797358b commit ef054dc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PKG_NAME=$(NAME)-$(VERSION)
PKG=$(PKG_DIR)/$(PKG_NAME).tar.gz
SIG=$(PKG).asc

PREFIX?=$(DESTDIR)/usr/local
PREFIX?=/usr/local
DOC_DIR=$(PREFIX)/share/doc/$(PKG_NAME)

pkg:
Expand Down Expand Up @@ -59,13 +59,13 @@ rpm:
rpmbuild -ba rpm/chruby.spec

install:
for dir in $(INSTALL_DIRS); do mkdir -p $(PREFIX)/$$dir; done
for file in $(INSTALL_FILES); do cp $$file $(PREFIX)/$$file; done
mkdir -p $(DOC_DIR)
cp -r $(DOC_FILES) $(DOC_DIR)/
for dir in $(INSTALL_DIRS); do mkdir -p $(DESTDIR)$(PREFIX)/$$dir; done
for file in $(INSTALL_FILES); do cp $$file $(DESTDIR)$(PREFIX)/$$file; done
mkdir -p $(DESTDIR)$(DOC_DIR)
cp -r $(DOC_FILES) $(DESTDIR)$(DOC_DIR)/

uninstall:
for file in $(INSTALL_FILES); do rm -f $(PREFIX)/$$file; done
rm -rf $(DOC_DIR)
for file in $(INSTALL_FILES); do rm -f $(DESTDIR)$(PREFIX)/$$file; done
rm -rf $(DESTDIR)$(DOC_DIR)

.PHONY: build download sign verify clean test tag release rpm install uninstall all

0 comments on commit ef054dc

Please sign in to comment.