Skip to content

Commit 68e555f

Browse files
committed
Fixed mingw32 compilation
1 parent 46ca19b commit 68e555f

File tree

6 files changed

+12
-43
lines changed

6 files changed

+12
-43
lines changed

Makefile.mingw32

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

2-
GCC = i586-mingw32msvc-gcc -Wall
3-
INC = -I ../pthreads-win32
4-
LIB = -lwsock32 -lpthreadGC2 -L ../pthreads-win32
2+
#CC = i686-w64-mingw32.static-gcc -Wall
3+
LIB = -lwsock32 -lpthread
54

65
ifeq "x$(PREFIX)" "x"
76
PREFIX = $(PS2DEV)
@@ -19,31 +18,31 @@
1918
OFILES += obj/network.o
2019
obj/network.o: src/network.c src/network.h
2120
@mkdir -p obj
22-
$(GCC) $(INC) -c src/network.c -o obj/network.o
21+
$(CC) $(INC) -c src/network.c -o obj/network.o
2322

2423
OFILES += obj/ps2link.o
2524
obj/ps2link.o: src/ps2link.c src/ps2link.h
2625
@mkdir -p obj
27-
$(GCC) $(INC) -c src/ps2link.c -o obj/ps2link.o
26+
$(CC) $(INC) -c src/ps2link.c -o obj/ps2link.o
2827

2928
OFILES += obj/ps2netfs.o
3029
obj/ps2netfs.o: src/ps2netfs.c
3130
@mkdir -p obj
32-
$(GCC) $(INC) -c src/ps2netfs.c -o obj/ps2netfs.o
31+
$(CC) $(INC) -c src/ps2netfs.c -o obj/ps2netfs.o
3332

3433
OFILES += obj/utility.o
3534
obj/utility.o: src/utility.c src/utility.h
3635
@mkdir -p obj
37-
$(GCC) $(INC) -c src/utility.c -o obj/utility.o
36+
$(CC) $(INC) -c src/utility.c -o obj/utility.o
3837

3938
#####################
4039
## CLIENT PROGRAMS ##
4140
#####################
4241

4342
bin/fsclient.exe: $(OFILES) src/fsclient.c
4443
@mkdir -p bin
45-
$(GCC) $(INC) $(OFILES) src/fsclient.c -o bin/fsclient.exe $(LIB)
44+
$(CC) $(INC) $(OFILES) src/fsclient.c -o bin/fsclient.exe $(LIB)
4645

4746
bin/ps2client.exe: $(OFILES) src/ps2client.c
4847
@mkdir -p bin
49-
$(GCC) $(INC) $(OFILES) src/ps2client.c -o bin/ps2client.exe $(LIB)
48+
$(CC) $(INC) $(OFILES) src/ps2client.c -o bin/ps2client.exe $(LIB)

doc/readme-mingw32.txt

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,5 @@
88
----------------------------------
99

1010
Since now, ps2client uses the pthread library to work, you need the
11-
pthreads-win32 native library to compile ps2client using a mingw32
12-
compiler. You want to download the prebuilt binaries and headers
13-
from ftp://sources.redhat.com/pub/pthreads-win32 and put them
14-
in the ../pthreads-win32 directory. You need the following files:
15-
16-
libpthreadGC2.a
17-
pthread.h
18-
pthreadGC2.dll
19-
sched.h
20-
semaphore.h
21-
22-
Note that if you're using a linux host to cross compile, you probably
23-
want to dos2unix *.h before compiling.
24-
25-
------------------
26-
MORE INFORMATION
27-
------------------
28-
29-
If you want to get into the wonderful world of homebrew ps2
30-
development, there's a few places you can check out:
31-
32-
http://www.ps2dev.org - News, tutorials and documentation.
33-
34-
http://forums.ps2dev.org - The official ps2dev forums.
35-
36-
#ps2dev on efnet (IRC) - Come banter in realtime.
11+
threads support. For example you can use MXE/MinGW-w64 with win32
12+
threads.

src/fsclient.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#include <unistd.h>
77
#ifndef _WIN32
88
#include <netinet/in.h>
9-
#else
10-
#include <windows.h>
119
#endif
1210
#include "utility.h"
1311
#include "ps2netfs.h"

src/network.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11

2-
#ifdef _WIN32
3-
#include <windows.h>
4-
#include <winsock2.h>
5-
#else
2+
#ifndef _WIN32
63
#include <netdb.h>
74
#include <unistd.h>
85
#include <sys/socket.h>

src/network.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#ifdef _WIN32
55
#include <winsock2.h>
6+
#include <windows.h>
67
#else
78
#include <sys/socket.h>
89
#endif

src/ps2netfs.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#include <string.h>
44
#ifndef _WIN32
55
#include <netinet/in.h>
6-
#else
7-
#include <windows.h>
86
#endif
97
#include "utility.h"
108
#include "network.h"

0 commit comments

Comments
 (0)