-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
56 lines (44 loc) · 1.56 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
44
45
46
47
48
49
50
51
52
53
54
55
56
ruby_ver ?= 2.0.0-p247
# should be in wakame-vdc
CURDIR ?= $(PWD)
RUBYDIR ?= $(CURDIR)/ruby
RUBY_BUILD_REPO_URI ?= https://github.com/sstephenson/ruby-build.git
# Workaround for a ruby build bug on redhat/centos systems
# https://github.com/sstephenson/ruby-build/wiki#make-error-for-200-p247-and-lower-on-fedorared-hat
RUBY_PATCH := curl -fsSL https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808/diff?format=diff | filterdiff -x ChangeLog |
CFLAGS := -fno-strict-aliasing
CXXFLAGS := -fno-strict-aliasing
# configure options set by ruby-build
CONFIGURE_OPTS := --disable-install-doc --enable-frame-address --enable-pthread --enable-ipv6 --with-bundled-sha1 --with-bundled-md5 --with-bundled-rmd160 --enable-rpath
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g -O0
CXXFLAGS += -g -O0
else
CFLAGS += -g -O0
CXXFLAGS += -g -O0
endif
export CFLAGS CXXFLAGS CONFIGURE_OPTS
PATH := $(RUBYDIR)/bin:${PATH}
export PATH
# unset GEM_HOME and GEM_PATH
unexport GEM_HOME GEM_PATH
build: build-ruby-stamp
build-ruby-stamp: ruby-build ruby
touch $@
ruby-build:
(if [ -d ruby-build ]; then \
cd ruby-build; git pull; \
else \
git clone $(RUBY_BUILD_REPO_URI); \
fi)
ruby: ruby-stamp
ruby-stamp:
(cd $(CURDIR)/ruby-build; $(RUBY_PATCH) ./bin/ruby-build $(ruby_ver) $(RUBYDIR) --patch)
gem install bundler --no-rdoc --no-ri
touch $@
clean:
rm -rf $(CURDIR)/ruby-build $(RUBYDIR)
rm -f $(CURDIR)/build-ruby-stamp
rm -f $(CURDIR)/ruby-build-stamp
rm -f $(CURDIR)/ruby-stamp
.PHONY: build ruby-build ruby clean bundle-install