Index: source/nan_definitions.mk
===================================================================
--- source/nan_definitions.mk	(revision 19301)
+++ source/nan_definitions.mk	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): none yet.
+# Contributor(s): GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 #
@@ -31,15 +33,26 @@
 
 sinclude ../user-def.mk
 
+# This warning only takes place once in source/
+ifeq (debug, $(findstring debug, $(MAKECMDGOALS)))
+  ifeq (all, $(findstring all, $(MAKECMDGOALS)))
+    export ERRTXT = "ERROR: all and debug targets cannot be used together anymore"
+    export ERRTXT += "Use something like ..make all && make debug.. instead"
+  endif
+endif
+
+ifdef ERRTXT
+$(error $(ERRTXT))
+endif
+
 ifndef CONFIG_GUESS
   ifeq (debug, $(findstring debug, $(MAKECMDGOALS)))
-    ifeq (all, $(findstring all, $(MAKECMDGOALS)))
-all debug::
-      ERRTXT = "ERROR: all and debug targets cannot be used together anymore"
-      ERRTXT += "Use something like ..make all && make debug.. instead"
-      $(error $(ERRTXT))
-    endif
+    export DEBUG_DIR = debug/
+    export ALL_OR_DEBUG = debug
   endif
+  ifeq (all, $(findstring all, $(MAKECMDGOALS)))
+    export ALL_OR_DEBUG ?= all
+  endif
 
   # First generic defaults for all platforms which should be constant.
   # Note: ?= lets these defaults be overruled by environment variables,
@@ -135,9 +148,9 @@
       else
         ifeq ($(OS),linux)
           ifeq ($(WITH_OPENEXR), true)
-            NAN_OPENEXR?=$(shell pkg-config --variable=prefix OpenEXR )
-            NAN_OPENEXR_INC?=$(shell pkg-config --cflags OpenEXR )
-            NAN_OPENEXR_LIBS?=$(addprefix ${NAN_OPENEXR}/lib/lib,$(addsuffix .a,$(shell pkg-config --libs-only-l OpenEXR | sed -s "s/-l//g" )))
+            export NAN_OPENEXR?=$(shell pkg-config --variable=prefix OpenEXR )
+            export NAN_OPENEXR_INC?=$(shell pkg-config --cflags OpenEXR )
+            export NAN_OPENEXR_LIBS?=$(addprefix ${NAN_OPENEXR}/lib/lib,$(addsuffix .a,$(shell pkg-config --libs-only-l OpenEXR | sed -s "s/-l//g" )))
           endif
         else
           ifeq ($(OS), solaris)
@@ -157,9 +170,9 @@
           endif
         endif
       endif
-		 	ifeq ($(WITH_OPENEXR), true)
-				export NAN_OPENEXR_INC ?= -I$(NAN_OPENEXR)/include -I$(NAN_OPENEXR)/include/OpenEXR
-			endif
+      ifeq ($(WITH_OPENEXR), true)
+        export NAN_OPENEXR_INC ?= -I$(NAN_OPENEXR)/include -I$(NAN_OPENEXR)/include/OpenEXR
+      endif
 
     endif
   # Platform Dependent settings go below:
Index: intern/SoundSystem/Makefile
===================================================================
--- intern/SoundSystem/Makefile	(revision 19301)
+++ intern/SoundSystem/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): none yet.
+# Contributor(s): GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 #
@@ -56,16 +58,13 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_SOUNDSYSTEM) ] || mkdir $(NAN_SOUNDSYSTEM)
 	@[ -d $(NAN_SOUNDSYSTEM)/include ] || mkdir $(NAN_SOUNDSYSTEM)/include
-	@[ -d $(NAN_SOUNDSYSTEM)/lib ] || mkdir $(NAN_SOUNDSYSTEM)/lib
-	@[ -d $(NAN_SOUNDSYSTEM)/lib/debug ] || mkdir $(NAN_SOUNDSYSTEM)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libSoundSystem.a $(NAN_SOUNDSYSTEM)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libSoundSystem.a $(NAN_SOUNDSYSTEM)/lib/debug/
+	@[ -d $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libSoundSystem.a $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_SOUNDSYSTEM)/lib/libSoundSystem.a
-	ranlib $(NAN_SOUNDSYSTEM)/lib/debug/libSoundSystem.a
+	ranlib $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)libSoundSystem.a
 endif
 	@../tools/cpifdiff.sh *.h $(NAN_SOUNDSYSTEM)/include/
 
Index: intern/guardedalloc/Makefile
===================================================================
--- intern/guardedalloc/Makefile	(revision 19301)
+++ intern/guardedalloc/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # decimation main makefile.
@@ -38,16 +40,13 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_GUARDEDALLOC) ] || mkdir $(NAN_GUARDEDALLOC)
 	@[ -d $(NAN_GUARDEDALLOC)/include ] || mkdir $(NAN_GUARDEDALLOC)/include
-	@[ -d $(NAN_GUARDEDALLOC)/lib ] || mkdir $(NAN_GUARDEDALLOC)/lib
-	@[ -d $(NAN_GUARDEDALLOC)/lib/debug ] || mkdir $(NAN_GUARDEDALLOC)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libguardedalloc.a $(NAN_GUARDEDALLOC)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libguardedalloc.a $(NAN_GUARDEDALLOC)/lib/debug/
+	@[ -d $(NAN_GUARDEDALLOC)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_GUARDEDALLOC)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libguardedalloc.a $(NAN_GUARDEDALLOC)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_GUARDEDALLOC)/lib/libguardedalloc.a
-	ranlib $(NAN_GUARDEDALLOC)/lib/debug/libguardedalloc.a
+	ranlib $(NAN_GUARDEDALLOC)/lib/$(DEBUG_DIR)libguardedalloc.a
 endif
 	@../tools/cpifdiff.sh *.h $(NAN_GUARDEDALLOC)/include/
 
Index: intern/container/Makefile
===================================================================
--- intern/container/Makefile	(revision 19301)
+++ intern/container/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # container main makefile.
@@ -38,12 +40,10 @@
  
 include nan_subdirs.mk
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_CONTAINER) ] || mkdir $(NAN_CONTAINER)
 	@[ -d $(NAN_CONTAINER)/include ] || mkdir $(NAN_CONTAINER)/include
-	@[ -d $(NAN_CONTAINER)/lib ] || mkdir $(NAN_CONTAINER)/lib
-	@[ -d $(NAN_CONTAINER)/lib/debug ] || mkdir $(NAN_CONTAINER)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libcontainer.a $(NAN_CONTAINER)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libcontainer.a $(NAN_CONTAINER)/lib/debug
+	@[ -d $(NAN_CONTAINER)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_CONTAINER)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libcontainer.a $(NAN_CONTAINER)/lib/$(DEBUG_DIR)
 	@../tools/cpifdiff.sh *.h $(NAN_CONTAINER)/include/
 
Index: intern/string/Makefile
===================================================================
--- intern/string/Makefile	(revision 19301)
+++ intern/string/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # string main makefile.
@@ -38,16 +40,13 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install:  $(ALL_OR_DEBUG)
 	@[ -d $(NAN_STRING) ] || mkdir $(NAN_STRING)
 	@[ -d $(NAN_STRING)/include ] || mkdir $(NAN_STRING)/include
-	@[ -d $(NAN_STRING)/lib ] || mkdir $(NAN_STRING)/lib
-	@[ -d $(NAN_STRING)/lib/debug ] || mkdir $(NAN_STRING)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libstring.a $(NAN_STRING)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libstring.a $(NAN_STRING)/lib/debug/
+	@[ -d $(NAN_STRING)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_STRING)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libstring.a $(NAN_STRING)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_STRING)/lib/libstring.a
-	ranlib $(NAN_STRING)/lib/debug/libstring.a
+	ranlib $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a
 endif
 	@../tools/cpifdiff.sh *.h $(NAN_STRING)/include/
 
Index: intern/decimation/Makefile
===================================================================
--- intern/decimation/Makefile	(revision 19301)
+++ intern/decimation/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # decimation main makefile.
@@ -38,16 +40,13 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install:  $(ALL_OR_DEBUG)
 	@[ -d $(NAN_DECIMATION) ] || mkdir $(NAN_DECIMATION)
 	@[ -d $(NAN_DECIMATION)/include ] || mkdir $(NAN_DECIMATION)/include
-	@[ -d $(NAN_DECIMATION)/lib ] || mkdir $(NAN_DECIMATION)/lib
-	@[ -d $(NAN_DECIMATION)/lib/debug ] || mkdir $(NAN_DECIMATION)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libdecimation.a $(NAN_DECIMATION)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libdecimation.a $(NAN_DECIMATION)/lib/debug/
+	@[ -d $(NAN_DECIMATION)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_DECIMATION)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libdecimation.a $(NAN_DECIMATION)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_DECIMATION)/lib/libdecimation.a
-	ranlib $(NAN_DECIMATION)/lib/debug/libdecimation.a
+	ranlib $(NAN_DECIMATION)/lib/$(DEBUG_DIR)libdecimation.a
 endif
 	@../tools/cpifdiff.sh extern/*.h $(NAN_DECIMATION)/include/
 
Index: intern/moto/Makefile
===================================================================
--- intern/moto/Makefile	(revision 19301)
+++ intern/moto/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # moto main makefile.
@@ -38,16 +40,13 @@
  
 include nan_subdirs.mk
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_MOTO) ] || mkdir $(NAN_MOTO)
 	@[ -d $(NAN_MOTO)/include ] || mkdir $(NAN_MOTO)/include
-	@[ -d $(NAN_MOTO)/lib ] || mkdir $(NAN_MOTO)/lib
-	@[ -d $(NAN_MOTO)/lib/debug ] || mkdir $(NAN_MOTO)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libmoto.a $(NAN_MOTO)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libmoto.a $(NAN_MOTO)/lib/debug/
+	@[ -d $(NAN_MOTO)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_MOTO)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libmoto.a $(NAN_MOTO)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_MOTO)/lib/libmoto.a
-	ranlib $(NAN_MOTO)/lib/debug/libmoto.a
+	ranlib $(NAN_MOTO)/lib/$(DEBUG_DIR)libmoto.a
 endif
 	@../tools/cpifdiff.sh include/*.h $(NAN_MOTO)/include/
 
Index: intern/boolop/Makefile
===================================================================
--- intern/boolop/Makefile	(revision 19301)
+++ intern/boolop/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # bsp main makefile.
@@ -38,16 +40,13 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install:  $(ALL_OR_DEBUG)
 	@[ -d $(NAN_BOOLOP) ] || mkdir $(NAN_BOOLOP)
 	@[ -d $(NAN_BOOLOP)/include ] || mkdir $(NAN_BOOLOP)/include
-	@[ -d $(NAN_BOOLOP)/lib ] || mkdir $(NAN_BOOLOP)/lib
-	@[ -d $(NAN_BOOLOP)/lib/debug ] || mkdir $(NAN_BOOLOP)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libboolop.a $(NAN_BOOLOP)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libboolop.a $(NAN_BOOLOP)/lib/debug/
+	@[ -d $(NAN_BOOLOP)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_BOOLOP)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libboolop.a $(NAN_BOOLOP)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_BOOLOP)/lib/libboolop.a
-	ranlib $(NAN_BOOLOP)/lib/debug/libboolop.a
+	ranlib $(NAN_BOOLOP)/lib/$(DEBUG_DIR)libboolop.a
 endif
 	@../tools/cpifdiff.sh extern/*.h $(NAN_BOOLOP)/include/
 
Index: intern/bmfont/Makefile
===================================================================
--- intern/bmfont/Makefile	(revision 19301)
+++ intern/bmfont/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # bmfont main makefile.
@@ -38,16 +40,13 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_BMFONT) ] || mkdir $(NAN_BMFONT)
 	@[ -d $(NAN_BMFONT)/include ] || mkdir $(NAN_BMFONT)/include
-	@[ -d $(NAN_BMFONT)/lib ] || mkdir $(NAN_BMFONT)/lib
-	@[ -d $(NAN_BMFONT)/lib/debug ] || mkdir $(NAN_BMFONT)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libbmfont.a $(NAN_BMFONT)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libbmfont.a $(NAN_BMFONT)/lib/debug/
+	@[ -d $(NAN_BMFONT)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_BMFONT)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libbmfont.a $(NAN_BMFONT)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_BMFONT)/lib/libbmfont.a
-	ranlib $(NAN_BMFONT)/lib/debug/libbmfont.a
+	ranlib $(NAN_BMFONT)/lib/$(DEBUG_DIR)libbmfont.a
 endif
 	@../tools/cpifdiff.sh *.h $(NAN_BMFONT)/include/
 
Index: intern/iksolver/Makefile
===================================================================
--- intern/iksolver/Makefile	(revision 19301)
+++ intern/iksolver/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # iksolver main makefile.
@@ -38,16 +40,13 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_IKSOLVER) ] || mkdir $(NAN_IKSOLVER)
 	@[ -d $(NAN_IKSOLVER)/include ] || mkdir $(NAN_IKSOLVER)/include
-	@[ -d $(NAN_IKSOLVER)/lib ] || mkdir $(NAN_IKSOLVER)/lib
-	@[ -d $(NAN_IKSOLVER)/lib/debug ] || mkdir $(NAN_IKSOLVER)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libiksolver.a $(NAN_IKSOLVER)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libiksolver.a $(NAN_IKSOLVER)/lib/debug/
+	@[ -d $(NAN_IKSOLVER)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_IKSOLVER)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libiksolver.a $(NAN_IKSOLVER)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_IKSOLVER)/lib/libiksolver.a
-	ranlib $(NAN_IKSOLVER)/lib/debug/libiksolver.a
+	ranlib $(NAN_IKSOLVER)/lib/$(DEBUG_DIR)libiksolver.a
 endif
 	@../tools/cpifdiff.sh extern/*.h $(NAN_IKSOLVER)/include/
 
Index: intern/opennl/Makefile
===================================================================
--- intern/opennl/Makefile	(revision 19301)
+++ intern/opennl/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # opennl main makefile.
@@ -40,25 +42,19 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_OPENNL) ] || mkdir $(NAN_OPENNL)
 	@[ -d $(NAN_OPENNL)/include ] || mkdir $(NAN_OPENNL)/include
-	@[ -d $(NAN_OPENNL)/lib ] || mkdir $(NAN_OPENNL)/lib
-	@[ -d $(NAN_OPENNL)/lib/debug ] || mkdir $(NAN_OPENNL)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libopennl.a $(NAN_OPENNL)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libopennl.a $(NAN_OPENNL)/lib/debug/
+	@[ -d $(NAN_OPENNL)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_OPENNL)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libopennl.a $(NAN_OPENNL)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_OPENNL)/lib/libopennl.a
-	ranlib $(NAN_OPENNL)/lib/debug/libopennl.a
+	ranlib $(NAN_OPENNL)/lib/$(DEBUG_DIR)libopennl.a
 endif
 	@../tools/cpifdiff.sh extern/*.h $(NAN_OPENNL)/include/
 	@[ -d $(NAN_SUPERLU) ] || mkdir $(NAN_SUPERLU)
-	@[ -d $(NAN_SUPERLU)/lib ] || mkdir $(NAN_SUPERLU)/lib
-	@[ -d $(NAN_SUPERLU)/lib/debug ] || mkdir $(NAN_SUPERLU)/lib/debug
-	@../tools/cpifdiff.sh $(DIR_SLU)/libsuperlu.a $(NAN_SUPERLU)/lib/
-	@../tools/cpifdiff.sh $(DIR_SLU)/debug/libsuperlu.a $(NAN_SUPERLU)/lib/debug/
+	@[ -d $(NAN_SUPERLU)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_SUPERLU)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR_SLU)/$(DEBUG_DIR)libsuperlu.a $(NAN_SUPERLU)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_SUPERLU)/lib/libsuperlu.a
-	ranlib $(NAN_SUPERLU)/lib/debug/libsuperlu.a
+	ranlib $(NAN_SUPERLU)/lib/$(DEBUG_DIR)libsuperlu.a
 endif
 
Index: intern/bsp/Makefile
===================================================================
--- intern/bsp/Makefile	(revision 19301)
+++ intern/bsp/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # bsp main makefile.
@@ -38,19 +40,14 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_BSP) ] || mkdir $(NAN_BSP)
 	@[ -d $(NAN_BSP)/include ] || mkdir $(NAN_BSP)/include
-	@[ -d $(NAN_BSP)/lib ] || mkdir $(NAN_BSP)/lib
-	@[ -d $(NAN_BSP)/lib/debug ] || mkdir $(NAN_BSP)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libbsp.a $(NAN_BSP)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libbsp.a $(NAN_BSP)/lib/debug/
+	@[ -d $(NAN_BSP)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_BSP)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libbsp.a $(NAN_BSP)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_BSP)/lib/libbsp.a
-	ranlib $(NAN_BSP)/lib/debug/libbsp.a
+	ranlib $(NAN_BSP)/lib/$(DEBUG_DIR)libbsp.a
 endif
 	@../tools/cpifdiff.sh extern/*.h $(NAN_BSP)/include/
 
 
-
-
Index: intern/ghost/intern/Makefile
===================================================================
--- intern/ghost/intern/Makefile	(revision 19301)
+++ intern/ghost/intern/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): none yet.
+# Contributor(s): GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # ghost intern Makefile
@@ -38,8 +40,6 @@
 CCSRCS += GHOST_CallbackEventConsumer.cpp
 CCSRCS += GHOST_NDOFManager.cpp
 
-include nan_definitions.mk
-
 ifeq ($(OS),$(findstring $(OS), "darwin"))
     CCSRCS += $(wildcard *Carbon.cpp)
 endif
Index: intern/ghost/Makefile
===================================================================
--- intern/ghost/Makefile	(revision 19301)
+++ intern/ghost/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # ghost main makefile.
@@ -38,16 +40,13 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_GHOST) ] || mkdir $(NAN_GHOST)
 	@[ -d $(NAN_GHOST)/include ] || mkdir $(NAN_GHOST)/include
-	@[ -d $(NAN_GHOST)/lib ] || mkdir $(NAN_GHOST)/lib
-	@[ -d $(NAN_GHOST)/lib/debug ] || mkdir $(NAN_GHOST)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libghost.a $(NAN_GHOST)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libghost.a $(NAN_GHOST)/lib/debug/
+	@[ -d $(NAN_GHOST)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_GHOST)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libghost.a $(NAN_GHOST)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_GHOST)/lib/libghost.a
-	ranlib $(NAN_GHOST)/lib/debug/libghost.a
+	ranlib $(NAN_GHOST)/lib/$(DEBUG_DIR)libghost.a
 endif
 	@../tools/cpifdiff.sh *.h $(NAN_GHOST)/include/
 
Index: intern/memutil/Makefile
===================================================================
--- intern/memutil/Makefile	(revision 19301)
+++ intern/memutil/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # memutil main makefile.
@@ -38,16 +40,13 @@
  
 include nan_subdirs.mk
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_MEMUTIL) ] || mkdir $(NAN_MEMUTIL)
 	@[ -d $(NAN_MEMUTIL)/include ] || mkdir $(NAN_MEMUTIL)/include
-	@[ -d $(NAN_MEMUTIL)/lib ] || mkdir $(NAN_MEMUTIL)/lib
-	@[ -d $(NAN_MEMUTIL)/lib/debug ] || mkdir $(NAN_MEMUTIL)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libmemutil.a $(NAN_MEMUTIL)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libmemutil.a $(NAN_MEMUTIL)/lib/debug
+	@[ -d $(NAN_MEMUTIL)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_MEMUTIL)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libmemutil.a $(NAN_MEMUTIL)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_MEMUTIL)/lib/libmemutil.a
-	ranlib $(NAN_MEMUTIL)/lib/debug/libmemutil.a
+	ranlib $(NAN_MEMUTIL)/lib/$(DEBUG_DIR)libmemutil.a
 endif
 	@../tools/cpifdiff.sh *.h $(NAN_MEMUTIL)/include/
 
Index: intern/elbeem/Makefile
===================================================================
--- intern/elbeem/Makefile	(revision 19301)
+++ intern/elbeem/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Hans Lambermont
+# Contributor(s): Hans Lambermont, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 # elbeem main makefile.
@@ -40,16 +42,13 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_ELBEEM) ] || mkdir $(NAN_ELBEEM)
 	@[ -d $(NAN_ELBEEM)/include ] || mkdir $(NAN_ELBEEM)/include
-	@[ -d $(NAN_ELBEEM)/lib ] || mkdir $(NAN_ELBEEM)/lib
-	@[ -d $(NAN_ELBEEM)/lib/debug ] || mkdir $(NAN_ELBEEM)/lib/debug
-	@../tools/cpifdiff.sh $(DIR)/libelbeem.a $(NAN_ELBEEM)/lib/
-	@../tools/cpifdiff.sh $(DIR)/debug/libelbeem.a $(NAN_ELBEEM)/lib/debug/
+	@[ -d $(NAN_ELBEEM)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_ELBEEM)/lib/$(DEBUG_DIR)
+	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libelbeem.a $(NAN_ELBEEM)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_ELBEEM)/lib/libelbeem.a
-	ranlib $(NAN_ELBEEM)/lib/debug/libelbeem.a
+	ranlib $(NAN_ELBEEM)/lib/$(DEBUG_DIR)libelbeem.a
 endif
 	@../tools/cpifdiff.sh extern/*.h $(NAN_ELBEEM)/include/
 
Index: extern/qhull/src/Makefile
===================================================================
--- extern/qhull/src/Makefile	(revision 19301)
+++ extern/qhull/src/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): none yet.
+# Contributor(s): GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 #
@@ -40,16 +42,13 @@
 CCSRCS = 
 include nan_compile.mk 
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_QHULL) ] || mkdir -p $(NAN_QHULL)
 	@[ -d $(NAN_QHULL)/include/qhull ] || mkdir -p $(NAN_QHULL)/include/qhull
-	@[ -d $(NAN_QHULL)/lib ] || mkdir -p $(NAN_QHULL)/lib
-	@[ -d $(NAN_QHULL)/lib/debug ] || mkdir -p $(NAN_QHULL)/lib/debug
-	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/lib$(LIBNAME).a $(NAN_QHULL)/lib/
-#	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/debug/lib$(LIBNAME).a $(NAN_QHULL)/lib/debug/
+	@[ -d $(NAN_QHULL)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_QHULL)/lib/$(DEBUG_DIR)
+	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_QHULL)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_QHULL)/lib/lib$(LIBNAME).a
-#	ranlib $(NAN_QHULL)/lib/debug/lib$(LIBNAME).a
+	ranlib $(NAN_QHULL)/lib/$(DEBUG_DIR)lib$(LIBNAME).a
 endif
 	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh ../include/qhull/*.h $(NAN_QHULL)/include/qhull
 
Index: extern/solid/Makefile
===================================================================
--- extern/solid/Makefile	(revision 19301)
+++ extern/solid/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): none yet.
+# Contributor(s): GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 #
@@ -37,18 +39,15 @@
 
 include nan_subdirs.mk
 
-install: all debug
+install:  $(ALL_OR_DEBUG)
 	@[ -d $(NAN_SOLID) ] || mkdir -p $(NAN_SOLID)
 	@[ -d $(NAN_SOLID)/include/SOLID ] || mkdir -p $(NAN_SOLID)/include/SOLID
 	@[ -d $(NAN_SOLID)/include/SOLID/MT ] || mkdir -p $(NAN_SOLID)/include/SOLID/MT
-	@[ -d $(NAN_SOLID)/lib ] || mkdir -p $(NAN_SOLID)/lib
-	@[ -d $(NAN_SOLID)/lib/debug ] || mkdir -p $(NAN_SOLID)/lib/debug
+	@[ -d $(NAN_SOLID)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_SOLID)/lib/$(DEBUG_DIR)
 	@for i in $(LIBNAMES); do \
-	    $(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$$i/lib$$i.a $(NAN_SOLID)/lib/ ; \
-	    $(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$$i/debug/lib$$i.a $(NAN_SOLID)/lib/debug/ ; \
+	    $(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$$i/$(DEBUG_DIR)lib$$i.a $(NAN_SOLID)/lib/$(DEBUG_DIR) ; \
 	    if [ $(OS) = darwin ] ; then \
-            ranlib $(NAN_SOLID)/lib/lib$$i.a ; \
-            ranlib $(NAN_SOLID)/lib/debug/lib$$i.a ; \
+            ranlib $(NAN_SOLID)/lib/$(DEBUG_DIR)lib$$i.a ; \
         fi ; \
 	done
 	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh include/*.h $(NAN_SOLID)/include/SOLID
Index: extern/glew/src/Makefile
===================================================================
--- extern/glew/src/Makefile	(revision 19301)
+++ extern/glew/src/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -25,7 +27,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): none yet.
+# Contributor(s): GSR
 #
 # ***** END GPL/BL DUAL LICENSE BLOCK *****
 #
@@ -42,15 +44,13 @@
 CCSRCS = 
 include nan_compile.mk 
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_GLEW) ] || mkdir -p $(NAN_GLEW)
 	@[ -d $(NAN_GLEW)/include/GL ] || mkdir -p $(NAN_GLEW)/include/GL
-	@[ -d $(NAN_GLEW)/lib ] || mkdir -p $(NAN_GLEW)/lib
-	@[ -d $(NAN_GLEW)/lib/debug ] || mkdir -p $(NAN_GLEW)/lib/debug
-	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/lib$(LIBNAME).a $(NAN_GLEW)/lib/
+	@[ -d $(NAN_GLEW)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_GLEW)/lib/$(DEBUG_DIR)
+	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_GLEW)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_GLEW)/lib/lib$(LIBNAME).a
-	ranlib $(NAN_GLEW)/lib/lib$(LIBNAME).a
+	ranlib $(NAN_GLEW)/lib/$(DEBUG_DIR)lib$(LIBNAME).a
 endif
 	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh ../include/GL/*.h $(NAN_GLEW)/include/GL
 
Index: extern/bFTGL/src/Makefile
===================================================================
--- extern/bFTGL/src/Makefile	(revision 19301)
+++ extern/bFTGL/src/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): none yet.
+# Contributor(s): GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 #
@@ -46,15 +48,13 @@
 CPPFLAGS += -I$(NAN_FREETYPE)/include -I$(NAN_FREETYPE)/include/freetype2
 CPPFLAGS += -I$(OPENGL_HEADERS) 
 
-install: all debug
+install: $(ALL_OR_DEBUG)
 	@[ -d $(NAN_FTGL) ] || mkdir -p $(NAN_FTGL)
 	@[ -d $(NAN_FTGL)/include ] || mkdir -p $(NAN_FTGL)/include
-	@[ -d $(NAN_FTGL)/lib ] || mkdir -p $(NAN_FTGL)/lib
-	@[ -d $(NAN_FTGL)/lib/debug ] || mkdir -p $(NAN_FTGL)/lib/debug
-	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/lib$(LIBNAME).a $(NAN_FTGL)/lib/
-#	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/debug/lib$(LIBNAME).a $(NAN_FTGL)/lib/debug/
+	@[ -d $(NAN_FTGL)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_FTGL)/lib/$(DEBUG_DIR)
+	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_FTGL)/lib/$(DEBUG_DIR)
 ifeq ($(OS),darwin)
-	ranlib $(NAN_FTGL)/lib/lib$(LIBNAME).a
+	ranlib $(NAN_FTGL)/lib/$(DEBUG_DIR)lib$(LIBNAME).a
 endif
 	@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh ../include/*.h $(NAN_FTGL)/include/
 
Index: source/Makefile
===================================================================
--- source/Makefile	(revision 19301)
+++ source/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
 #
 # $Id$
 #
@@ -22,7 +24,7 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): none yet.
+# Contributor(s): GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 #
@@ -53,7 +55,7 @@
     BUILDINFO_C = $(SRCHOME)/creator/buildinfo.c
     BUILD_DATE := $(shell date "+%Y-%m-%d")
     BUILD_TIME := $(shell date "+%H:%M:%S")
-	BUILD_REV := $(shell svnversion)
+    BUILD_REV := $(shell svnversion)
 endif
 
 ############# set pyplayerlib ##################
@@ -89,7 +91,7 @@
 # to properly resolve circular dependencies. ugly, but it works...
 # the repeat entries could probably be trimmed down.
 COMLIB = $(OCGDIR)/blender/blenkernel/$(DEBUG_DIR)libblenkernel.a
-COMLIB += $(NAN_DECIMATION)/lib/libdecimation.a
+COMLIB += $(NAN_DECIMATION)/lib/$(DEBUG_DIR)libdecimation.a
 COMLIB += $(OCGDIR)/blender/blenloader/$(DEBUG_DIR)libblenloader.a
 COMLIB += $(OCGDIR)/blender/blenpluginapi/$(DEBUG_DIR)libblenpluginapi.a
 COMLIB += $(OCGDIR)/blender/nodes_shd/$(DEBUG_DIR)libnodes_shd.a
@@ -98,14 +100,14 @@
 COMLIB += $(OCGDIR)/blender/nodes/$(DEBUG_DIR)libnodes.a
 COMLIB += $(OCGDIR)/blender/imbuf/$(DEBUG_DIR)libimbuf.a
 COMLIB += $(OCGDIR)/blender/blenlib/$(DEBUG_DIR)libblenlib.a
-COMLIB += $(NAN_IKSOLVER)/lib/libiksolver.a
-COMLIB += $(NAN_MOTO)/lib/libmoto.a
+COMLIB += $(NAN_IKSOLVER)/lib/$(DEBUG_DIR)libiksolver.a
+COMLIB += $(NAN_MOTO)/lib/$(DEBUG_DIR)libmoto.a
 COMLIB += $(NAN_OPENNL)/lib/$(DEBUG_DIR)libopennl.a
-COMLIB += $(NAN_SUPERLU)/lib/$(DEBUG_DIR)libsuperlu.a	
+COMLIB += $(NAN_SUPERLU)/lib/$(DEBUG_DIR)libsuperlu.a
 COMLIB += $(OCGDIR)/blender/avi/$(DEBUG_DIR)libavi.a
 COMLIB += $(NAN_JPEG)/lib/libjpeg.a
 COMLIB += $(OCGDIR)/blender/gpu/$(DEBUG_DIR)libgpu.a
-COMLIB += $(NAN_GLEW)/lib/libglew.a
+COMLIB += $(NAN_GLEW)/lib/$(DEBUG_DIR)libglew.a
 COMLIB += $(NAN_ELBEEM)/lib/$(DEBUG_DIR)libelbeem.a
 COMLIB += $(OCGDIR)/blender/blenfont/$(DEBUG_DIR)libblenfont.a
 
@@ -117,7 +119,7 @@
     COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
     COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
     COMLIB += $(NAN_SOLID)/lib/libsolid.a
-    COMLIB += $(NAN_SOLID)/lib/libsolid_broad.a 
+    COMLIB += $(NAN_SOLID)/lib/libsolid_broad.a
     COMLIB += $(NAN_SOLID)/lib/libsolid_complex.a
     COMLIB += $(NAN_SOLID)/lib/libsolid_convex.a
     COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
@@ -192,7 +194,7 @@
         COMLIB += $(NAN_FREETYPE)/lib/freetype2ST.lib
       endif
     else
-      COMLIB += $(NAN_FTGL)/lib/libftgl.a
+      COMLIB += $(NAN_FTGL)/lib/$(DEBUG_DIR)libftgl.a
       ifeq ($(OS), irix)
         COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a
         else
@@ -221,44 +223,44 @@
 # note: space_api.a in begin of editors, screen.a in end
 PULIB = $(NAN_MOTO)/lib/libmoto.a
 PULIB += $(OCGDIR)/blender/readblenfile/$(DEBUG_DIR)libreadblenfile.a
-PULIB += $(OCGDIR)/blender/ed_space/libed_space.a
-PULIB += $(OCGDIR)/blender/ed_sound/libed_sound.a
-PULIB += $(OCGDIR)/blender/ed_action/libed_action.a
-PULIB += $(OCGDIR)/blender/ed_nla/libed_nla.a
-PULIB += $(OCGDIR)/blender/ed_script/libed_script.a
-PULIB += $(OCGDIR)/blender/ed_text/libed_text.a
-PULIB += $(OCGDIR)/blender/ed_sequencer/libed_sequencer.a
-PULIB += $(OCGDIR)/blender/ed_file/libed_file.a
-PULIB += $(OCGDIR)/blender/ed_info/libed_info.a
-PULIB += $(OCGDIR)/blender/ed_buttons/libed_buttons.a
-PULIB += $(OCGDIR)/blender/ed_node/libed_node.a
-PULIB += $(OCGDIR)/blender/ed_graph/libed_graph.a
-PULIB += $(OCGDIR)/blender/ed_outliner/libed_outliner.a
-PULIB += $(OCGDIR)/blender/ed_time/libed_time.a
-PULIB += $(OCGDIR)/blender/ed_preview/libed_preview.a
-PULIB += $(OCGDIR)/blender/ed_view3d/libed_view3d.a
-PULIB += $(OCGDIR)/blender/ed_interface/libed_interface.a
-PULIB += $(OCGDIR)/blender/ed_object/libed_object.a
-PULIB += $(OCGDIR)/blender/ed_curve/libed_curve.a
-PULIB += $(OCGDIR)/blender/ed_armature/libed_armature.a
-PULIB += $(OCGDIR)/blender/ed_mesh/libed_mesh.a
-PULIB += $(OCGDIR)/blender/ed_sculpt_paint/libed_sculpt_paint.a
-PULIB += $(OCGDIR)/blender/ed_physics/libed_physics.a
-PULIB += $(OCGDIR)/blender/ed_animation/libed_animation.a
-PULIB += $(OCGDIR)/blender/ed_transform/libed_transform.a
-PULIB += $(OCGDIR)/blender/ed_util/libed_util.a
-PULIB += $(OCGDIR)/blender/ed_datafiles/libed_datafiles.a
-PULIB += $(OCGDIR)/blender/ed_image/libed_image.a
-PULIB += $(OCGDIR)/blender/ed_uvedit/libed_uvedit.a
-PULIB += $(OCGDIR)/blender/ed_screen/libed_screen.a
-PULIB += $(OCGDIR)/blender/windowmanager/libwindowmanager.a
+PULIB += $(OCGDIR)/blender/ed_space/$(DEBUG_DIR)libed_space.a
+PULIB += $(OCGDIR)/blender/ed_sound/$(DEBUG_DIR)libed_sound.a
+PULIB += $(OCGDIR)/blender/ed_action/$(DEBUG_DIR)libed_action.a
+PULIB += $(OCGDIR)/blender/ed_nla/$(DEBUG_DIR)libed_nla.a
+PULIB += $(OCGDIR)/blender/ed_script/$(DEBUG_DIR)libed_script.a
+PULIB += $(OCGDIR)/blender/ed_text/$(DEBUG_DIR)libed_text.a
+PULIB += $(OCGDIR)/blender/ed_sequencer/$(DEBUG_DIR)libed_sequencer.a
+PULIB += $(OCGDIR)/blender/ed_file/$(DEBUG_DIR)libed_file.a
+PULIB += $(OCGDIR)/blender/ed_info/$(DEBUG_DIR)libed_info.a
+PULIB += $(OCGDIR)/blender/ed_buttons/$(DEBUG_DIR)libed_buttons.a
+PULIB += $(OCGDIR)/blender/ed_node/$(DEBUG_DIR)libed_node.a
+PULIB += $(OCGDIR)/blender/ed_graph/$(DEBUG_DIR)libed_graph.a
+PULIB += $(OCGDIR)/blender/ed_outliner/$(DEBUG_DIR)libed_outliner.a
+PULIB += $(OCGDIR)/blender/ed_time/$(DEBUG_DIR)libed_time.a
+PULIB += $(OCGDIR)/blender/ed_preview/$(DEBUG_DIR)libed_preview.a
+PULIB += $(OCGDIR)/blender/ed_view3d/$(DEBUG_DIR)libed_view3d.a
+PULIB += $(OCGDIR)/blender/ed_interface/$(DEBUG_DIR)libed_interface.a
+PULIB += $(OCGDIR)/blender/ed_object/$(DEBUG_DIR)libed_object.a
+PULIB += $(OCGDIR)/blender/ed_curve/$(DEBUG_DIR)libed_curve.a
+PULIB += $(OCGDIR)/blender/ed_armature/$(DEBUG_DIR)libed_armature.a
+PULIB += $(OCGDIR)/blender/ed_mesh/$(DEBUG_DIR)libed_mesh.a
+PULIB += $(OCGDIR)/blender/ed_sculpt_paint/$(DEBUG_DIR)libed_sculpt_paint.a
+PULIB += $(OCGDIR)/blender/ed_physics/$(DEBUG_DIR)libed_physics.a
+PULIB += $(OCGDIR)/blender/ed_animation/$(DEBUG_DIR)libed_animation.a
+PULIB += $(OCGDIR)/blender/ed_transform/$(DEBUG_DIR)libed_transform.a
+PULIB += $(OCGDIR)/blender/ed_util/$(DEBUG_DIR)libed_util.a
+PULIB += $(OCGDIR)/blender/ed_datafiles/$(DEBUG_DIR)libed_datafiles.a
+PULIB += $(OCGDIR)/blender/ed_image/$(DEBUG_DIR)libed_image.a
+PULIB += $(OCGDIR)/blender/ed_uvedit/$(DEBUG_DIR)libed_uvedit.a
+PULIB += $(OCGDIR)/blender/ed_screen/$(DEBUG_DIR)libed_screen.a
+PULIB += $(OCGDIR)/blender/windowmanager/$(DEBUG_DIR)libwindowmanager.a
 PULIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
 PULIB += $(OCGDIR)/blender/makesrna/$(DEBUG_DIR)librna.a
 # note, no idea but it suddenly doesn't compile :(
 PULIB += $(OCGDIR)/blender/blenlib/$(DEBUG_DIR)libblenlib.a
 
 ifeq ($(NAN_NO_KETSJI),true)
-    PULIB += $(NAN_MOTO)/lib/libmoto.a
+    PULIB += $(NAN_MOTO)/lib/$(DEBUG_DIR)libmoto.a
     PULIB += $(OCGDIR)/kernel/gen_system/$(DEBUG_DIR)libgen_system.a
     PULIB += $(OCGDIR)/kernel/gen_messaging/$(DEBUG_DIR)libgen_messaging.a
     COMLIB += $(NAN_SND_LIBS)
@@ -313,7 +315,7 @@
 
 ifeq ($(OS),$(findstring $(OS), "linux"))
   ifeq ($(CPU),i386)
-    PLUGAPPLIB_XPLINK = $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)_Blender3DPlugin_implementation_.o 
+    PLUGAPPLIB_XPLINK = $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)_Blender3DPlugin_implementation_.o
   endif
 endif
 
@@ -377,7 +379,7 @@
         NAN_SND_LIBS += $(OPENALSOUND)
         NAN_SND_LIBS += $(SDLSOUND)
         NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a
-	ALUT = $(wildcard $(NAN_OPENAL)/lib/libalut.a)
+        ALUT = $(wildcard $(NAN_OPENAL)/lib/libalut.a)
         NAN_SND_LIBS += $(ALUT)
         NAN_SND_LIBS += $(SOUNDSYSTEM)
     else
@@ -387,7 +389,7 @@
         NAN_SND_LIBS += $(OPENALSOUND)
         NAN_SND_LIBS += $(SDLSOUND)
         NAN_SND_LIBS += $(NAN_OPENAL)/lib/openal_static.lib
-	ALUT = $(wildcard $(NAN_OPENAL)/lib/alut_static.lib)
+        ALUT = $(wildcard $(NAN_OPENAL)/lib/alut_static.lib)
         NAN_SND_LIBS += $(ALUT)
         NAN_SND_LIBS += $(SOUNDSYSTEM)
       else
@@ -546,7 +548,7 @@
 	@$(MAKE) -C darwin/ APPLICATION=blenderstatic
 endif
 
-$(DIR)/$(DEBUG_DIR)bin/blender$(EXT): $(OBJS) $(GRPLIB) $(PULIB) $(COMLIB) 
+$(DIR)/$(DEBUG_DIR)bin/blender$(EXT): $(OBJS) $(GRPLIB) $(PULIB) $(COMLIB)
 	@echo "****> Link $@"
 ifdef NAN_BUILDINFO
 	$(CCC) $(REL_CFLAGS) -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_TIME='"$(BUILD_TIME)"' -DBUILD_REV='"$(BUILD_REV)"' -DBUILD_PLATFORM='"$(CONFIG_GUESS)"' -DBUILD_TYPE='"dynamic"' $(BUILDINFO_C) -c -o $(BUILDINFO_O) -DNAN_BUILDINFO
@@ -636,4 +638,3 @@
 ifdef NAN_BUILDINFO
 	/bin/rm $(BUILDINFO_O)
 endif
-
Index: po/Makefile
===================================================================
--- po/Makefile	(revision 19301)
+++ po/Makefile	(working copy)
@@ -1,3 +1,5 @@
+# -*- tab-width: 8 -*-
+# vim: tabstop=8
 # $Id$
 #
 # ***** BEGIN GPL LICENSE BLOCK *****
@@ -20,9 +22,9 @@
 # Amsterdam, the Netherlands.
 # All rights reserved.
 #
-# The Original Code is: revision 1.1
+# The Original Code is: revision 1.2
 #
-# Contributor(s): Wouter van Heyst
+# Contributor(s): Wouter van Heyst, GSR
 #
 # ***** END GPL LICENSE BLOCK *****
 #
@@ -36,20 +38,19 @@
 LINGUAS = ar bg ca cs de el es fi fr hr it ja ko nl pl pt_BR ro ru sr sr@Latn sv uk zh_CN
 
 ifeq ($(OS), darwin)
-DIR = $(OCGDIR)/bin/blender.app/Contents/Resources/locale/$@/LC_MESSAGES/
+DIR = $(OCGDIR)/bin/blender.app/Contents/Resources/locale/
 else
-DIR = $(OCGDIR)/bin/.blender/locale/$@/LC_MESSAGES/
+DIR = $(OCGDIR)/bin/.blender/locale/
 endif
 
-all debug:: $(LINGUAS)
+LINGUAS_DEST= $(foreach LINGUA, $(LINGUAS), $(DIR)$(LINGUA)/LC_MESSAGES/blender.mo)
 
+$(DIR)%/LC_MESSAGES/blender.mo: %.po
+	mkdir -p $(@D)
+	msgfmt -o $@ $<
+
+all debug:: $(LINGUAS_DEST)
+#	Just trigger the deps, no explicit cmds
+
 clean::
-ifeq ($(OS), darwin)
-	rm -rf $(OCGDIR)/bin/blender.app/Contents/Resources/locale/
-else
-	rm -rf $(OCGDIR)/bin/.blender/locale/
-endif
-
-$(LINGUAS):
-	mkdir -p $(DIR)
-	msgfmt -o $(DIR)/blender.mo $@.po
+	rm -rf $(DIR)
