~ubuntu-branches/ubuntu/trusty/rhash/trusty

« back to all changes in this revision

Viewing changes to .pc/01_use_local_javadocs.patch/bindings/java/Makefile

  • Committer: Package Import Robot
  • Author(s): Aleksey Kravchenko
  • Date: 2011-09-14 23:50:14 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: package-import@ubuntu.com-20110914235014-m9mk3eg7e6rah17x
Tags: 1.2.8-1
* New upstream release version 1.2.8
 - language bindings for Java, Perl, Python, Ruby
 - Russian translation
 - fixed recommended libssl1.0.0 dependency
 - patched broken re-compilation
 - fixed a mistype in perl documentation
 - control: updated Vcs-Git field
 - copyright: corrected Format field, added Upstream-Contact
 - copyright: updated Copyright field, mentioned another developer

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
 
 
3
# This file is a part of Java Bindings for Librhash
 
4
# Copyright (c) 2011, Sergey Basalaev <sbasalaev@gmail.com>
 
5
# Librhash is (c) 2011, Alexey S Kravchenko <rhash.admin@gmail.com>
 
6
 
7
# Permission is hereby granted, free of charge,  to any person obtaining a copy
 
8
# of this software and associated documentation files (the "Software"), to deal
 
9
# in the Software without restriction,  including without limitation the rights
 
10
# to  use,  copy,  modify,  merge, publish, distribute, sublicense, and/or sell
 
11
# copies  of  the Software,  and  to permit  persons  to whom  the Software  is
 
12
# furnished to do so.
 
13
 
14
# This library  is distributed  in the hope that it will be useful, but WITHOUT
 
15
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
16
# FOR A PARTICULAR PURPOSE. Use it at your own risk!
 
17
 
 
18
 
 
19
MAKE = make
 
20
JAVA = java
 
21
JAVAC = javac
 
22
JAVADOC = javadoc
 
23
JAVAH = javah
 
24
JAR = jar
 
25
 
 
26
VERSION = $(shell sed -e 's/.*"\(.*\)".*/\1/' ../../version.h)
 
27
 
 
28
JAVASRC_DIR = src
 
29
CSRC_DIR    = native
 
30
DEST_DIR    = dist
 
31
CLASSES_DIR = classes
 
32
JAVADOC_DIR = javadoc
 
33
TEST_DIR    = test
 
34
 
 
35
JAVADOC_API_URL = http://download.oracle.com/javase/6/docs/api/
 
36
 
 
37
JARFILE = $(DEST_DIR)/rhash-$(VERSION).jar
 
38
 
 
39
all: jar jni test
 
40
 
 
41
jar: compile-classes
 
42
        mkdir -p $(DEST_DIR)
 
43
        $(JAR) cf $(JARFILE) -C $(CLASSES_DIR) org/
 
44
 
 
45
jar-symlink:
 
46
        ln -s rhash-$(VERSION).jar $(DEST_DIR)/rhash.jar
 
47
 
 
48
compile-classes:
 
49
        mkdir -p $(CLASSES_DIR)
 
50
        $(JAVAC) -d $(CLASSES_DIR) -sourcepath $(JAVASRC_DIR) `find ${JAVASRC_DIR} -name '*.java'`
 
51
 
 
52
update-header: compile-classes
 
53
        $(JAVAH) -o $(CSRC_DIR)/bindings.h -classpath $(CLASSES_DIR)  org.sf.rhash.Bindings
 
54
 
 
55
jni:
 
56
        $(MAKE) -C $(CSRC_DIR)
 
57
        mkdir -p $(DEST_DIR)
 
58
        cp $(CSRC_DIR)/*rhash-jni* $(DEST_DIR)
 
59
 
 
60
javadoc: clean-javadoc
 
61
        $(JAVADOC) -windowtitle 'RHash' \
 
62
                   -sourcepath src \
 
63
                   -subpackages org \
 
64
                   -d $(JAVADOC_DIR) \
 
65
                   -link $(JAVADOC_API_URL)
 
66
 
 
67
test: jar jni
 
68
        $(JAVAC) -classpath $(JARFILE) $(TEST_DIR)/Test.java
 
69
        $(JAVA) -classpath $(TEST_DIR):$(JARFILE) -Djava.library.path=$(DEST_DIR) Test
 
70
 
 
71
clean: clean-javadoc clean-jni clean-classes clean-test
 
72
 
 
73
clean-javadoc:
 
74
        rm -rf $(JAVADOC_DIR)
 
75
 
 
76
clean-classes:
 
77
        rm -rf $(CLASSES_DIR)
 
78
 
 
79
clean-jni:
 
80
        $(MAKE) -C $(CSRC_DIR) clean
 
81
 
 
82
clean-test:
 
83
        rm -f $(TEST_DIR)/*.class
 
84
 
 
85
distclean: clean
 
86
        rm -rf $(DEST_DIR)
 
87
 
 
88
.PHONY: jar jni javadoc clean clean-javadoc distclean