create only the project files specified on cmdline
[reactos.git] / reactos / tools / rbuild / backend / backend.cpp
index f6081e2..83c6df2 100644 (file)
@@ -1,54 +1,79 @@
-\r
-#include "../pch.h"\r
-\r
-#include "../rbuild.h"\r
-#include "backend.h"\r
-\r
-using std::string;\r
-using std::vector;\r
-using std::map;\r
-\r
-map<string,Backend::Factory*>*\r
-Backend::Factory::factories = NULL;\r
-int\r
-Backend::Factory::ref = 0;\r
-\r
-Backend::Factory::Factory ( const std::string& name_ )\r
-{\r
-       string name(name_);\r
-       strlwr ( &name[0] );\r
-       if ( !ref++ )\r
-               factories = new map<string,Factory*>;\r
-       (*factories)[name] = this;\r
-}\r
-\r
-Backend::Factory::~Factory()\r
-{\r
-       if ( !--ref )\r
-       {\r
-               delete factories;\r
-               factories = NULL;\r
-       }\r
-}\r
-\r
-/*static*/ Backend*\r
-Backend::Factory::Create ( const string& name,\r
-                           Project& project )\r
-{\r
-       string sname ( name );\r
-       strlwr ( &sname[0] );\r
-       if ( !factories || !factories->size() )\r
-               throw Exception ( "internal tool error: no registered factories" );\r
-       Backend::Factory* f = (*factories)[sname];\r
-       if ( !f )\r
-       {\r
-               throw UnknownBackendException ( sname );\r
-               return NULL;\r
-       }\r
-       return (*f) ( project );\r
-}\r
-\r
-Backend::Backend ( Project& project )\r
-       : ProjectNode ( project )\r
-{\r
-}\r
+/*
+ * Copyright (C) 2005 Casper S. Hornstrup
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include "../pch.h"
+
+#include "../rbuild.h"
+#include "backend.h"
+
+using std::string;
+using std::vector;
+using std::map;
+
+map<string,Backend::Factory*>*
+Backend::Factory::factories = NULL;
+int
+Backend::Factory::ref = 0;
+
+Backend::Factory::Factory ( const std::string& name_ )
+{
+       string name(name_);
+       strlwr ( &name[0] );
+       if ( !ref++ )
+               factories = new map<string,Factory*>;
+       (*factories)[name] = this;
+}
+
+Backend::Factory::~Factory ()
+{
+       if ( !--ref )
+       {
+               delete factories;
+               factories = NULL;
+       }
+}
+
+/*static*/ Backend*
+Backend::Factory::Create ( const string& name,
+                           Project& project,
+                           Configuration& configuration )
+{
+       string sname ( name );
+       strlwr ( &sname[0] );
+       if ( !factories || !factories->size () )
+               throw InvalidOperationException ( __FILE__,
+                                                 __LINE__,
+                                                 "No registered factories" );
+       Backend::Factory* f = (*factories)[sname];
+       if ( !f )
+       {
+               throw UnknownBackendException ( sname );
+               return NULL;
+       }
+       return (*f) ( project, configuration );
+}
+
+Backend::Backend ( Project& project,
+                   Configuration& configuration )
+       : ProjectNode ( project ),
+         configuration ( configuration )
+{
+}
+
+Backend::~Backend()
+{
+}