2
# The original author is Eugene Melekhov <eugene_melekhov@mail.ru>
3
# Object Tools http://www.object-tools.com
4
# Contributed to rxtx Wed Sep 8 2004
5
# Reportedly builds rxtxSerial.dll but rxtxParallel.dll is untested.
6
# Accepted as is by taj@www.linux.org.uk
8
# This is the first quick and durty attempt to compile rxtx for Windows
9
# using Microsoft Visual C compiler. I've done this mostly to debug rxtx
10
# with Microsoft debugger
12
# This makefile was made for MSVC 6.0. I'm afraid that debug info command
13
# line switches like /Z7 -debugtype:CV -pdb:NONE won't work with
16
# The serial port library seems to be working, execept the hangup while
17
# writing to unpluged serial port. BTW the mingw32 library behavior
20
# Parallel port library compiles, but I have not used it
22
# To build rxtx library execute commands like the following
24
# copy Makefile.msc build\Makefile
28
# To build only serial/parallel library use
33
# If you wish to make the version with debug info then do something
35
# nmake serial DEBUG_INFO=1
37
# 'nmake clean' will remove all object dll and other working files
39
# Please make sure that variable JAVA_HOME points to the place where
40
# your Java SDK is located
43
JAVA_HOME = D:\j2sdk1.4.2_04
44
JAVAC = $(JAVA_HOME)\bin\javac
45
JAR = $(JAVA_HOME)\bin\jar
46
JAVAH = $(JAVA_HOME)\bin\javah
50
CFLAGS= -nologo -I$(JAVA_HOME)\include -I$(JAVA_HOME)\include\win32 -I$(SRC) -I. -DWIN32
51
LINK_FLAGS = -nologo -map -incremental:no
54
CFLAGS = -Z7 -Oi -Oy- $(CFLAGS)
55
CFLAGS_DLL = $(CFLAGS_DLL) -GZ
56
LINK_FLAGS = $(LINK_FLAGS) -debug -debugtype:CV -pdb:NONE
57
DEBUG_INFO_FLAG = DEBUG_INFO^=1
59
CFLAGS = $(CFLAGS) -Ox
62
OBJS=init.obj SerialImp.obj termios.obj fuserImp.obj
63
PARALLEL_OBJS= ParallelImp.obj termios.obj init.obj
68
serial: RXTXcomm.jar rxtxSerial.dll
70
parallel: RXTXcomm.jar rxtxParallel.dll
73
$(CC) $(CFLAGS) /TP -c $(SRC)\init.cc
76
$(CC) $(CFLAGS) -c $(SRC)\fixup.c
78
fuserImp.obj: config.h gnu_io_CommPortIdentifier.h
79
$(CC) $(CFLAGS) -c $(SRC)/fuserImp.c
82
$(CC) $(CFLAGS) -c $(SRC)/termios.c
83
SerialImp.obj: config.h gnu_io_RXTXPort.h
84
$(CC) $(CFLAGS) -c $(SRC)\SerialImp.c
86
ParallelImp.obj: config.h gnu_io_LPRPort.h
87
$(CC) $(CFLAGS) -c $(SRC)\ParallelImp.c
89
rxtxSerial.dll: $(OBJS)
90
link -dll -out:$@ $** $(LINK_FLAGS)
92
rxtxParallel.dll: $(PARALLEL_OBJS)
93
link -dll -out:$@ $** $(LINK_FLAGS)
96
gnu_io_RXTXPort.h gnu_io_CommPortIdentifier.h gnu_io_LPRPort.h: RXTXcomm.jar
97
$(JAVAH) -jni gnu.io.RXTXPort gnu.io.CommPortIdentifier gnu.io.LPRPort
100
$(JAVAC) -d . ..\src\*.java
101
$(JAR) -cf RXTXcomm.jar gnu
104
echo #define HAVE_FCNTL_H >> config.h
105
echo #define HAVE_SIGNAL_H >> config.h
106
echo #undef HAVE_SYS_FCNTL_H >> config.h
107
echo #undef HAVE_SYS_FILE_H >> config.h
108
echo #undef HAVE_SYS_SIGNAL_H >> config.h
109
echo #undef HAVE_TERMIOS_H >> config.h
110
echo #undef HAVE_SYS_TIME_H >> config.h
114
-del *.obj *.h RXTXcomm.jar rxtxSerial.* rxtxParallel.*