This repository has been archived by the owner on May 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
82 lines (60 loc) · 2.43 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
UNAME := $(shell uname)
VERSION := $(shell head -1 VERSION)
RUBY_PLATFORM := $(shell ruby -e "puts RUBY_PLATFORM")
all: c javascript ruby winruby jruby
c:
cd c && make
java:
cd java && mvn package
javascript:
cd javascript && make
ruby:
cd ruby && bundle && bundle exec rake
clangruby:
cd ruby && bundle && CC=clang bundle exec rake clean compile
gccruby:
cd ruby && bundle && CC=gcc bundle exec rake clean compile
jruby:
cd ruby && jruby -S rake
winruby: mingw
cd ruby && bundle && bundle exec rake cross compile
clean:
cd c && make clean
cd java && mvn clean
cd javascript && make clean
cd ruby && bundle exec rake clean
clobber:
git clean -dfx
ifeq ($(UNAME), Darwin)
mingw: mingw/bin/i686-w64-mingw32-gcc
mingw/bin/i686-w64-mingw32-gcc:
mkdir -p mingw
cd mingw && curl --silent --location http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Automated%20Builds/mingw-w32-1.0-bin_i686-darwin_20130531.tar.bz2 | tar xvj
endif
ifeq ($(RUBY_PLATFORM), java)
# ruby is actually jruby. In that case run only the ruby target, which will build with jruby
travis: ruby
else
# ruby is MRI. In that case, build everything. We'll build ruby thrice, once with clang, once with gcc and once with mingw.
travis: c javascript clangruby gccruby winruby
endif
### Bump versions
java/pom.xml: VERSION
perl -i -pe 'if (!$$changed) {s/<version>.*/<version>$(VERSION)<\/version>/ and $$changed++;}' $@
javascript/package.json: VERSION
perl -i -pe 'if (!$$changed) {s/"version"\s*:.*/"version": "$(VERSION)",/ and $$changed++;}' $@
ruby/bool.gemspec: VERSION
perl -i -pe 'if (!$$changed) {s/s.version\s*=.*/s.version = "$(VERSION)"/ and $$changed++;}' $@
version: java/pom.xml javascript/package.json ruby/bool.gemspec
release: clean version all
cd javascript && npm publish
cd ruby && rake release
cd ruby && RUBY_PLATFORM=x86-mingw32 rake release
cd ruby && RUBY_PLATFORM=java rake release
cd java && mvn -Psign clean source:jar javadoc:jar deploy
@echo "*************************************************************"
@echo "Release successful! "
@echo "Go to https://oss.sonatype.org/index.html#stagingRepositories"
@echo "then CLOSE and RELEASE (no description needed) "
@echo "*************************************************************"
.PHONY: all c java javascript ruby clangruby gccruby jruby winruby mingw travis bison not_dirty clean version