-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This Makefile assumes GNU make.
MANIFEST_FILE = MANIFEST
VERSION = $(shell ruby bin/ruby-versions config version)
REAL_RUBY = $(shell ruby bin/ruby-versions which)
SHIM_PATH = $(DESTDIR)$(shell ruby bin/ruby-versions config shim_path)
PACKAGE = ruby-versions-$(VERSION).tar.gz
INSTALLPATH_BIN = $(DESTDIR)/usr/local/bin
INSTALLPATH_VAR_LIB = $(DESTDIR)/var/lib/ruby-versions
all: build build/bin/ruby-versions;
build:
mkdir -p build
mkdir -p build/bin
build/bin/ruby-versions:
ruby -npe '$$. == 1 && sub(/^#![^ ]+(.*)$$/, "#!$(REAL_RUBY)\\1")' bin/ruby-versions >build/bin/ruby-versions
install: all
mkdir -p $(INSTALLPATH_BIN)
install -m 755 build/bin/ruby-versions $(INSTALLPATH_BIN)/ruby-versions
mkdir -p $(INSTALLPATH_VAR_LIB)
mkdir -p $(SHIM_PATH)
uninstall:
rm -rf $(SHIM_PATH)
rm -rf $(INSTALLPATH_VAR_LIB)
rm -f $(INSTALLPATH_BIN)/ruby-versions
dist: $(PACKAGE);
$(PACKAGE):
tar -cz -T $(MANIFEST_FILE) -f $(PACKAGE)
clean:
rm -rf build
distclean: clean
rm -f $(PACKAGE)
.PHONY: all build install uninstall dist clean distclean