--- /dev/null
+# $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
.PHONY: all clean
.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)
tewi_strip$(EXEC): tewi$(EXEC)
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)
tewi.pbp: tewi_strip$(EXEC) param.sfo
strcpy(config.hostname, "psp");
#elif defined(__PPU__)
strcpy(config.hostname, "ps3");
+#elif defined(__ps2sdk__)
+ strcpy(config.hostname, "ps2");
#else
gethostname(config.hostname, 1024);
#endif
#include "../config.h"
+#include <unistd.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#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__)
#endif
#elif defined(__PPU__)
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);
if(st != -1) {
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; }
void* tw_module_symbol(void* mod, const char* sym) { return NULL; }
#endif
#endif
-#ifdef _PSP
+#if defined(_PSP) || defined(__ps2sdk__)
#include "strptime.h"
#endif
} else if(cm_strcaseequ(req.headers[i], "If-Modified-Since")) {
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);
cmtime = mktime(&tm);
#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
/* Windows should not have chroot */
#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
#endif