From ddf4d1a32a404ee3789bc17276702bb5536b03f6 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Tue, 23 Apr 2013 20:17:09 +0200 Subject: install: Support $(PREFIX) install target directory prefix This change introduces support for the common PREFIX variable in the Makefile and install.py, instead of having /usr/local hardcoded. This makes it much easier to install node to custom locations e.g. in a user's home directory. The PREFIX variable defaults to /usr/local. --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ae05f4dc71b..4b3b9a5686b 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ PYTHON ?= python NINJA ?= ninja DESTDIR ?= SIGN ?= +PREFIX ?= /usr/local NODE ?= ./node @@ -55,10 +56,10 @@ config.gypi: configure $(PYTHON) ./configure install: all - $(PYTHON) tools/install.py $@ $(DESTDIR) + $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' uninstall: - $(PYTHON) tools/install.py $@ $(DESTDIR) + $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' clean: -rm -rf out/Makefile node node_g out/$(BUILDTYPE)/node blog.html email.md @@ -266,17 +267,17 @@ pkg: $(PKG) $(PKG): release-only rm -rf $(PKGDIR) rm -rf out/deps out/Release - $(PYTHON) ./configure --prefix=$(PKGDIR)/32/usr/local --without-snapshot --dest-cpu=ia32 --tag=$(TAG) + $(PYTHON) ./configure --prefix=$(PKGDIR)/32$(PREFIX) --without-snapshot --dest-cpu=ia32 --tag=$(TAG) $(MAKE) install V=$(V) rm -rf out/deps out/Release - $(PYTHON) ./configure --prefix=$(PKGDIR)/usr/local --without-snapshot --dest-cpu=x64 --tag=$(TAG) + $(PYTHON) ./configure --prefix=$(PKGDIR)$(PREFIX) --without-snapshot --dest-cpu=x64 --tag=$(TAG) $(MAKE) install V=$(V) SIGN="$(SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh - lipo $(PKGDIR)/32/usr/local/bin/node \ - $(PKGDIR)/usr/local/bin/node \ - -output $(PKGDIR)/usr/local/bin/node-universal \ + lipo $(PKGDIR)/32$(PREFIX)/bin/node \ + $(PKGDIR)$(PREFIX)/bin/node \ + -output $(PKGDIR)$(PREFIX)/bin/node-universal \ -create - mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node + mv $(PKGDIR)$(PREFIX)/bin/node-universal $(PKGDIR)$(PREFIX)/bin/node rm -rf $(PKGDIR)/32 $(packagemaker) \ --id "org.nodejs.Node" \ -- cgit v1.2.3