1 |
douglas |
1092 |
# Ruby Installer |
2 |
|
|
# |
3 |
|
|
# Douglas Thrift |
4 |
|
|
# |
5 |
|
|
# $Id$ |
6 |
|
|
|
7 |
|
|
ifeq ($(OS),Windows_NT) |
8 |
douglas |
1094 |
BASE := $(CURDIR)/ruby |
9 |
douglas |
1092 |
CP := C:\cygwin\bin\cp.exe |
10 |
|
|
GEMS_INSTALL := gems-install.cmd |
11 |
|
|
RM_F := del /F /A |
12 |
|
|
RM_RF := rmdir /Q /S |
13 |
|
|
TOUCH := touch.cmd |
14 |
|
|
else |
15 |
douglas |
1094 |
BASE := Z:$(CURDIR)/ruby |
16 |
douglas |
1092 |
CP := cp |
17 |
|
|
GEMS_INSTALL := ./gems-install.sh |
18 |
|
|
RM_F := rm -f |
19 |
|
|
RM_RF := rm -rf |
20 |
|
|
TOUCH := touch |
21 |
|
|
endif |
22 |
|
|
|
23 |
|
|
RUBY_ZIP := $(lastword $(wildcard ruby-*-i386-mswin32.zip)) |
24 |
|
|
RUBY_VERSION := $(patsubst ruby-%-i386-mswin32.zip,%,$(RUBY_ZIP)) |
25 |
|
|
GEMS_ZIP := $(lastword $(wildcard rubygems-*.zip)) |
26 |
|
|
GEMS_VERSION := $(patsubst rubygems-%.zip,%,$(GEMS_ZIP)) |
27 |
|
|
GEMS_DIR := rubygems-$(GEMS_VERSION) |
28 |
|
|
INSTALLER := ruby-$(RUBY_VERSION)-rubygems-$(GEMS_VERSION).exe |
29 |
|
|
|
30 |
|
|
.PHONY: all clean |
31 |
|
|
|
32 |
|
|
all: $(INSTALLER) |
33 |
|
|
|
34 |
|
|
.gems: $(GEMS_ZIP) .ruby-install |
35 |
|
|
-$(RM_RF) $(GEMS_DIR) |
36 |
|
|
unzip $(GEMS_ZIP) |
37 |
|
|
$(TOUCH) $@ |
38 |
|
|
|
39 |
|
|
.gems-install: .gems |
40 |
|
|
$(GEMS_INSTALL) $(GEMS_DIR) |
41 |
|
|
$(TOUCH) $@ |
42 |
|
|
|
43 |
|
|
.ruby: $(RUBY_ZIP) |
44 |
|
|
-$(RM_RF) ruby |
45 |
|
|
unzip $(RUBY_ZIP) -d ruby |
46 |
|
|
$(TOUCH) $@ |
47 |
|
|
|
48 |
douglas |
1094 |
.ruby-install: ruby/bin/history.dll ruby/bin/libeay32.dll ruby/bin/history.dll \ |
49 |
douglas |
1212 |
ruby/bin/readline.dll ruby/bin/ssleay32.dll ruby/bin/zlib.dll |
50 |
douglas |
1092 |
$(TOUCH) $@ |
51 |
|
|
|
52 |
douglas |
1094 |
$(INSTALLER): ruby-installer.nsi .gems-install |
53 |
douglas |
1095 |
makensis -DRUBY_VERSION=$(RUBY_VERSION) -DGEMS_VERSION=$(GEMS_VERSION) \ |
54 |
douglas |
1212 |
-DRUBY_LICENSE=$(wildcard ruby/doc/ruby/ruby-*/COPYING) -DBASE=$(BASE) \ |
55 |
|
|
$< |
56 |
douglas |
1092 |
|
57 |
|
|
ruby/bin/%.dll: %.dll .ruby |
58 |
|
|
$(CP) $< $@ |
59 |
|
|
|
60 |
douglas |
1094 |
ruby/bin/history.dll: history5.dll .ruby |
61 |
|
|
$(CP) $< $@ |
62 |
|
|
|
63 |
|
|
ruby/bin/readline.dll: readline5.dll .ruby |
64 |
|
|
$(CP) $< $@ |
65 |
|
|
|
66 |
douglas |
1092 |
ruby/bin/zlib.dll: zlib1.dll .ruby |
67 |
|
|
$(CP) $< $@ |
68 |
|
|
|
69 |
|
|
clean: |
70 |
douglas |
1093 |
-$(RM_F) .gems* .ruby* $(INSTALLER) |
71 |
douglas |
1092 |
-$(RM_RF) ruby $(GEMS_DIR) |