~ubuntu-branches/ubuntu/edgy/rxtx/edgy-201105201527

« back to all changes in this revision

Viewing changes to Makefile.msvc

  • Committer: Bazaar Package Importer
  • Author(s): Mario Joussen
  • Date: 2006-03-01 18:56:52 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060301185652-ri9941gi01goklvz
Tags: 2.1.7-2
Fixed stupid bug in clean target.
(closes: Bug#354859)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ----
 
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
 
7
# ---
 
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
 
11
#
 
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 
 
14
# MSVC 7.0 or above.
 
15
#
 
16
# The serial port library seems to be working, execept the hangup while 
 
17
# writing to  unpluged serial port. BTW the mingw32 library behavior 
 
18
# is the same.
 
19
#
 
20
# Parallel port library compiles, but I have not used it
 
21
#
 
22
# To build rxtx library execute commands like the following
 
23
#  mkdir build
 
24
#  copy Makefile.msc build\Makefile
 
25
#  cd build
 
26
#  nmake
 
27
#
 
28
# To build only serial/parallel library use
 
29
# nmake serial
 
30
# or 
 
31
# nmake parallel
 
32
#
 
33
# If you wish to make the version with debug info then do something 
 
34
# like this
 
35
# nmake serial DEBUG_INFO=1
 
36
#
 
37
# 'nmake clean' will remove all object dll and other working files  
 
38
#
 
39
# Please make sure that variable JAVA_HOME points to the place where 
 
40
# your Java SDK is located
 
41
#
 
42
 
 
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
 
47
 
 
48
 
 
49
SRC=..\src
 
50
CFLAGS= -nologo -I$(JAVA_HOME)\include -I$(JAVA_HOME)\include\win32 -I$(SRC) -I. -DWIN32
 
51
LINK_FLAGS = -nologo -map -incremental:no
 
52
 
 
53
!IFDEF DEBUG_INFO
 
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
 
58
!ELSE
 
59
CFLAGS = $(CFLAGS) -Ox
 
60
!ENDIF
 
61
 
 
62
OBJS=init.obj SerialImp.obj termios.obj fuserImp.obj
 
63
PARALLEL_OBJS= ParallelImp.obj termios.obj init.obj
 
64
 
 
65
 
 
66
all: serial parallel
 
67
 
 
68
serial: RXTXcomm.jar rxtxSerial.dll
 
69
 
 
70
parallel: RXTXcomm.jar rxtxParallel.dll
 
71
 
 
72
init.obj: config.h
 
73
        $(CC) $(CFLAGS) /TP -c $(SRC)\init.cc
 
74
 
 
75
fixup.obj: config.h
 
76
        $(CC) $(CFLAGS) -c $(SRC)\fixup.c
 
77
 
 
78
fuserImp.obj: config.h gnu_io_CommPortIdentifier.h
 
79
        $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c
 
80
 
 
81
termios.obj:
 
82
        $(CC) $(CFLAGS) -c $(SRC)/termios.c
 
83
SerialImp.obj:  config.h gnu_io_RXTXPort.h
 
84
        $(CC) $(CFLAGS) -c $(SRC)\SerialImp.c
 
85
 
 
86
ParallelImp.obj:  config.h gnu_io_LPRPort.h
 
87
        $(CC) $(CFLAGS) -c $(SRC)\ParallelImp.c
 
88
 
 
89
rxtxSerial.dll: $(OBJS)
 
90
        link -dll -out:$@ $** $(LINK_FLAGS)
 
91
 
 
92
rxtxParallel.dll: $(PARALLEL_OBJS)
 
93
        link -dll -out:$@ $** $(LINK_FLAGS)
 
94
 
 
95
 
 
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
 
98
 
 
99
RXTXcomm.jar:
 
100
        $(JAVAC) -d . ..\src\*.java
 
101
        $(JAR) -cf RXTXcomm.jar gnu
 
102
 
 
103
config.h: Makefile
 
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
 
111
 
 
112
clean:
 
113
        -rmdir /s /q gnu
 
114
        -del *.obj *.h RXTXcomm.jar rxtxSerial.* rxtxParallel.*