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

« back to all changes in this revision

Viewing changes to Makefile.mingw32

  • 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
1
#-------------------------------------------------------------------------
2
2
#   rxtx is a native interface to serial ports in java.
3
 
#   Copyright 1997-2002 by Trent Jarvi taj@www.linux.org.uk.
 
3
#   Copyright 1997-2004 by Trent Jarvi taj@www.linux.org.uk.
4
4
#
5
5
#   This library is free software; you can redistribute it and/or
6
6
#   modify it under the terms of the GNU Library General Public
36
36
DOSSRC=..\\\src
37
37
 
38
38
# path to the jdk directory that has include, bin, lib, ... Unix style path
39
 
JDKHOME=C:/jdk1.1.8
 
39
JDKHOME=C:/jdk13
40
40
 
41
41
#path to mingw32
42
42
MINGHOME="D:/mingw"
43
43
 
44
44
# path to install RXTXcomm.jar DOS style path
45
 
COMMINSTALL="C:\jdk1.1.8\lib"
 
45
COMMINSTALL="C:\jdk13\lib"
46
46
 
47
47
# path to install the shared libraries DOS style path
48
 
LIBINSTALL="C:\jdk1.1.8\bin"
 
48
LIBINSTALL="C:\jdk13\bin"
49
49
 
50
50
# path to the mingw32 libraries (directory with libmingw32.a) DOS style path
51
 
LIBDIR="D:\mingw\lib"
 
51
LIBDIR="c:\cygwin\lib\mingw"
52
52
 
53
53
######################
54
54
#  End of user defined variables
66
66
# this looks like a nice tool but I was not able to get symbols in the dll.
67
67
DLLWRAP=dllwrap
68
68
 
69
 
CLASSPATH=-classpath ".;C:\jdk1..18\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk1.1.8\lib\classes.zip"
 
69
CLASSPATH=-classpath ".;C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip"
70
70
JAVAH=javah $(CLASSPATH)
71
71
JAR=jar 
72
72
JAVAC=javac $(CLASSPATH)
75
75
#  Tool Flags
76
76
######################
77
77
 
78
 
CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS
79
 
INCLUDE= -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE)
 
78
CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387  -Wall 
 
79
CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387  -Wall
 
80
#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS
 
81
INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE)
80
82
JAVAHFLAGS= -jni -d include
81
 
LIBS=-L $(LIBDIR) -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmingw32 -lmoldname -lcrtdll
 
83
LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll
 
84
# -lmex
82
85
 
83
86
# path to the java native interface headers (directory with jni.h)
84
87
JDKINCLUDE=$(JDKHOME)/include
85
88
MINGINCLUDE=$(MINGHOME)/include
86
89
JAVAFILES = $(wildcard $(SRC)/*.java)
87
90
CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc)
88
 
TARGETLIBS= rxtxSerial.dll 
 
91
TARGETLIBS= rxtxSerial.dll rxtxParallel.dll
 
92
#TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll
89
93
DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o
 
94
PARALLELOBJECTS= ParallelImp.o termios.o init.o
90
95
 
91
96
all:  $(TARGETLIBS) # rebuild  rebuild will force everything to be built.
92
97
 
102
107
 
103
108
# yayaya We should have put the files in gnu.io to start with
104
109
gnutimestamp:   $(JAVAFILES) $(CFILES) include gnu
105
 
        xcopy $(DOSSRC)\\*.* gnu\\io\\
 
110
        xcopy /Y $(DOSSRC)\\*.* gnu\\io\\
106
111
        echo > gnutimestamp
107
112
 
108
113
# FIXME make 3.79.1 behaves really strage if we use %.o rules.
113
118
fixup.o:
114
119
        $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o
115
120
 
116
 
SerialImp.o:
 
121
#ZystemImp.o:  include/config.h
 
122
#       $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o
 
123
 
 
124
SerialImp.o:  include/config.h
117
125
        $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o
118
126
 
119
127
fuserImp.o:
122
130
termios.o:
123
131
        $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o
124
132
 
 
133
ParallelImp.o:  include/config.h
 
134
        $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o
 
135
 
125
136
#  This file is a pain in the rear to generate.  If your looking at this you
126
137
#  need to install cygwin.
127
138
 
 
139
#$(SRC)/Zystem.def:     $(DLLOBJECTS) ZystemImp.o
 
140
        #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin  -e _dll_entry@12
 
141
        #xcopy /Y  $(DOSSRC)\\Zystem.def gnu\\io\\
 
142
 
 
143
 
128
144
$(SRC)/Serial.def:      $(DLLOBJECTS)
129
 
        $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -e _dll_entry@12
130
 
        xcopy  $(DOSSRC)\\Serial.def gnu\\io\\
 
145
        $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12
 
146
        xcopy /Y  $(DOSSRC)\\Serial.def gnu\\io\\
131
147
 
132
148
#       echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def
133
149
 
134
150
 
135
 
$(TARGETLIBS):  RXTXcomm.jar $(DLLOBJECTS)  $(SRC)/Serial.def
 
151
$(SRC)/Parallel.def:    $(PARALLELOBJECTS)
 
152
        $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12
 
153
        xcopy  $(DOSSRC)\\Parallel.def gnu\\io\\
 
154
#       echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def
 
155
 
 
156
 
 
157
rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def
 
158
        gcc  -c -DBUILDING_DLL=1 -D_DLL=1  -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32  -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c
 
159
        dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc  -o rxtxZystem.dll ZystemImp.o -Wl,-e,__cygwin_noncygwin_dll_entry@12 -s
 
160
 
 
161
#rxtxZystem.dll:        RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def
 
162
        #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \
 
163
                #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12
 
164
        #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \
 
165
                #--base-file Zystem.base --output-exp Zystem.exp
 
166
        #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \
 
167
                #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12
 
168
        #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \
 
169
                #--base-file Zystem.base --output-exp Zystem.exp
 
170
        #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \
 
171
                #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12
 
172
 
 
173
rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS)  $(SRC)/Serial.def
136
174
        $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \
137
 
                $(LIBS) -e _dll_entry@12
138
 
        $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \
139
 
                --base-file Serial.base --output-exp Serial.exp
140
 
        $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \
141
 
                $(DLLOBJECTS) $(LIBS) -e _dll_entry@12
142
 
        $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \
143
 
                --base-file Serial.base --output-exp Serial.exp
144
 
        $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \
145
 
                $(DLLOBJECTS) $(LIBS) -e _dll_entry@12
 
175
                $(LIBS) -lmingw32 -e _dll_entry@12
 
176
        $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \
 
177
                --base-file Serial.base --output-exp Serial.exp
 
178
        $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \
 
179
                $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12
 
180
        $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \
 
181
                --base-file Serial.base --output-exp Serial.exp
 
182
        $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \
 
183
                $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12
146
184
#
147
185
# This should replace the mess above if it worked.
148
186
# nm shows no symbols in the dll produced.  The old stuff above works ok.
151
189
#               --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s
152
190
#               -mno-cygwin
153
191
 
 
192
rxtxParallel.dll: $(PARALLELOBJECTS)
 
193
        $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \
 
194
                $(LIBS) -lmingw32 -e _dll_entry@12
 
195
        $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \
 
196
                --base-file Parallel.base --output-exp Parallel.exp
 
197
        $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \
 
198
                $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12
 
199
        $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \
 
200
                --base-file Parallel.base --output-exp Parallel.exp
 
201
        $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \
 
202
                $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12
 
203
 
154
204
RXTXcomm.jar:   gnutimestamp
155
205
        $(JAVAC) gnu\\io\\*.java
156
206
        $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class