38
38
# path to the jdk directory that has include, bin, lib, ... Unix style path
42
42
MINGHOME="D:/mingw"
44
44
# path to install RXTXcomm.jar DOS style path
45
COMMINSTALL="C:\jdk1.1.8\lib"
45
COMMINSTALL="C:\jdk13\lib"
47
47
# path to install the shared libraries DOS style path
48
LIBINSTALL="C:\jdk1.1.8\bin"
48
LIBINSTALL="C:\jdk13\bin"
50
50
# path to the mingw32 libraries (directory with libmingw32.a) DOS style path
51
LIBDIR="c:\cygwin\lib\mingw"
53
53
######################
54
54
# End of user defined variables
76
76
######################
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
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
91
96
all: $(TARGETLIBS) # rebuild rebuild will force everything to be built.
123
131
$(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o
133
ParallelImp.o: include/config.h
134
$(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o
125
136
# This file is a pain in the rear to generate. If your looking at this you
126
137
# need to install cygwin.
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\\
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\\
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
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
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
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
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
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
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
154
204
RXTXcomm.jar: gnutimestamp
155
205
$(JAVAC) gnu\\io\\*.java
156
206
$(JAR) -cf RXTXcomm.jar gnu\\io\\*.class