-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.msvc
114 lines (93 loc) · 3.11 KB
/
Makefile.msvc
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# ----
# The original author is Eugene Melekhov <eugene_melekhov@mail.ru>
# Object Tools http://www.object-tools.com
# Contributed to rxtx Wed Sep 8 2004
# Reportedly builds rxtxSerial.dll but rxtxParallel.dll is untested.
# Accepted as is by taj@www.linux.org.uk
# ---
# This is the first quick and durty attempt to compile rxtx for Windows
# using Microsoft Visual C compiler. I've done this mostly to debug rxtx
# with Microsoft debugger
#
# This makefile was made for MSVC 6.0. I'm afraid that debug info command
# line switches like /Z7 -debugtype:CV -pdb:NONE won't work with
# MSVC 7.0 or above.
#
# The serial port library seems to be working, execept the hangup while
# writing to unpluged serial port. BTW the mingw32 library behavior
# is the same.
#
# Parallel port library compiles, but I have not used it
#
# To build rxtx library execute commands like the following
# mkdir build
# copy Makefile.msc build\Makefile
# cd build
# nmake
#
# To build only serial/parallel library use
# nmake serial
# or
# nmake parallel
#
# If you wish to make the version with debug info then do something
# like this
# nmake serial DEBUG_INFO=1
#
# 'nmake clean' will remove all object dll and other working files
#
# Please make sure that variable JAVA_HOME points to the place where
# your Java SDK is located
#
JAVA_HOME = D:\j2sdk1.4.2_04
JAVAC = $(JAVA_HOME)\bin\javac
JAR = $(JAVA_HOME)\bin\jar
JAVAH = $(JAVA_HOME)\bin\javah
SRC=..\src
CFLAGS= -nologo -I$(JAVA_HOME)\include -I$(JAVA_HOME)\include\win32 -I$(SRC) -I. -DWIN32
LINK_FLAGS = -nologo -map -incremental:no
!IFDEF DEBUG_INFO
CFLAGS = -Z7 -Oi -Oy- $(CFLAGS)
CFLAGS_DLL = $(CFLAGS_DLL) -GZ
LINK_FLAGS = $(LINK_FLAGS) -debug -debugtype:CV -pdb:NONE
DEBUG_INFO_FLAG = DEBUG_INFO^=1
!ELSE
CFLAGS = $(CFLAGS) -Ox
!ENDIF
OBJS=init.obj SerialImp.obj termios.obj fuserImp.obj
PARALLEL_OBJS= ParallelImp.obj termios.obj init.obj
all: serial parallel
serial: RXTXcomm.jar rxtxSerial.dll
parallel: RXTXcomm.jar rxtxParallel.dll
init.obj: config.h
$(CC) $(CFLAGS) /TP -c $(SRC)\init.cc
fixup.obj: config.h
$(CC) $(CFLAGS) -c $(SRC)\fixup.c
fuserImp.obj: config.h gnu_io_CommPortIdentifier.h
$(CC) $(CFLAGS) -c $(SRC)/fuserImp.c
termios.obj:
$(CC) $(CFLAGS) -c $(SRC)/termios.c
SerialImp.obj: config.h gnu_io_RXTXPort.h
$(CC) $(CFLAGS) -c $(SRC)\SerialImp.c
ParallelImp.obj: config.h gnu_io_LPRPort.h
$(CC) $(CFLAGS) -c $(SRC)\ParallelImp.c
rxtxSerial.dll: $(OBJS)
link -dll -out:$@ $** $(LINK_FLAGS)
rxtxParallel.dll: $(PARALLEL_OBJS)
link -dll -out:$@ $** $(LINK_FLAGS)
gnu_io_RXTXPort.h gnu_io_CommPortIdentifier.h gnu_io_LPRPort.h: RXTXcomm.jar
$(JAVAH) -jni gnu.io.RXTXPort gnu.io.CommPortIdentifier gnu.io.LPRPort
RXTXcomm.jar:
$(JAVAC) -d . ..\src\*.java
$(JAR) -cf RXTXcomm.jar gnu
config.h: Makefile
echo #define HAVE_FCNTL_H >> config.h
echo #define HAVE_SIGNAL_H >> config.h
echo #undef HAVE_SYS_FCNTL_H >> config.h
echo #undef HAVE_SYS_FILE_H >> config.h
echo #undef HAVE_SYS_SIGNAL_H >> config.h
echo #undef HAVE_TERMIOS_H >> config.h
echo #undef HAVE_SYS_TIME_H >> config.h
clean:
-rmdir /s /q gnu
-del *.obj *.h RXTXcomm.jar rxtxSerial.* rxtxParallel.*