Index: trunk/Server/Makefile
===================================================================
--- trunk/Server/Makefile	(revision 178)
+++ trunk/Server/Makefile	(revision 182)
@@ -8,8 +8,17 @@
 OBJS = version.o main.o config.o server.o http.o module.o strptime.o $(EXTOBJS) $(PREOBJS)
 
-all: tewi$(EXEC)
+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
+	$(SERVADD)
+
+tewi.pbp: tewi_strip$(EXEC) param.sfo
+	pack-pbp $@ param.sfo NULL NULL NULL NULL NULL tewi_strip$(EXEC) NULL
+
+param.sfo:
+	mksfoex -d MEMSIZE=1 'Tewi HTTPd' $@
 
 .c.o:
@@ -20,3 +29,3 @@
 
 clean:
-	rm -f *.o tewi *.exe *.res
+	rm -f *.o tewi *.exe *.res *.elf *.sfo *.pbp
Index: trunk/Server/config.c
===================================================================
--- trunk/Server/config.c	(revision 178)
+++ trunk/Server/config.c	(revision 182)
@@ -102,5 +102,9 @@
 	config.server_admin = cm_strdup(SERVER_ADMIN);
 	config.defined[0] = NULL;
+#ifdef _PSP
+	strcpy(config.hostname, "psp");
+#else
 	gethostname(config.hostname, 1024);
+#endif
 #ifdef HAS_CHROOT
 	tw_add_define("HAS_CHROOT");
@@ -411,5 +415,5 @@
 						}
 					} else if(cm_strcaseequ(r[0], "ReadmeFile") || cm_strcaseequ(r[0], "Readme")) {
-						if(cm_strcaseequ(r[0], "Readme")){
+						if(cm_strcaseequ(r[0], "Readme")) {
 							cm_force_log("NOTE: Readme directive is deprecated.");
 						}
Index: trunk/Server/main.c
===================================================================
--- trunk/Server/main.c	(revision 178)
+++ trunk/Server/main.c	(revision 182)
@@ -24,4 +24,14 @@
 #ifdef __MINGW32__
 #include <windows.h>
+#endif
+
+#ifdef _PSP
+#include <pspkernel.h>
+#include <pspdebug.h>
+
+PSP_MODULE_INFO("Tewi HTTPd", PSP_MODULE_USER, 1, 1);
+PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
+
+#define printf(...) pspDebugScreenPrintf(__VA_ARGS__)
 #endif
 
@@ -83,4 +93,8 @@
 	StartServiceCtrlDispatcher(table);
 #else
+#ifdef _PSP
+	pspDebugScreenInit();
+	pspDebugScreenSetXY(0, 0);
+#endif
 	int st = startup(argc, argv);
 	if(st != -1) return st;
@@ -114,4 +128,5 @@
 					}
 					confpath = argv[i];
+#ifndef _PSP
 				} else if(strcmp(argv[i], "--logfile") == 0 || strcmp(argv[i], "-l") == 0) {
 					i++;
@@ -128,4 +143,5 @@
 						return 1;
 					}
+#endif
 				} else if(strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-V") == 0) {
 					printf("Tewi HTTPd Tewi/%s\n", tw_get_version());
@@ -135,5 +151,7 @@
 					printf("Usage: %s [--config|-C config] [--verbose|-v] [--version|-V]\n", argv[0]);
 					printf("--config  | -C config      : Specify config\n");
+#ifndef _PSP
 					printf("--logfile | -l logfile     : Specify logfile\n");
+#endif
 					printf("--verbose | -v             : Verbose mode\n");
 					printf("--version | -V             : Version information\n");
Index: trunk/Server/module.c
===================================================================
--- trunk/Server/module.c	(revision 178)
+++ trunk/Server/module.c	(revision 182)
@@ -14,4 +14,15 @@
 #include <stdlib.h>
 
+extern struct tw_config config;
+
+#ifdef _PSP
+void* tw_module_load(const char* path) { return NULL; }
+
+void* tw_module_symbol(void* mod, const char* sym) { return NULL; }
+
+int tw_module_init(void* mod) { return 1; }
+
+#else
+
 #ifdef __MINGW32__
 #include <windows.h>
@@ -19,6 +30,4 @@
 #include <dlfcn.h>
 #endif
-
-extern struct tw_config config;
 
 void* tw_module_load(const char* path) {
@@ -46,4 +55,17 @@
 #endif
 }
+
+int tw_module_init(void* mod) {
+	tw_mod_init_t mod_init = (tw_mod_init_t)tw_module_symbol(mod, "mod_init");
+	if(mod_init == NULL) {
+		cm_log("Module", "Could not init a module");
+		return 1;
+	} else {
+		struct tw_tool tools;
+		tw_init_tools(&tools);
+		return mod_init(&config, &tools);
+	}
+}
+#endif
 
 void tw_add_version(const char* string) {
@@ -88,14 +110,2 @@
 	tools->add_define = tw_add_define;
 }
-
-int tw_module_init(void* mod) {
-	tw_mod_init_t mod_init = (tw_mod_init_t)tw_module_symbol(mod, "mod_init");
-	if(mod_init == NULL) {
-		cm_log("Module", "Could not init a module");
-		return 1;
-	} else {
-		struct tw_tool tools;
-		tw_init_tools(&tools);
-		return mod_init(&config, &tools);
-	}
-}
Index: trunk/Server/server.c
===================================================================
--- trunk/Server/server.c	(revision 178)
+++ trunk/Server/server.c	(revision 182)
@@ -24,4 +24,5 @@
 #include <errno.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 #include <time.h>
 
@@ -53,4 +54,8 @@
 #include <netdb.h>
 #endif
+#endif
+
+#ifdef _PSP
+#include "strptime.h"
 #endif
 
@@ -507,5 +512,5 @@
 					struct tm tm;
 					strptime(req.headers[i + 1], "%a, %d %b %Y %H:%M:%S GMT", &tm);
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(_PSP)
 					time_t t = 0;
 					struct tm* btm = localtime(&t);
@@ -907,5 +912,5 @@
 				if(cond) {
 					SOCKADDR claddr;
-					int clen = sizeof(claddr);
+					socklen_t clen = sizeof(claddr);
 					int sock = accept(sockets[i], (struct sockaddr*)&claddr, &clen);
 					cm_log("Server", "New connection accepted");
Index: trunk/Server/strptime.c
===================================================================
--- trunk/Server/strptime.c	(revision 178)
+++ trunk/Server/strptime.c	(revision 182)
@@ -36,5 +36,5 @@
 //__RCSID("$NetBSD: strptime.c,v 1.62 2017/08/24 01:01:09 ginsbach Exp $");
 
-#ifdef __MINGW32__
+#if defined(__MINGW32__)
 
 #include <ctype.h>
Index: trunk/Server/strptime.h
===================================================================
--- trunk/Server/strptime.h	(revision 178)
+++ trunk/Server/strptime.h	(revision 182)
@@ -8,5 +8,5 @@
 #include <time.h>
 
-#ifdef _WIN32
+#if defined(_WIN32) || defined(_PSP)
 char* strptime(const char *buf, const char *fmt, struct tm *tm);
 #endif
