|
@@ -8,10 +8,17 @@ RM = del
|
8
|
8
|
INJAR += Serial.dll
|
9
|
9
|
PLATFORM = Win
|
10
|
10
|
else
|
11
|
|
-HEADERPATH = /System/Library/Frameworks/JavaVM.framework/Headers
|
12
|
11
|
RM = rm -f
|
|
12
|
+UNAME := $(shell uname -s)
|
|
13
|
+ifeq ($(UNAME),Darwin)
|
13
|
14
|
INJAR += libSerial.jnilib
|
14
|
15
|
PLATFORM = Mac
|
|
16
|
+HEADERPATH = /System/Library/Frameworks/JavaVM.framework/Headers
|
|
17
|
+else
|
|
18
|
+INJAR += libSerial.so
|
|
19
|
+PLATFORM = Linux
|
|
20
|
+HEADERPATH = /usr/java-1.6/include
|
|
21
|
+endif
|
15
|
22
|
endif
|
16
|
23
|
|
17
|
24
|
# All java files to be compiled
|
|
@@ -39,7 +46,11 @@ doc/index.html: $(JAVAFILES)
|
39
|
46
|
ifdef SystemRoot
|
40
|
47
|
libSerial: Serial.dll
|
41
|
48
|
else
|
|
49
|
+ifeq ($(UNAME),Darwin)
|
42
|
50
|
libSerial: libSerial.jnilib
|
|
51
|
+else
|
|
52
|
+libSerial: libSerial.so
|
|
53
|
+endif
|
43
|
54
|
endif
|
44
|
55
|
|
45
|
56
|
Serial.dll: libSerial/serialHelper.c libSerial/winSerial.c
|
|
@@ -50,6 +61,10 @@ libSerial.jnilib: libSerial/serialHelper.c libSerial/unixSerial.c
|
50
|
61
|
make -C libSerial
|
51
|
62
|
mv libSerial/libSerial.jnilib libSerial.jnilib
|
52
|
63
|
|
|
64
|
+libSerial.so: libSerial/serialHelper.c libSerial/unixSerial.c
|
|
65
|
+ make -C libSerial
|
|
66
|
+ mv libSerial/libSerial.so libSerial.so
|
|
67
|
+
|
53
|
68
|
# Delete intermediate files
|
54
|
69
|
clean:
|
55
|
70
|
make -C libSerial clean
|