Add axTLS sourcecode
[project/luci.git] / libs / nixio / axTLS / bindings / java / Makefile
1 #
2 # Copyright (c) 2007, Cameron Rich
3 #
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 #
9 # * Redistributions of source code must retain the above copyright notice,
10 #   this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above copyright
12 #   notice, this list of conditions and the following disclaimer in the
13 #   documentation and/or other materials provided with the distribution.
14 # * Neither the name of the axTLS project nor the names of its
15 #   contributors may be used to endorse or promote products derived
16 #   from this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24 # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 
26 # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #
30
31 AXTLS_HOME=../..
32
33 include $(AXTLS_HOME)/config/.config
34 include $(AXTLS_HOME)/config/makefile.conf
35 include $(AXTLS_HOME)/config/makefile.java.conf
36
37 all: lib jar
38
39 JAR=$(AXTLS_HOME)/$(STAGE)/axtls.jar
40
41 ifdef CONFIG_PLATFORM_WIN32
42 TARGET=$(AXTLS_HOME)/$(STAGE)/axtlsj.dll
43 else
44 TARGET=$(AXTLS_HOME)/$(STAGE)/libaxtlsj.so
45 endif
46
47 lib: $(TARGET)
48 axTLSj_wrap.o : axTLSj_wrap.c
49
50 JAVA_FILES= \
51         axtlsjJNI.java \
52         axtlsjConstants.java \
53         axtlsj.java \
54         SSLReadHolder.java \
55         SSL.java \
56         SSLUtil.java \
57         SSLCTX.java \
58         SSLServer.java \
59         SSLClient.java
60
61 OBJ=axTLSj_wrap.o
62
63 JAVA_CLASSES:=$(JAVA_FILES:%.java=classes/axTLSj/%.class)
64
65 ifdef CONFIG_PLATFORM_WIN32
66 LDFLAGS += axtls.lib /libpath:"$(AXTLS_HOME)/$(STAGE)"
67
68 include $(AXTLS_HOME)/config/makefile.post
69
70 $(TARGET) : $(OBJ)
71         $(LD) $(LDFLAGS) $(LDSHARED) /out:$@ $(OBJ)
72 else    # Not Win32
73
74 $(TARGET) : $(OBJ)
75         $(LD) $(LDFLAGS) -L $(AXTLS_HOME)/$(STAGE) $(LDSHARED) -o $@ $(OBJ) -laxtls 
76 endif
77
78 jar: $(OBJ) $(JAR)
79
80 # if we are doing the samples then defer creating the jar until then
81 $(JAR): $(JAVA_CLASSES)
82 ifndef CONFIG_JAVA_SAMPLES
83         jar cvf $@ -C classes axTLSj
84 else
85         @if [ ! -f $(JAR) ]; then touch $(JAR); fi
86 endif
87
88 classes/axTLSj/%.class : %.java
89         javac -d classes -classpath classes $^
90
91 clean::
92         @rm -f $(JAR) $(TARGET) SWIG* axtls* *.i *.c 
93         @rm -fr classes/*
94