diff -ru ../orig/fastdep-0.16/fastdep.cc ./fastdep.cc
--- ../orig/fastdep-0.16/fastdep.cc	2003-10-29 12:05:16.000000000 -0500
+++ ./fastdep.cc	2009-02-19 10:56:04.963458000 -0500
@@ -40,6 +40,14 @@
 	std::vector<std::string> ExtraRemakeDeps;
 	std::string OutputFilename;
 	bool doDebug = false;
+	bool prependObj = true;
+
+	for ( int i=0; i < argc; ++i ) {
+		if ( ! strcmp(argv[i],"+O") ) {
+			prependObj = false;
+			argv[i][0] = '-';
+		}
+	}
 
 	while (1)
 	{
@@ -75,21 +83,21 @@
 						PrintVersion();
 						return 0;
 				        case 3:
-					  if (optarg)
-					    {
-					      Cache.addIncludeDir(cwd_buffer, optarg);
-					    }
-					  else
-					    {
-					      Cache.addIncludeDir(cwd_buffer, "/usr/include");
-					    }
-					  break;
-                   case 4:
-					 Cache.SetCompileCommand( std::string(optarg) );
-					 break;
-                   case 5:
-                     Cache.addIncludeDirFromFile(cwd_buffer, optarg);
-                     break;
+						if (optarg)
+						  {
+							Cache.addIncludeDir(cwd_buffer, optarg);
+						  }
+						else
+						  {
+							Cache.addIncludeDir(cwd_buffer, "/usr/include");
+						  }
+						break;
+					case 4:
+						Cache.SetCompileCommand( std::string(optarg) );
+						break;
+					case 5:
+						Cache.addIncludeDirFromFile(cwd_buffer, optarg);
+						break;
 					case 6:
 						doDebug = true;
 						break;
@@ -105,7 +113,7 @@
                 Cache.addIncludeDir(cwd_buffer, optarg);
                 break;
             case 'O':
-                Cache.SetObjectsDir(optarg);
+		Cache.SetObjectsDir(optarg,prependObj);
                 break;
             case 'e':
                 Cache.SetObjectsExt(optarg);
diff -ru ../orig/fastdep-0.16/FileCache.cc ./FileCache.cc
--- ../orig/fastdep-0.16/FileCache.cc	2003-10-29 12:03:24.000000000 -0500
+++ ./FileCache.cc	2009-02-19 10:56:43.927456000 -0500
@@ -31,6 +31,7 @@
 FileCache::FileCache(const std::string& aBaseDir)
 : BaseDir(aBaseDir),
 	ObjectsDir(""),
+	ObjectsDirPrepend(true),
 	ObjectsExt(".o"),
 	DebugMode(false),
 	WarnAboutNonExistingSystemHeaders(false)
@@ -82,7 +83,14 @@
 		}
 		else
 		{
+
+		    if ( ObjectsDirPrepend ) {
 			theStream << ObjectsDir << Basename << ".o: " << aFilename;
+		    } else {
+			std::string newPathname(Basename,0,Basename.rfind(sPathSep)+1);
+			std::string newBasename(Basename,Basename.rfind(sPathSep)+1,Basename.size());
+			theStream <<  newPathname << ObjectsDir << newBasename << ".o: " << aFilename;
+		    }
 		}
 		theStream << State.getDependenciesLine() << std::endl;
 //		State.dump();
diff -ru ../orig/fastdep-0.16/FileCache.h ./FileCache.h
--- ../orig/fastdep-0.16/FileCache.h	2003-10-29 12:03:59.000000000 -0500
+++ ./FileCache.h	2009-02-19 10:56:31.080454000 -0500
@@ -30,7 +30,8 @@
 	
 		void SetObjectsShouldContainDirectories() { ObjectsContainDirectories=true; };
 		void SetObjectsShouldNotContainDirectories() { ObjectsContainDirectories=false; };
-		void SetObjectsDir(const std::string& aDir) { ObjectsDir = aDir+sPathSep; }
+		void SetObjectsDir(const std::string& aDir, bool prepend=true)
+			{ ObjectsDir = aDir+sPathSep; ObjectsDirPrepend = prepend; }
 		void SetObjectsExt(const std::string& aExt) { ObjectsExt = aExt; }
 
 		void SetCompileCommand( const std::string &cmd );
@@ -63,6 +64,7 @@
 		std::vector<std::string> PreDefined;
 		std::string BaseDir;
 		std::string ObjectsDir;
+		bool ObjectsDirPrepend;
 		std::string ObjectsExt;
 		std::string CompileCommand;
 		bool ObjectsContainDirectories;
diff -ru ../orig/fastdep-0.16/MappedFile.cc ./MappedFile.cc
--- ../orig/fastdep-0.16/MappedFile.cc	2003-10-29 11:44:39.000000000 -0500
+++ ./MappedFile.cc	2009-02-19 10:56:58.431455000 -0500
@@ -96,8 +96,10 @@
 		
 MappedFile::~MappedFile()
 {
-	munmap(map_, mapsize);
-	close(fd);		
+	if ( map_ ) {
+		munmap(map_, mapsize);
+		close(fd);
+	}
 }
 
 				
diff -ru ../orig/fastdep-0.16/MappedFile.h ./MappedFile.h
--- ../orig/fastdep-0.16/MappedFile.h	2003-10-29 11:44:39.000000000 -0500
+++ ./MappedFile.h	2009-02-19 10:57:05.183454000 -0500
@@ -17,7 +17,7 @@
 
 struct MapFileData
 {	
-	int mapsize;
+	size_t mapsize;
 	int fd;
 };
 
@@ -39,7 +39,7 @@
 	/** C'tor
 	 *
 	 */
-	MappedFile() : opened_(false),file_size(0){}
+	MappedFile() : opened_(false), file_size(0), map_(0) {}
 	
 	/** D'tor
 	 *
