File: Makefile

package info (click to toggle)
rhash 1.2.9-8+deb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,532 kB
  • sloc: ansic: 12,739; xml: 804; makefile: 626; java: 346; cs: 274; python: 226; perl: 173; sh: 147; ruby: 66; sed: 16
file content (94 lines) | stat: -rw-r--r-- 2,570 bytes parent folder | download
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
MAKE = make
RUBY = ruby
PYTHON = python
PERL = /usr/bin/perl
DESTDIR =
PREFIX = /usr/local
PERL_OPTIMIZE = -O2 -g -Wall
VERSION = $(shell sed -ne 's/^version=\(.*\)/\1/p' version.properties)
FILES = Makefile version.properties
BINDINGS = java mono perl python ruby
ARCHIVE_GZIP = rhash-bindings-$(VERSION)-src.tar.gz
COPYDIR = rhash-bindings-$(VERSION)
CP = cp -l --parents

all: configure build test
clean: distclean

configure: $(patsubst %, configure-%, $(filter perl ruby, $(BINDINGS)))
build: $(patsubst %, build-%, $(BINDINGS))
test: $(patsubst %, test-%, $(BINDINGS))
install: $(patsubst %, install-%, $(filter perl ruby, $(BINDINGS)))

configure-perl: perl/Makefile
configure-ruby: ruby1.8/Makefile ruby1.9.1/Makefile

perl/Makefile: perl/Makefile.PL
	cd perl && perl Makefile.PL INSTALLDIRS=vendor

ruby1.8/Makefile: ruby/extconf.rb
	mkdir -p ruby1.8 && ruby1.8 -C ruby1.8 ../ruby/extconf.rb

ruby1.9.1/Makefile: ruby/extconf.rb
	mkdir -p ruby1.9.1 && ruby1.9.1 -C ruby1.9.1 ../ruby/extconf.rb

build-java:
	$(MAKE) -C java/

build-perl: configure-perl
	$(MAKE) -C perl OPTIMIZE="$(PERL_OPTIMIZE)"

build-python:
# not required

build-ruby: configure-ruby
	$(MAKE) -C ruby1.8
	$(MAKE) -C ruby1.9.1

build-mono:
	$(MAKE) -C mono

test-java:
	$(MAKE) -C java test

test-perl:
	$(MAKE) -C perl test

test-ruby:
	ruby1.8   -C ruby1.8   -I. ../ruby/test_rhash.rb
	ruby1.9.1 -C ruby1.9.1 -I. ../ruby/test_rhash.rb

test-mono:
	$(MAKE) -C mono test

test-python:
	$(PYTHON) python/test_rhash.py

install-ruby:
	$(MAKE) -C ruby1.8   install DESTDIR=$(DESTDIR) sitedir=$(DESTDIR)/usr/lib/ruby
	$(MAKE) -C ruby1.9.1 install DESTDIR=$(DESTDIR) sitedir=$(DESTDIR)/usr/lib/ruby

install-perl:
	$(MAKE) -C perl install DESTDIR=$(DESTDIR)
#	$(MAKE) -C perl install DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) SITEPREFIX=$(PREFIX)

copy-dist:
	mkdir -p $(COPYDIR)
	find java ruby python -type f -regex '.*\(\.\([hc]\|java\|py\|rb\|txt\)\|Makefile\)' -exec $(CP) '{}' $(COPYDIR)/ \;
	find perl -type f -regex '.*\(\.\(t\|PL\|pm\|xs\)\|MANIFEST\|typemap\)' -exec $(CP) '{}' "$(COPYDIR)/" \;
	find mono -type f -regex '.*\(\.\([hc]\|cs\|xml\|txt\|snk\|sln\|csproj\)\|Makefile\)' -exec $(CP) '{}' "$(COPYDIR)/" \;
	$(CP) $(FILES) "$(COPYDIR)/"

gzip: distclean
	rm -rf "$(COPYDIR)" $(ARCHIVE_GZIP)
	make copy-dist
	tar -czf $(ARCHIVE_GZIP) "$(COPYDIR)"
	rm -rf "$(COPYDIR)"

distclean:
	$(MAKE) -C java distclean
	$(MAKE) -C mono clean
	[ ! -d ruby1.8 ] || $(RM) -r ruby1.8
	[ ! -d ruby1.9.1 ] || $(RM) -r ruby1.9.1
	[ ! -f perl/Makefile ] || $(MAKE) -C perl distclean
	rm -f python/*.pyc