Index: /trunk/Platform/ps2.mk
===================================================================
--- /trunk/Platform/ps2.mk	(revision 189)
+++ /trunk/Platform/ps2.mk	(revision 189)
@@ -0,0 +1,13 @@
+# $Id$
+
+PREFIX = /dev_hdd0/httpd
+
+CC = mips64r5900el-ps2-elf-gcc
+AR = mips64r5900el-ps2-elf-ar
+CFLAGS = -O2 -D_EE -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -I /usr/local/ps2dev/ps2sdk/ee/include -I /usr/local/ps2dev/ps2sdk/common/include
+LDFLAGS = -T/usr/local/ps2dev/ps2sdk/ee/startup/linkfile -L /usr/local/ps2dev/ps2sdk/ee/lib -O2
+LIBS = -ldebug -lsocket
+EXEC = .elf
+LIB = .so
+MODULE =
+SERVADD = mips64r5900el-ps2-elf-strip tewi.elf -o tewi_strip.elf
Index: /trunk/Server/Makefile
===================================================================
--- /trunk/Server/Makefile	(revision 188)
+++ /trunk/Server/Makefile	(revision 189)
@@ -6,5 +6,5 @@
 .SUFFIXES: .c .o
 
-OBJS = version.o main.o config.o server.o http.o module.o strptime.o $(EXTOBJS) $(PREOBJS)
+OBJS = main.o version.o config.o server.o http.o module.o strptime.o $(EXTOBJS) $(PREOBJS)
 
 all: tewi$(EXEC) $(TARGET)
@@ -13,5 +13,5 @@
 
 tewi$(EXEC): $(OBJS) ../Common/common.a
-	$(CC) $(LDFLAGS) $(EXTLDFLAGS) -o $@ $(OBJS) $(EXTLIBS) $(LIBS) ../Common/common.a
+	$(CC) $(LDFLAGS) $(EXTLDFLAGS) -o $@ $(OBJS) $(EXTLIBS) ../Common/common.a $(LIBS)
 	$(SERVADD)
 
Index: /trunk/Server/config.c
===================================================================
--- /trunk/Server/config.c	(revision 188)
+++ /trunk/Server/config.c	(revision 189)
@@ -106,4 +106,6 @@
 #elif defined(__PPU__)
 	strcpy(config.hostname, "ps3");
+#elif defined(__ps2sdk__)
+	strcpy(config.hostname, "ps2");
 #else
 	gethostname(config.hostname, 1024);
Index: /trunk/Server/main.c
===================================================================
--- /trunk/Server/main.c	(revision 188)
+++ /trunk/Server/main.c	(revision 189)
@@ -5,4 +5,5 @@
 #include "../config.h"
 
+#include <unistd.h>
 #include <stdio.h>
 #include <stdbool.h>
@@ -40,4 +41,10 @@
 #define printf(...) pspDebugScreenPrintf(__VA_ARGS__)
 #define STDERR_LOG(...) pspDebugScreenPrintf(__VA_ARGS__)
+#elif defined(__ps2sdk__)
+#include <debug.h>
+#include <sifrpc.h>
+
+#define printf(...) scr_printf(__VA_ARGS__)
+#define STDERR_LOG(...) scr_printf(__VA_ARGS__)
 #else
 #define STDERR_LOG(...) fprintf(stderr, __VA_ARGS__)
@@ -244,4 +251,10 @@
 	printf("PS3 Bootstrap, Tewi/%s\n", tw_get_version());
 	netInitialize();
+#elif defined(__ps2sdk__)
+	SifInitRpc(0);
+	init_scr();
+	scr_printf("PS2 Bootstrap, Tewi/%s\n", tw_get_version());
+	while(1)
+		;
 #endif
 	int st = startup(argc, argv);
Index: /trunk/Server/module.c
===================================================================
--- /trunk/Server/module.c	(revision 188)
+++ /trunk/Server/module.c	(revision 189)
@@ -16,5 +16,5 @@
 extern struct tw_config config;
 
-#if defined(_PSP) || defined(__PPU__)
+#if defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__)
 void* tw_module_load(const char* path) { return NULL; }
 
Index: /trunk/Server/server.c
===================================================================
--- /trunk/Server/server.c	(revision 188)
+++ /trunk/Server/server.c	(revision 189)
@@ -62,5 +62,5 @@
 #endif
 
-#ifdef _PSP
+#if defined(_PSP) || defined(__ps2sdk__)
 #include "strptime.h"
 #endif
@@ -522,5 +522,5 @@
 					struct tm tm;
 					strptime(req.headers[i + 1], "%a, %d %b %Y %H:%M:%S GMT", &tm);
-#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__)
+#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__)
 					time_t t = 0;
 					struct tm* btm = localtime(&t);
Index: /trunk/Server/strptime.h
===================================================================
--- /trunk/Server/strptime.h	(revision 188)
+++ /trunk/Server/strptime.h	(revision 189)
@@ -8,5 +8,5 @@
 #include <time.h>
 
-#if defined(_WIN32) || defined(_PSP)
+#if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__)
 char* strptime(const char *buf, const char *fmt, struct tm *tm);
 #endif
Index: /trunk/config.h.tmpl
===================================================================
--- /trunk/config.h.tmpl	(revision 188)
+++ /trunk/config.h.tmpl	(revision 189)
@@ -28,22 +28,22 @@
 #endif
 
-#if (defined(_PSP) || defined(__PPU__)) && !defined(NO_IPV6)
+#if (defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__)) && !defined(NO_IPV6)
 #define NO_IPV6
-/* PSP/PS3 does not have IPv6 */
+/* PSP/PS2/PS3 does not have IPv6 */
 #endif
 
-#if (defined(_PSP)) && defined(USE_POLL)
+#if (defined(_PSP) || defined(__ps2sdk__)) && defined(USE_POLL)
 #undef USE_POLL
-/* Force select(2) for PSP */
+/* Force select(2) for PSP/PS2 */
 #endif
 
-#if (defined(_PSP) || defined(__PPU__)) && defined(HAS_CHROOT)
+#if (defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__)) && defined(HAS_CHROOT)
 #undef HAS_CHROOT
-/* PSP/PS3 should not have chroot */
+/* PSP/PS2/PS3 should not have chroot */
 #endif
 
-#if (defined(_PSP) || defined(__PPU__)) && !defined(NO_GETADDRINFO)
+#if (defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__)) && !defined(NO_GETADDRINFO)
 #define NO_GETADDRINFO
-/* PSP/PS3 should not have getaddrinfo */
+/* PSP/PS2/PS3 should not have getaddrinfo */
 #endif
 
