forked from nfarring/redisrpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
125 lines (96 loc) · 2.24 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
VERSION:=$(shell cat VERSION)
BASIC_TARGETS:=\
README.html
RUBY_TARGETS:=\
ruby/lib/redisrpc/version.rb
PHP_TARGETS:=\
composer.phar\
php/vendor
PYTHON_TARGETS:=\
python/VERSION\
python/LICENSE\
python/README.rst\
python/dist
.PHONY: help
help:
@echo 'Build Targets:'
@echo ' all'
@echo ' ruby'
@echo ' php'
@echo ' python'
@echo 'Clean Targets:'
@echo ' clean-all'
@echo ' clean-ruby'
@echo ' clean-php'
@echo ' clean-python'
@echo 'Test Targets:'
@echo ' test-python'
.PHONY: all
all: basic ruby php python
.PHONY: basic
basic: $(BASIC_TARGETS)
.PHONY: ruby
ruby: basic $(RUBY_TARGETS)
.PHONY: php
php: basic $(PHP_TARGETS)
.PHONY: python
python: basic $(PYTHON_TARGETS)
.PHONY: clean-all
clean-all: clean-basic clean-ruby clean-php clean-python
.PHONY: clean-basic
clean-basic:
@rm -rf $(BASIC_TARGETS)
.PHONY: clean-ruby
clean-ruby:
@rm -rf $(RUBY_TARGETS)
@rm -rf ruby/*.gem
.PHONY: clean-php
clean-php:
@rm -rf $(PHP_TARGETS)
@rm -rf composer.lock
.PHONY: clean-python
clean-python:
@rm -rf $(PYTHON_TARGETS)
@rm -rf python/*.pyc python/examples/*.pyc
@rm -rf python/*.egg
@rm -rf python/*.log
@rm -rf python/build
@rm -rf python/redisrpc.egg-info
@rm -rf python/.tox
.PHONY: test-python
test-python: python
cd python && tox
#########################
# Rules for Basic Targets
#########################
# Ref: https://github.com/alampros/Docter
README.html: README.markdown
docs/github-flavored-markdown.rb $< >$@
########################
# Rules for Ruby Targets
########################
ruby/lib/redisrpc:
mkdir $@
ruby/lib/redisrpc/version.rb: ruby/lib/redisrpc
printf "module RedisRPC\n" >$@
printf " #Ref: http://semver.org/\n" >>$@
printf " VERSION = '%s'\n" $(VERSION) >>$@
printf "end\n" >>$@
#######################
# Rules for PHP Targets
#######################
composer.phar:
curl -s http://getcomposer.org/installer | php
php/vendor: composer.phar
php composer.phar install
##########################
# Rules for Python Targets
##########################
python/VERSION: VERSION
cp -a $< $@
python/LICENSE: LICENSE
cp -a $< $@
python/README.rst: README.html
cat $< | pandoc --from=html --to=rst --output=$@
python/dist: python/LICENSE python/README.rst
cd python && python setup.py sdist