Makefile: set default paths from here
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 14 Aug 2009 22:01:16 +0000 (22:01 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 14 Aug 2009 22:01:16 +0000 (22:01 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@3023 78b8d119-cf0a-0410-b17c-f493084dd1d7

INSTALL
Makefile
share/base_config.h

diff --git a/INSTALL b/INSTALL
index 6fc44bb..d726690 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -78,12 +78,12 @@ them must be set.
 
  2. The directory given by the NEVERBALL_DATA environment variable.
 
- 3. The   directory   given  by  the  CONFIG_DATA   macro  defined  in
-    share/base_config.h
+ 3. The directory given by the CONFIG_DATA macro defined in
+    share/base_config.h (which corresponds to the DATADIR Makefile
+    variable).
 
-A normal Linux installation would  probably copy the data directory to
-"/usr/local/share/games/neverball/" and  change the  CONFIG_DATA macro
-to match.
+A normal Linux installation would probably copy the data directory to
+"/usr/local/share/games/neverball/" and set DATADIR to match.
 
 
 * DISTRIBUTION
index e5f7e6c..145786f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,21 @@ endif
 # MINGW=1 also supported.
 
 #------------------------------------------------------------------------------
+# Paths (packagers might want to set DATADIR and LOCALEDIR)
+
+USERDIR   := .neverball
+DATADIR   := ./data
+LOCALEDIR := ./locale
+
+ifdef MINGW
+    USERDIR := Neverball
+endif
+
+ifneq ($(BUILD),release)
+    USERDIR := $(USERDIR)-dev
+endif
+
+#------------------------------------------------------------------------------
 # Optional flags (CFLAGS, CPPFLAGS, ...)
 
 ifeq ($(DEBUG),1)
@@ -57,6 +72,11 @@ PNG_CPPFLAGS := $(shell libpng-config --cflags)
 ALL_CPPFLAGS := $(SDL_CPPFLAGS) $(PNG_CPPFLAGS) -Ishare \
     -DVERSION=\"$(VERSION)\"
 
+ALL_CPPFLAGS += \
+    -DCONFIG_USER=\"$(USERDIR)\" \
+    -DCONFIG_DATA=\"$(DATADIR)\" \
+    -DCONFIG_LOCALE=\"$(LOCALEDIR)\"
+
 ifeq ($(ENABLE_NLS),0)
     ALL_CPPFLAGS += -DENABLE_NLS=0
 else
index 356dcc7..9a2d68e 100644 (file)
@@ -40,9 +40,9 @@
 /* User config directory */
 #ifndef CONFIG_USER
 #ifdef _WIN32
-#define CONFIG_USER   "Neverball-dev"
+#define CONFIG_USER   "Neverball"
 #else
-#define CONFIG_USER   ".neverball-dev"
+#define CONFIG_USER   ".neverball"
 #endif
 #endif