aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 22 insertions, 21 deletions
diff --git a/Makefile b/Makefile
index 6b9dee4..53c1233 100644
--- a/Makefile
+++ b/Makefile
@@ -6,12 +6,17 @@ SHELL := bash
makefile_dir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+# Jekyll project is in the parent directory by default.
PROJECT_DIR ?= $(abspath $(dir $(makefile_dir))/..)
RUBY_INSTALL_VERSION ?= 0.7.0
RUBY_VERSION ?= 2.6.5
CHRUBY_VERSION ?= 0.3.9
PREFIX ?= $(HOME)/.local
+ruby_install_url := https://github.com/postmodern/ruby-install/archive/v$(RUBY_INSTALL_VERSION).tar.gz
+ruby_install_archive := $(makefile_dir)/ruby-install-$(RUBY_INSTALL_VERSION).tar.gz
+ruby_install_dir := $(makefile_dir)/ruby-install-$(RUBY_INSTALL_VERSION)
+
chruby_url := https://github.com/postmodern/chruby/archive/v$(CHRUBY_VERSION).tar.gz
chruby_archive := $(makefile_dir)/chruby-$(CHRUBY_VERSION).tar.gz
chruby_dir := $(makefile_dir)/chruby-$(CHRUBY_VERSION)
@@ -19,9 +24,23 @@ chruby_dir := $(makefile_dir)/chruby-$(CHRUBY_VERSION)
chruby_sh := $(PREFIX)/share/chruby/chruby.sh
auto_sh := $(PREFIX)/share/chruby/auto.sh
-ruby_install_url := https://github.com/postmodern/ruby-install/archive/v$(RUBY_INSTALL_VERSION).tar.gz
-ruby_install_archive := $(makefile_dir)/ruby-install-$(RUBY_INSTALL_VERSION).tar.gz
-ruby_install_dir := $(makefile_dir)/ruby-install-$(RUBY_INSTALL_VERSION)
+.PHONY: ruby-install
+ruby-install:
+ wget -O '$(ruby_install_archive)' '$(ruby_install_url)'
+ tar -xzvf '$(ruby_install_archive)' -C '$(makefile_dir)'
+ cd -- '$(ruby_install_dir)' && make install 'PREFIX=$(PREFIX)'
+
+.PHONY: ruby-install/uninstall
+ruby-install/uninstall:
+ cd -- '$(ruby_install_dir)' && make uninstall 'PREFIX=$(PREFIX)'
+
+.PHONY: ruby-install/clean
+ruby-install/clean:
+ rm -rf -- '$(ruby_install_archive)' '$(ruby_install_dir)'
+
+.PHONY: ruby
+ruby:
+ ruby-install -j2 --cleanup ruby '$(RUBY_VERSION)'
.PHONY: chruby
chruby:
@@ -53,24 +72,6 @@ chruby/profile.d:
chruby/profile.d/clean:
rm -f -- /etc/profile.d/chruby.sh
-.PHONY: ruby-install
-ruby-install:
- wget -O '$(ruby_install_archive)' '$(ruby_install_url)'
- tar -xzvf '$(ruby_install_archive)' -C '$(makefile_dir)'
- cd -- '$(ruby_install_dir)' && make install 'PREFIX=$(PREFIX)'
-
-.PHONY: ruby-install/uninstall
-ruby-install/uninstall:
- cd -- '$(ruby_install_dir)' && make uninstall 'PREFIX=$(PREFIX)'
-
-.PHONY: ruby-install/clean
-ruby-install/clean:
- rm -rf -- '$(ruby_install_archive)' '$(ruby_install_dir)'
-
-.PHONY: ruby
-ruby:
- ruby-install -j2 --cleanup ruby '$(RUBY_VERSION)'
-
chruby := . '$(chruby_sh)' && chruby 'ruby-$(RUBY_VERSION)'
project_chruby := cd -- '$(PROJECT_DIR)' && $(chruby)
bundle := $(project_chruby) && bundle