forked from axsh/wakame-vdc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (68 loc) · 3.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
ruby_ver ?= 1.9.3-p362
# should be in wakame-vdc
CURDIR ?= $(PWD)
RUBYDIR ?= $(CURDIR)/ruby
RUBY_MIRROR_SITE ?= http://core.ring.gr.jp/archives/lang/ruby/
LIBYAML_MIRROR_SITE ?= http://pyyaml.org/download/libyaml/
RUBYGEMS_MIRROR_SITE ?= http://production.cf.rubygems.org/rubygems/
RUBY_BUILD_REPO_URI ?= https://github.com/sstephenson/ruby-build.git
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 install-core-gem bundle-install
touch $@
ruby-build: ruby-build-stamp
ruby-build-stamp:
(cd $(CURDIR); git clone $(RUBY_BUILD_REPO_URI))
(cd $(CURDIR)/ruby-build; sed -i s,http://ftp.ruby-lang.org/pub/ruby/,$(RUBY_MIRROR_SITE), share/ruby-build/*)
(cd $(CURDIR)/ruby-build; sed -i s,http://pyyaml.org/download/libyaml/,$(LIBYAML_MIRROR_SITE), share/ruby-build/*)
(cd $(CURDIR)/ruby-build; sed -i s,http://production.cf.rubygems.org/rubygems/,$(RUBYGEMS_MIRROR_SITE), share/ruby-build/*)
touch $@
ruby: ruby-stamp
ruby-stamp:
(cd $(CURDIR)/ruby-build; ./bin/ruby-build $(ruby_ver) $(RUBYDIR))
touch $@
install-core-gem: install-core-gem-stamp
install-core-gem-stamp:
gem install bundler rake --no-rdoc --no-ri
touch $@
bundle-install: bundle-install-stamp
bundle-install-stamp:
(cd $(CURDIR)/dcmgr && bundle install --standalone --path vendor/bundle)
# Use hijiki gem in local since the local version is the latest.
(cd $(CURDIR)/frontend/dcmgr_gui && mkdir -p vendor/cache)
(cd $(CURDIR)/frontend/admin && mkdir -p vendor/cache)
(cd $(CURDIR)/tests/cucumber && mkdir -p vendor/cache)
(cd $(CURDIR)/client/ruby-hijiki && rake gem && mv pkg/ruby-hijiki-*.gem ../../frontend/dcmgr_gui/vendor/cache)
# in order to build rpm, client(ruby-hijiki)/ is no need.
[ "$(RUBYDIR)" = "$(CURDIR)/ruby" ] || mv $(CURDIR)/client/ruby-hijiki $(CURDIR)/client/ruby-hijiki.saved
(cd $(CURDIR)/frontend/dcmgr_gui && bundle install --standalone --path vendor/bundle)
(cd $(CURDIR)/frontend/admin && bundle install --standalone --path vendor/bundle)
(cd $(CURDIR)/tests/cucumber && bundle install --standalone --path vendor/bundle)
[ "$(RUBYDIR)" = "$(CURDIR)/ruby" ] || mv $(CURDIR)/client/ruby-hijiki.saved $(CURDIR)/client/ruby-hijiki
touch $@
clean:
rm -rf $(CURDIR)/ruby-build $(RUBYDIR)
rm -rf $(CURDIR)/dcmgr/vendor/bundle
rm -rf $(CURDIR)/frontend/dcmgr_gui/vendor/bundle
rm -rf $(CURDIR)/frontend/admin/vendor/bundle
rm -f $(CURDIR)/build-ruby-stamp
rm -f $(CURDIR)/bundle-install-stamp
rm -f $(CURDIR)/install-core-gem-stamp
rm -f $(CURDIR)/ruby-build-stamp
rm -f $(CURDIR)/ruby-stamp
.PHONY: build ruby-build ruby clean install-core-gem bundle-install