-
Notifications
You must be signed in to change notification settings - Fork 59
/
Makefile.in
89 lines (69 loc) · 3 KB
/
Makefile.in
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
SHELL = /bin/sh
VERSION = @PACKAGE_VERSION@
PACKAGE = com.etsy.net
PACKAGE_DIR = com/etsy/net
TEST_SOCKET_FILE = JUDS_TEST_SOCKET_FILE
CC = gcc
JAVA_HOME = @JAVA_HOME@
JAVAC = @JAVAC@
JAR = $(JAVA_HOME)/bin/jar
JAVAH = $(JAVA_HOME)/bin/javah -sourcepath .
PLATFORM=@PLATFORM@
PREFIX = /usr
CFLAGS = @CFLAGS@ @LIBSWITCH@
JAVA_FLAGS = -g:none -deprecation -sourcepath .
NATIVELIB=libunixdomainsocket
LIBEXT=@LIBEXT@
INCLUDEPATH = -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/$(PLATFORM)
LIB32=$(NATIVELIB)-$(PLATFORM)-i386.$(LIBEXT)
LIB64=$(NATIVELIB)-$(PLATFORM)-x86_64.$(LIBEXT)
M32=@M32@
M64=@M64@
JARFILE=juds-$(VERSION).jar
UNIJARFILE=juds-$(VERSION)-universal.jar
all: jar
jar: $(JARFILE)
# requires that the binaries from other platforms are copied here.
universal: jar
cp $(JARFILE) $(UNIJARFILE)
$(JAR) uf $(UNIJARFILE) $(NATIVELIB)-darwin-i386.dylib $(NATIVELIB)-darwin-x86_64.dylib $(NATIVELIB)-linux-x86_64.so $(NATIVELIB)-linux-i386.so
package: universal
mkdir juds-$(VERSION)-universal
cp $(UNIJARFILE) juds-$(VERSION)-universal
cp README.md juds-$(VERSION)-universal
cp COPYRIGHT juds-$(VERSION)-universal
tar pczf juds-$(VERSION)-universal.tar.gz juds-$(VERSION)-universal
rm -rf juds-$(VERSION)-universal
juds-$(VERSION).jar: $(PACKAGE_DIR)/UnixDomainSocket.class $(PACKAGE_DIR)/UnixDomainSocketClient.class $(PACKAGE_DIR)/UnixDomainSocketServer.class nativelib $(PACKAGE_DIR)/JUDS.class
$(JAR) cf $@ $(PACKAGE_DIR)/*.class $(LIB64) $(LIB32)
nativelib: $(PACKAGE_DIR)/UnixDomainSocket.c $(PACKAGE_DIR)/UnixDomainSocket.h
$(CC) $(CFLAGS) -fPIC $(INCLUDEPATH) $(M32) -o $(LIB32) $<
$(CC) $(CFLAGS) -fPIC $(INCLUDEPATH) $(M64) -o $(LIB64) $<
$(PACKAGE_DIR)/UnixDomainSocket.h: $(PACKAGE).UnixDomainSocket
$(JAVAH) -o $@ $<
$(PACKAGE).UnixDomainSocket: $(PACKAGE_DIR)/UnixDomainSocket.class
$(PACKAGE_DIR)/JUDS.class: $(PACKAGE_DIR)/JUDS.java
$(JAVAC) $(JAVA_FLAGS) $?
$(PACKAGE_DIR)/UnixDomainSocket.class: $(PACKAGE_DIR)/UnixDomainSocket.java
$(JAVAC) $(JAVA_FLAGS) $?
$(PACKAGE_DIR)/UnixDomainSocketClient.class: $(PACKAGE_DIR)/UnixDomainSocketClient.java
$(JAVAC) $(JAVA_FLAGS) $?
$(PACKAGE_DIR)/UnixDomainSocketServer.class: $(PACKAGE_DIR)/UnixDomainSocketServer.java
$(JAVAC) $(JAVA_FLAGS) $?
install: nativelib
cp $(LIB32) $(LIB64) $(PREFIX)/lib
uninstall:
rm -f $(PREFIX)/lib/$(LIB32) $(PREFIX)/lib/$(LIB64)
test: test/TestUnixDomainSocket.class test/TestUnixDomainSocketServer.class
python test/TestUnixDomainSocket.py $(TEST_SOCKET_FILE) &
@sleep 2
java -cp $(JARFILE):test TestUnixDomainSocket $(TEST_SOCKET_FILE)
rm -f $(TEST_SOCKET_FILE)
java -cp $(JARFILE):test TestUnixDomainSocketServer $(TEST_SOCKET_FILE)
rm -f $(TEST_SOCKET_FILE)
test/TestUnixDomainSocket.class: test/TestUnixDomainSocket.java jar
$(JAVAC) -cp $(JARFILE) $(JAVA_FLAGS) $<
test/TestUnixDomainSocketServer.class: test/TestUnixDomainSocketServer.java jar
$(JAVAC) -cp $(JARFILE) $(JAVA_FLAGS) $<
clean:
rm -f $(PACKAGE_DIR)/*.class $(PACKAGE_DIR)/test/*.class $(PACKAGE_DIR)/*.h *.so *.jar $(TEST_SOCKET_FILE) test/*class