--- edgar-1.16/makefile.org	2014-05-25 09:27:07.000000000 +0200
+++ edgar-1.16/makefile	2014-07-18 14:29:20.147062784 +0200
@@ -22,27 +22,27 @@
 
 CC       = gcc
 
-PREFIX = $(DESTDIR)/usr
+PREFIX = $(DESTDIR)/
 BIN_DIR = $(PREFIX)/games/
-DOC_DIR = $(PREFIX)/share/doc/$(PROG)/
-ICON_DIR = $(PREFIX)/share/icons/hicolor/
-DESKTOP_DIR = $(PREFIX)/share/applications/
-LOCALE_DIR = $(PREFIX)/share/locale/
+DOC_DIR = $(PREFIX)/doc/$(PROG)/
+ICON_DIR = $(PREFIX)/icons/hicolor/
+DESKTOP_DIR = $(PREFIX)/applications/
+LOCALE_DIR = $(PREFIX)/locale/
 LOCALE_MO = $(patsubst %.po,%.mo,$(wildcard locale/*.po))
 
 ifeq ($(UNIX),0)
 DATA_DIR =
 else
-DATA_DIR = $(PREFIX)/share/games/edgar/
+DATA_DIR = $(PREFIX)games/edgar/
 endif
 
 ifeq ($(DEV),1)
-CFLAGS = -Wall -Werror -g -pedantic -DVERSION=$(VERSION) -DRELEASE=$(RELEASE) -DDEV=$(DEV) -DINSTALL_PATH=\"$(DATA_DIR)\" -DLOCALE_DIR=\"$(LOCALE_DIR)\" -DPAK_FILE=\"$(PAK_FILE)\" -DUNIX=$(UNIX)
+CFLAGS = -Wall -g -pedantic -DVERSION=$(VERSION) -DRELEASE=$(RELEASE) -DDEV=$(DEV) -DINSTALL_PATH=\"$(DATA_DIR)\" -DLOCALE_DIR=\"$(LOCALE_DIR)\" -DPAK_FILE=\"$(PAK_FILE)\" -DUNIX=$(UNIX)
 else
 CFLAGS = -Wall -pedantic -DVERSION=$(VERSION) -DRELEASE=$(RELEASE) -DDEV=$(DEV) -DINSTALL_PATH=\"$(DATA_DIR)\" -DLOCALE_DIR=\"$(LOCALE_DIR)\" -DPAK_FILE=\"$(PAK_FILE)\" -DUNIX=$(UNIX)
 endif
 
-LFLAGS = `sdl-config --libs` -lSDL -lSDL_image -lSDL_mixer -lSDL_ttf -lz -lm
+LFLAGS = `sdl-config --libs` -lSDL -lSDL_image -lSDL_mixer -lSDL_ttf -lz
 
 TILE_OBJS  = tile_creator.o save_png.o
 PAK_OBJS   = pak_creator.o
--- edgar-1.16/src/main.c.org	2013-12-31 17:36:52.043778048 +0100
+++ edgar-1.16/src/main.c	2014-09-13 14:51:24.000000000 +0200
@@ -43,6 +43,11 @@
 #include "system/resources.h"
 #include "title.h"
 
+#ifdef __HAIKU__
+#include <unistd.h>
+#include <libgen.h>
+#endif
+
 Input input, menuInput;
 Entity *self;
 Game game;
@@ -67,6 +72,8 @@
 
 	showCredits = FALSE;
 
+	chdir(dirname(argv[0]));
+
 	/* Load the resources */
 
 	for (i=1;i<argc;i++)
