Commits

Anonymous committed f3251e4 Merge

* updated upstream

  • Participants
  • Parent commits 4a0c205, e7a41f9

Comments (0)

Files changed (85)

File samples/complex_platforms/premake4.lua

-solution "MySolution"
-
-	configurations { 
-		"Debug", 
-		"Deployment", 
-		"Profiling", 
-		"Release" 
-	}
-
-	platforms {
-		"Win32 Static SCRT",
-		"Win32 Static DCRT",
-		"Win32 DLL",
-		"Win64 Static SCRT",
-		"Win64 Static DCRT",
-		"Win64 DLL",
-		"PS3 PPU GCC",
-		"PS3 PPU SN",
-		"PS3 SPU GCC",
-		"PS3 SPU SN"
-	}
-
-
---
--- Map the platforms to their underlying architectures.
---
-	
-	configuration { "Win32 *" }
-		architecture "x32"
-		os "windows"
-		
- 	configuration { "Win64 *" }
-		architecture "x64"
-		os "windows"
-
-	configuration { "* PPU *" }
-		architecture "ps3ppu"
-		
-	configuration { "* SPU *" }
-		architecture "ps3spu"
-	
-	configuration { "* GCC" }
-		compiler "gcc"
-		
-	configuration { "* SN" }
-		compiler "sn"

File samples/gmake/CppExe/Makefile

-# GNU Makefile autogenerated by Premake
-# Please build using the solution Makefile at:
-#  ../Makefile
-
-ifndef CONFIG
-  CONFIG=Debug
-endif
-
-ifeq ($(CONFIG),Debug)
-  BINDIR := ..
-  LIBDIR := ..
-  OBJDIR := obj/Debug
-  OUTDIR := ..
-  CPPFLAGS := -MMD
-  CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g
-  CXXFLAGS := $(CFLAGS)
-  LDFLAGS += -L$(BINDIR) -L$(LIBDIR)
-  LDDEPS :=
-  RESFLAGS :=
-  TARGET := CppExe.exe
-  BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
-endif
-
-ifeq ($(CONFIG),Release)
-  BINDIR := ..
-  LIBDIR := ..
-  OBJDIR := obj/Release
-  OUTDIR := ..
-  CPPFLAGS := -MMD
-  CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -O2
-  CXXFLAGS := $(CFLAGS)
-  LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -s
-  LDDEPS :=
-  RESFLAGS :=
-  TARGET := CppExe.exe
-  BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
-endif
-
-OBJECTS := \
-	$(OBJDIR)/Hello.o \
-
-RESOURCES := \
-
-# Can I have premake check the OS type instead of doing this here?
-
-MKDIR_TYPE := msdos
-CMD := $(subst \,\\,$(ComSpec)$(COMSPEC))
-ifeq (,$(CMD))
-  MKDIR_TYPE := posix
-endif
-ifeq (/bin/sh.exe,$(SHELL))
-  MKDIR_TYPE := posix
-endif
-ifeq ($(MKDIR_TYPE),posix)
-  CMD_MKBINDIR := mkdir -p $(BINDIR)
-  CMD_MKLIBDIR := mkdir -p $(LIBDIR)
-  CMD_MKOUTDIR := mkdir -p $(OUTDIR)
-  CMD_MKOBJDIR := mkdir -p $(OBJDIR)
-else
-  CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR))
-  CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR))
-  CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR))
-  CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR))
-endif
-
-.PHONY: clean
-
-# I really only need to create OUTDIR; that's the only one that matters!
-
-$(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES)
-	@echo Linking CppExe
-	-@$(CMD_MKBINDIR)
-	-@$(CMD_MKLIBDIR)
-	-@$(CMD_MKOUTDIR)
-	@$(BLDCMD)
-
-clean:
-	@echo Cleaning CppExe
-ifeq ($(MKDIR_TYPE),posix)
-	-@rm -f $(OUTDIR)/$(TARGET)
-	-@rm -rf $(OBJDIR)
-else
-	-@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET))
-	-@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR))
-	-@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR))
-endif
-
-# add an "objdir" as first dependency to target and create directories there (or maybe
-# call it outdirs and do all required output directories
-
-$(OBJDIR)/Hello.o: Hello.cpp
-	-@$(CMD_MKOBJDIR)
-	@echo $(notdir $<)
-	@$(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJECTS:%.o=%.d)
-

File samples/gmake/Makefile

-# GNU Makefile autogenerated by Premake
-# Usage: make [ CONFIG=config_name ]
-# Where {config_name} is one of:
-#   Debug, Release
-
-ifndef CONFIG
-  CONFIG=Debug
-endif
-export CONFIG
-
-.PHONY: all clean CppExe
-
-all: CppExe
-
-Makefile: premake.lua CppExe/premake.lua
-	@echo ==== Regenerating Makefiles ====
-	@premake --file $^ --target gnu
-
-CppExe:
-	@echo ==== Building CppExe ====
-	@$(MAKE) --no-print-directory -C CppExe
-
-clean:
-	@$(MAKE) --no-print-directory -C CppExe clean

File samples/project/CppConsoleApp/CppConsoleApp.cpp

-#include "stdafx.h"
-
-int main()
-{
-	printf("CppConsoleApp\n");
-	return 0;
-}

File samples/project/CppConsoleApp/premake4.lua

-project "CppConsoleApp"
-
-	kind     "ConsoleApp"
-	language "C++"
-	
-	flags    { "FatalWarnings", "ExtraWarnings" }
-	
-	files    { "*.h", "*.cpp" }
-	
-	includedirs { "I:/Code" }
-
-	libdirs { "../lib" }
-	links   { "CppSharedLib" }
-	
-	configuration "Debug"
-		targetdir "../bin/debug (x64)"
-		links { "CppStaticLib" }
-		
-	configuration "Release"
-		targetdir "../bin/release (x64)"

File samples/project/CppConsoleApp/stdafx.cpp

-#include "stdafx.h"

File samples/project/CppConsoleApp/stdafx.h

-#include <stdio.h>
-
-#define MY_SYMBOL

File samples/project/CppSharedLib/CppSharedLib.cpp

-#include <stdio.h>
-
-void CppSharedLib()
-{
-	printf("CppSharedLib\n");
-}

File samples/project/CppSharedLib/CppSharedLib.def

-EXPORTS
-  CppSharedLib

File samples/project/CppSharedLib/premake4.lua

-project "CppSharedLib"
-
-	kind     "SharedLib"
-	language "C++"
-	files    { "*.cpp", "CppSharedLib.def" }
-	
-	configuration "Debug"
-		targetdir "lib/debug"
-		
-	configuration "Release"
-		targetdir "lib/release"
-
-	
-	if _ACTION == "clean" then
-		os.rmdir("lib")
-	end

File samples/project/CppStaticLib/CppStaticLib.cpp

-#include <stdio.h>
-
-void CppStaticLib()
-{
-	printf("CppStaticLib\n");
-}

File samples/project/CppStaticLib/premake4.lua

-project "CppStaticLib"
-
-	kind     "StaticLib"
-	language "C++"
-	files    { "*.cpp" }
-
-	configuration "Debug"
-		targetdir "lib/debug"
-		
-	configuration "Release"
-		targetdir "lib/release"
-	
-	
-	if _ACTION == "clean" then
-		os.rmdir("lib")
-	end

File samples/project/CppWindowedApp/CppWindowedApp.cpp

-#include <stdio.h>
-
-int main()
-{
-	printf("CppWindowedApp\n");
-	return 0;
-}

File samples/project/CppWindowedApp/premake4.lua

-project "CppWindowedApp"
-
-	kind     "WindowedApp"
-	language "C++"
-	
-	files    "*.cpp"
-	
-	libdirs { "../lib" }
-	links   { "CppStaticLib" }
-	
-	configuration "windows"
-		links { "user32", "gdi32" }
-

File samples/project/CsConsoleApp/App.config

-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
-</configuration>

File samples/project/CsConsoleApp/Crate.bmp

Removed
Old image

File samples/project/CsConsoleApp/CsConsoleApp.cs

-using System;
-using System.Reflection;
-using System.Resources;
-
-public class CsConsoleApp
-{
-	static int Main()
-	{
-		Assembly assembly = Assembly.GetExecutingAssembly();
-		ResourceManager resx = new ResourceManager("CsConsoleApp.Resources", assembly);
-		string greeting = resx.GetString("Greeting");
-		Console.WriteLine(greeting);
-
-		Console.WriteLine("CsConsoleApp");
-
-		CsSharedLib lib = new CsSharedLib();
-		lib.DoIt();
-
-		return 0;
-	}
-}

File samples/project/CsConsoleApp/Resource1.Designer.cs

-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.832
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace ConsoleApplication2 {
-    using System;
-    
-    
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resource1 {
-        
-        private static global::System.Resources.ResourceManager resourceMan;
-        
-        private static global::System.Globalization.CultureInfo resourceCulture;
-        
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resource1() {
-        }
-        
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager {
-            get {
-                if (object.ReferenceEquals(resourceMan, null)) {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ConsoleApplication2.Resource1", typeof(Resource1).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-        
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture {
-            get {
-                return resourceCulture;
-            }
-            set {
-                resourceCulture = value;
-            }
-        }
-    }
-}

File samples/project/CsConsoleApp/Resource1.resx

-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-		Microsoft ResX Schema
-
-		Version 1.3
-
-		The primary goals of this format is to allow a simple XML format 
-		that is mostly human readable. The generation and parsing of the 
-		various data types are done through the TypeConverter classes 
-		associated with the data types.
-
-		Example:
-
-		... ado.net/XML headers & schema ...
-		<resheader name="resmimetype">text/microsoft-resx</resheader>
-		<resheader name="version">1.3</resheader>
-		<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-		<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-		<data name="Name1">this is my long string</data>
-		<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-		<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-			[base64 mime encoded serialized .NET Framework object]
-		</data>
-		<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-			[base64 mime encoded string representing a byte array form of the .NET Framework object]
-		</data>
-
-		There are any number of "resheader" rows that contain simple 
-		name/value pairs.
-
-		Each data row contains a name, and value. The row also contains a 
-		type or mimetype. Type corresponds to a .NET class that support 
-		text/value conversion through the TypeConverter architecture. 
-		Classes that don't support this are serialized and stored with the 
-		mimetype set.
-
-		The mimetype is used for serialized objects, and tells the 
-		ResXResourceReader how to depersist the object. This is currently not 
-		extensible. For a given mimetype the value must be set accordingly:
-
-		Note - application/x-microsoft.net.object.binary.base64 is the format 
-		that the ResXResourceWriter will generate, however the reader can 
-		read any of the formats listed below.
-
-		mimetype: application/x-microsoft.net.object.binary.base64
-		value   : The object must be serialized with 
-			: System.Serialization.Formatters.Binary.BinaryFormatter
-			: and then encoded with base64 encoding.
-
-		mimetype: application/x-microsoft.net.object.soap.base64
-		value   : The object must be serialized with 
-			: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-			: and then encoded with base64 encoding.
-
-		mimetype: application/x-microsoft.net.object.bytearray.base64
-		value   : The object must be serialized into a byte array 
-			: using a System.ComponentModel.TypeConverter
-			: and then encoded with base64 encoding.
-	-->
-
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>1.3</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>

File samples/project/CsConsoleApp/premake4.lua

-project "CsConsoleApp"
-
-	kind     "ConsoleApp"
-	language "C#"
-	
-	files   { "**.cs", "**.bmp", "**.resx", "**.config" }
-	
-	libdirs { "../lib" }
-	links { "CsSharedLib", "CppSharedLib", "System" }
-
-	buildoptions { "/define:TEST" }
-		
-	configuration "*.bmp"
-		buildaction "Embed"

File samples/project/CsSharedLib/App.config

-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
-</configuration>

File samples/project/CsSharedLib/CsSharedLib.cs

-using System;
-
-public class CsSharedLib
-{
-	public void DoIt()
-	{
-		Console.WriteLine("CsSharedLib");
-	}
-}

File samples/project/CsSharedLib/premake4.lua

-project "CsSharedLib"
-
-	kind     "SharedLib"
-	language "C#"
-	files    { "*.cs" }
-
-	configuration "Debug"
-		targetdir "lib/debug"
-		
-	configuration "Release"
-		targetdir "lib/release"
-
-
-	if _ACTION == "clean" then
-		os.rmdir("lib")
-	end

File samples/project/premake4

-#!/bin/sh
-
-../../bin/debug/premake4 /scripts=../../src $1 $2 $3 $4 $5 $6 $7

File samples/project/premake4.lua

-solution "PremakeTestbox"
-	configurations { "Debug", "Release" }
-	
--- solution level configuration
-	
-	configuration "Debug"
-		targetdir "bin/debug"
-		flags   { "Symbols" }
-		defines { "_DEBUG", "DEBUG" }
-		
-	configuration "Release"
-		targetdir "bin/release"
-		flags   { "Optimize" }
-		defines { "NDEBUG" }
-			
-
--- include all the projects
-	
-	include "CppConsoleApp"
-	include "CppWindowedApp"
-	include "CppSharedLib"
-	include "CppStaticLib"
-
-	if premake.action.supports(premake.action.current(), "C#") then
-		include "CsSharedLib"
-		include "CsConsoleApp"
-	end
-	
-
-
--- add a new install action
-
-	newaction {
-		trigger     = "install",
-		description = "Install the project",
-		execute     = function ()
-			os.copyfile("premake4.lua", "../premake4.lua")
-		end
-	} 
-

File samples/vs2002/CppExe/CppExe.vcproj

-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.00"
-	Name="CppExe"
-	ProjectGUID="{AE61726D-187C-E440-BD07-2556188A6565}"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".."
-			IntermediateDirectory="obj/Debug"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				EnableFunctionLevelLinking="TRUE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="2"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/CppExe.exe"
-				LinkIncremental="2"
-				AdditionalLibraryDirectories=".."
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/CppExe.pdb"
-				SubSystem="1"
-				EntryPointSymbol="mainCRTStartup"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".."
-			IntermediateDirectory="obj/Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="2"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/CppExe.exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=".."
-				GenerateDebugInformation="FALSE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				EntryPointSymbol="mainCRTStartup"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-		</Configuration>
-	</Configurations>
-	<Files>
-		<File
-			RelativePath=".\Hello.cpp">
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>

File samples/vs2002/MySolution.sln

-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppExe", "CppExe/CppExe.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}"
-EndProject
-Global
-	GlobalSection(SolutionConfiguration) = preSolution
-		ConfigName.0 = Debug
-		ConfigName.1 = Release
-	EndGlobalSection
-	GlobalSection(ProjectDependencies) = postSolution
-	EndGlobalSection
-	GlobalSection(ProjectConfiguration) = postSolution
-		{AE61726D-187C-E440-BD07-2556188A6565}.Debug.ActiveCfg = Debug|Win32
-		{AE61726D-187C-E440-BD07-2556188A6565}.Debug.Build.0 = Debug|Win32
-		{AE61726D-187C-E440-BD07-2556188A6565}.Release.ActiveCfg = Release|Win32
-		{AE61726D-187C-E440-BD07-2556188A6565}.Release.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-	EndGlobalSection
-	GlobalSection(ExtensibilityAddIns) = postSolution
-	EndGlobalSection
-EndGlobal

File samples/vs2003/CppExe/CppExe.vcproj

-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="CppExe"
-	ProjectGUID="{2606321E-67AA-8244-A5C1-67F2E3F8CA0C}"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".."
-			IntermediateDirectory="obj/Debug"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				EnableFunctionLevelLinking="TRUE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="2"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/CppExe.exe"
-				LinkIncremental="2"
-				AdditionalLibraryDirectories=".."
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/CppExe.pdb"
-				SubSystem="1"
-				EntryPointSymbol="mainCRTStartup"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".."
-			IntermediateDirectory="obj/Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="2"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/CppExe.exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=".."
-				GenerateDebugInformation="FALSE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				EntryPointSymbol="mainCRTStartup"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\Hello.cpp">
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>

File samples/vs2003/EmptySolution.sln

-Microsoft Visual Studio Solution File, Format Version 8.00
-Global
-	GlobalSection(SolutionConfiguration) = preSolution
-	EndGlobalSection
-	GlobalSection(ProjectConfiguration) = postSolution
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-	EndGlobalSection
-	GlobalSection(ExtensibilityAddIns) = postSolution
-	EndGlobalSection
-EndGlobal

File samples/vs2003/MySolution.sln

-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppExe", "CppExe/CppExe.vcproj", "{2606321E-67AA-8244-A5C1-67F2E3F8CA0C}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfiguration) = preSolution
-		Debug = Debug
-		Release = Release
-	EndGlobalSection
-	GlobalSection(ProjectConfiguration) = postSolution
-		{2606321E-67AA-8244-A5C1-67F2E3F8CA0C}.Debug.ActiveCfg = Debug|Win32
-		{2606321E-67AA-8244-A5C1-67F2E3F8CA0C}.Debug.Build.0 = Debug|Win32
-		{2606321E-67AA-8244-A5C1-67F2E3F8CA0C}.Release.ActiveCfg = Release|Win32
-		{2606321E-67AA-8244-A5C1-67F2E3F8CA0C}.Release.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-	EndGlobalSection
-	GlobalSection(ExtensibilityAddIns) = postSolution
-	EndGlobalSection
-EndGlobal

File samples/vs2005/CppExe/CppExe.cpp

-#include <stdio.h>
-
-int main()
-{
-	puts(""#MSG);
-	return 0;
-}

File samples/vs2005/CppExe/CppExe.vcproj

-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="CppExe"
-	ProjectGUID="{AE2461B7-236F-4278-81D3-F0D476F9A4C0}"
-	RootNamespace="CppExe"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;MSG=&quot;Hi there&quot;;BUILDING"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="2"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="2"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\CppExe.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>

File samples/vs2005/EmptySolution.sln

-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Global
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

File samples/vs2005/MySolution.sln

-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppExe", "CppExe\CppExe.vcproj", "{AE2461B7-236F-4278-81D3-F0D476F9A4C0}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Release|Win32 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Debug|Win32.Build.0 = Debug|Win32
-		{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Release|Win32.ActiveCfg = Release|Win32
-		{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Release|Win32.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

File samples/vs2008/CppConsoleApp/CppConsoleApp.cpp

-// CppConsoleApp.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-
-
-int _tmain(int argc, _TCHAR* argv[])
-{
-	return 0;
-}
-

File samples/vs2008/CppConsoleApp/ReadMe.txt

-========================================================================
-    CONSOLE APPLICATION : CppConsoleApp Project Overview
-========================================================================
-
-AppWizard has created this CppConsoleApp application for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your CppConsoleApp application.
-
-
-CppConsoleApp.vcproj
-    This is the main project file for VC++ projects generated using an Application Wizard.
-    It contains information about the version of Visual C++ that generated the file, and
-    information about the platforms, configurations, and project features selected with the
-    Application Wizard.
-
-CppConsoleApp.cpp
-    This is the main application source file.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
-    These files are used to build a precompiled header (PCH) file
-    named CppConsoleApp.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////

File samples/vs2008/CppConsoleApp/stdafx.cpp

-// stdafx.cpp : source file that includes just the standard includes
-// CppConsoleApp.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file

File samples/vs2008/CppConsoleApp/stdafx.h

-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include "targetver.h"
-
-#include <stdio.h>
-#include <tchar.h>
-
-
-
-// TODO: reference additional headers your program requires here

File samples/vs2008/CppConsoleApp/targetver.h

-#pragma once
-
-// The following macros define the minimum required platform.  The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run 
-// your application.  The macros work by enabling all features available on platform versions up to and 
-// including the version specified.
-
-// Modify the following defines if you have to target a platform prior to the ones specified below.
-// Refer to MSDN for the latest info on corresponding values for different platforms.
-#ifndef _WIN32_WINNT            // Specifies that the minimum required platform is Windows Vista.
-#define _WIN32_WINNT 0x0600     // Change this to the appropriate value to target other versions of Windows.
-#endif
-

File samples/vs2008/MySolution.sln

-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppConsoleApp", "CppConsoleApp\CppConsoleApp.vcproj", "{ED6D7B68-0231-4009-817B-AAA66F4F863D}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{ED6D7B68-0231-4009-817B-AAA66F4F863D}.Debug|Win32.ActiveCfg = Debug|Win32
-		{ED6D7B68-0231-4009-817B-AAA66F4F863D}.Debug|Win32.Build.0 = Debug|Win32
-		{ED6D7B68-0231-4009-817B-AAA66F4F863D}.Debug|x64.ActiveCfg = Debug|x64
-		{ED6D7B68-0231-4009-817B-AAA66F4F863D}.Debug|x64.Build.0 = Debug|x64
-		{ED6D7B68-0231-4009-817B-AAA66F4F863D}.Release|Win32.ActiveCfg = Release|Win32
-		{ED6D7B68-0231-4009-817B-AAA66F4F863D}.Release|Win32.Build.0 = Release|Win32
-		{ED6D7B68-0231-4009-817B-AAA66F4F863D}.Release|x64.ActiveCfg = Release|x64
-		{ED6D7B68-0231-4009-817B-AAA66F4F863D}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

File src/_premake_main.lua

 
 		_PREMAKE_COMMAND = path.getabsolute(_PREMAKE_COMMAND)
 
+		-- Enable extensions - the '?' character is replaced with the extension
+		-- name so the extension directory name _must_ be the same as the
+		-- extension Lua file.  eg. .../d/d.lua, .../codelite/codelite.lua etc
+		local home = os.getenv("HOME") or os.getenv("USERPROFILE")
+		local extdirs = { 
+			home .. "/.premake/?/?.lua",
+			path.getdirectory( _PREMAKE_COMMAND ) .. "/ext/?/?.lua", 
+			"./premake/?/?.lua",
+			"/usr/share/premake/?/?.lua" }
+		for _,v in ipairs(extdirs) do
+			package.path = package.path .. ";" .. v
+		end
 
 		-- The "next-gen" actions have now replaced their deprecated counterparts.
 		-- Provide a warning for a little while before I remove them entirely.

File src/actions/make/_make.lua

 --
 -- _make.lua
 -- Define the makefile action(s).
--- Copyright (c) 2002-2012 Jason Perkins and the Premake project
+-- Copyright (c) 2002-2013 Jason Perkins and the Premake project
 --
 
 	premake.make = {}
 	local solution = premake.solution
 	local project = premake5.project
 
---
+
+---
 -- The GNU make action, with support for the new platforms API
---
+---
 
 	newaction {
 		trigger         = "gmake",
 		},
 
 		onsolution = function(sln)
+			io.esc = make.esc
 			premake.generate(sln, make.getmakefilename(sln, false), make.generate_solution)
 		end,
 
 		onproject = function(prj)
+			io.esc = make.esc
 			local makefile = make.getmakefilename(prj, true)
 			if project.isdotnet(prj) then
 				premake.generate(prj, makefile, make.generate_csharp)
 		local cfg = iter()
 		if cfg then
 			_p('ifndef config')
-			_p('  config=%s', make.esc(cfg.shortname))
+			_x('  config=%s', cfg.shortname)
 			_p('endif')
 			_p('')
 		end
 	end
 
 
---
+---
 -- Escape a string so it can be written to a makefile.
---
+---
 
 	function make.esc(value)
-		local result
-		if (type(value) == "table") then
-			result = { }
-			for _,v in ipairs(value) do
-				table.insert(result, make.esc(v))
-			end
-			return result
-		else
-			-- handle simple replacements
-			result = value:gsub("\\", "\\\\")
-			result = result:gsub(" ", "\\ ")
-			result = result:gsub("%(", "\\%(")
-			result = result:gsub("%)", "\\%)")
+		result = value:gsub("\\", "\\\\")
+		result = result:gsub(" ", "\\ ")
+		result = result:gsub("%(", "\\%(")
+		result = result:gsub("%)", "\\%)")
 
-			-- leave $(...) shell replacement sequences alone
-			result = result:gsub("$\\%((.-)\\%)", "$%(%1%)")
-			return result
-		end
+		-- leave $(...) shell replacement sequences alone
+		result = result:gsub("$\\%((.-)\\%)", "$%(%1%)")
+		return result
 	end
 
 
 
 	function make.targetconfig(cfg)
 		local targetdir =
-		_p('  TARGETDIR  = %s', make.esc(project.getrelative(cfg.project, cfg.buildtarget.directory)))
-		_p('  TARGET     = $(TARGETDIR)/%s', make.esc(cfg.buildtarget.name))
-		_p('  OBJDIR     = %s', make.esc(project.getrelative(cfg.project, cfg.objdir)))
+		_x('  TARGETDIR  = %s', project.getrelative(cfg.project, cfg.buildtarget.directory))
+		_x('  TARGET     = $(TARGETDIR)/%s', cfg.buildtarget.name)
+		_x('  OBJDIR     = %s', project.getrelative(cfg.project, cfg.objdir))
 	end
 
 

File src/actions/make/make_cpp.lua

 			error("Invalid toolset '" + cfg.toolset + "'")
 		end
 
-		_p('ifeq ($(config),%s)', make.esc(cfg.shortname))
+		_x('ifeq ($(config),%s)', cfg.shortname)
 
 		-- write toolset specific configurations
 		cpp.toolconfig(cfg, toolset)
 		-- C/C++ file
 		if path.iscppfile(node.abspath) then
 			local objectname = project.getfileobject(prj, node.abspath)
-			_p('$(OBJDIR)/%s.o: %s', make.esc(objectname), make.esc(node.relpath))
+			_x('$(OBJDIR)/%s.o: %s', objectname, node.relpath)
 			_p('\t@echo $(notdir $<)')
 			cpp.buildcommand(prj, "o", node)
 
 		-- resource file
 		elseif path.isresourcefile(node.abspath) then
 			local objectname = project.getfileobject(prj, node.abspath)
-			_p('$(OBJDIR)/%s.res: %s', make.esc(objectname), make.esc(node.relpath))
+			_x('$(OBJDIR)/%s.res: %s', objectname, node.relpath)
 			_p('\t@echo $(notdir $<)')
 			_p('\t$(SILENT) $(RESCOMP) $< -O coff -o "$@" $(ALL_RESFLAGS)')
 		end
 		for cfg in project.eachconfig(prj) do
 			local filecfg = config.getfileconfig(cfg, node.abspath)
 			if filecfg then
-				_p('ifeq ($(config),%s)', make.esc(cfg.shortname))
+				_x('ifeq ($(config),%s)', cfg.shortname)
 
 				local output = project.getrelative(prj, filecfg.buildoutputs[1])
-				_p('%s: %s', make.esc(output), make.esc(filecfg.relpath))
+				_x('%s: %s', output, filecfg.relpath)
 				_p('\t@echo "%s"', filecfg.buildmessage or ("Building " .. filecfg.relpath))
 				for _, cmd in ipairs(filecfg.buildcommands) do
 					_p('\t$(SILENT) %s', cmd)
 		local defines = make.esc(toolset.getdefines(cfg.defines))
 		_p('  DEFINES   +=%s', make.list(defines))
 
-		local includes = make.esc(toolset.getincludedirs(cfg, cfg.includedirs))
+		local includes = premake.esc(toolset.getincludedirs(cfg, cfg.includedirs))
 		_p('  INCLUDES  +=%s', make.list(includes))
 
 		_p('  ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(toolset.getcppflags(cfg), " "))
 		
 
 		local deps = config.getlinks(cfg, "siblings", "fullpath")
-		_p('  LDDEPS    +=%s', make.list(make.esc(deps)))
+		_p('  LDDEPS    +=%s', make.list(premake.esc(deps)))
 
 		if cfg.kind == premake.STATICLIB then
 			if cfg.architecture == premake.UNIVERSAL then
 		function listobjects(var, list)
 			_p('%s \\', var)
 			for _, objectname in ipairs(list) do
-				_p('\t%s \\', make.esc(objectname))
+				_x('\t%s \\', objectname)
 			end
 			_p('')
 		end
 		for cfg in project.eachconfig(prj) do
 			local files = configs[cfg]
 			if #files.objects > 0 or #files.resources > 0 then
-				_p('ifeq ($(config),%s)', make.esc(cfg.shortname))
+				_x('ifeq ($(config),%s)', cfg.shortname)
 				if #files.objects > 0 then
 					listobjects('  OBJECTS +=', files.objects)
 				end
 
 			local gch = make.esc(path.getname(pchheader))
 			local pch = make.esc(project.getrelative(cfg.project, pchheader))
-			_p('  PCH        = %s', make.esc(project.getrelative(cfg.project, pchheader)))
+			_p('  PCH        = %s', pch))
 			_p('  GCH        = $(OBJDIR)/%s.gch', gch)
 			_p('  CPPFLAGS  += -I$(OBJDIR) -include %s', pch)
 		end

File src/actions/make/make_csharp.lua

 		-- per-file rules
 		_p('# Per-configuration copied file rules')
 		for cfg in premake.eachconfig(prj) do
-			_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))
+			_x('ifneq (,$(findstring %s,$(config)))', cfg.name:lower())
 			for target, source in pairs(cfgpairs[cfg]) do
 				premake.make_copyrule(source, target)
 			end
 		_p('# Embedded file rules')
 		for _, fname in ipairs(embedded) do
 			if path.getextension(fname) == ".resx" then
-				_p('%s: %s', getresourcefilename(prj, fname), _MAKE.esc(fname))
+				_x('%s: %s', getresourcefilename(prj, fname), fname)
 				_p('\t$(SILENT) $(RESGEN) $^ $@')
 			end
 			_p('')
 --
 
 	function cs.config(cfg, toolset)
-		_p('ifeq ($(config),%s)', make.esc(cfg.shortname))
+		_x('ifeq ($(config),%s)', cfg.shortname)
 
 		-- write toolset specific configurations
 		cs.toolconfig(cfg, toolset)
 		    if dir ~= "." then
 				name = name .. path.translate(dir, ".") .. "."
 			end
-			return "$(OBJDIR)/" .. make.esc(name .. path.getbasename(fname)) .. ".resources"
+			return "$(OBJDIR)/" .. premake.esc(name .. path.getbasename(fname)) .. ".resources"
 		else
 			return fname
 		end
 --
 
 	function cs.linking(cfg, toolset)
-		local deps = make.esc(config.getlinks(cfg, "dependencies", "fullpath"))
+		local deps = premake.esc(config.getlinks(cfg, "dependencies", "fullpath"))
 		_p('  DEPENDS    = %s', table.concat(deps))
 		_p('  REFERENCES = %s', table.implode(deps, "/r:", "", " "))
 	end
 			onleaf = function(node, depth)
 				local value = selector(node)
 				if value then
-					_p('\t%s \\', make.esc(path.translate(value)))
+					_x('\t%s \\', path.translate(value))
 				end
 			end
 		})
 
 	function cs.prj_config(cfg, toolset)
 		local kindflag = "/t:" .. toolset.getkind(cfg):lower()
-		local libdirs = table.implode(make.esc(cfg.libdirs), "/lib:", "", " ")
+		local libdirs = table.implode(premake.esc(cfg.libdirs), "/lib:", "", " ")
 		_p('FLAGS      += %s', table.concat(table.join(kindflag, libdirs), " "))
 
-		local refs = make.esc(config.getlinks(cfg, "system", "fullpath"))
+		local refs = premake.esc(config.getlinks(cfg, "system", "fullpath"))
 		_p('REFERENCES += %s', table.implode(refs, "/r:", "", " "))
 
 		_p('')

File src/actions/make/make_solution.lua

 		_p(1,'@echo "CONFIGURATIONS:"')
 
 		for cfg in solution.eachconfig(sln) do
-			_p(1, '@echo "  %s"', make.esc(cfg.shortname))
+			_x(1, '@echo "  %s"', cfg.shortname)
 		end
 
 		_p(1,'@echo ""')
 --
 
 	function make.projects(sln)
-		_p('PROJECTS := %s', table.concat(make.esc(table.extract(sln.projects, "name")), " "))
+		_p('PROJECTS := %s', table.concat(premake.esc(table.extract(sln.projects, "name")), " "))
 		_p('')
 	end
 
 		for prj in solution.eachproject_ng(sln) do
 			local deps = project.getdependencies(prj)
 			deps = table.extract(deps, "name")
-			_p('%s: %s', make.esc(prj.name), table.concat(deps, " "))
+			_p('%s: %s', premake.esc(prj.name), table.concat(deps, " "))
 
 			local cfgvar = make.tovar(prj.name)
 			_p('ifneq (,$(%s_config))', cfgvar)

File src/actions/vstudio/vs2005.lua

 ---
 
 	function vs2005.generateSolution(sln)
+		io.eol = "\r\n"
+		io.esc = vs2005.esc
+
 		premake.generate(sln, ".sln", vstudio.sln2005.generate_ng)
 	end
 
 
 	function vs2005.generateProject(prj)
+		io.eol = "\r\n"
+		io.esc = vs2005.esc
+
 		if premake5.project.isdotnet(prj) then
 			premake.generate(prj, ".csproj", vstudio.cs2005.generate_ng)
 			premake.generate(prj, ".csproj.user", vstudio.cs2005.generate_user_ng)
 	end
 
 
+
+---
+-- Apply XML escaping on a value to be included in an
+-- exported project file.
+---
+
+	function vs2005.esc(value)
+		value = string.gsub(value, '&',  "&amp;")
+		value = value:gsub('"',  "&quot;")
+		value = value:gsub("'",  "&apos;")
+		value = value:gsub('<',  "&lt;")
+		value = value:gsub('>',  "&gt;")
+		value = value:gsub('\r', "&#x0D;")
+		value = value:gsub('\n', "&#x0A;")
+		return value
+	end
+
+
+
+---
+-- Define the Visual Studio 2005 export action.
+---
+
 	newaction {
 		-- Metadata for the command line and help system
 

File src/actions/vstudio/vs2005_csproj.lua

 	}
 
 	function cs2005.generate_ng(prj)
-		io.eol = "\r\n"
 		io.indent = "  "
 		io.utf8()
 

File src/actions/vstudio/vs2005_csproj_user.lua

 --
 -- vs2005_csproj_user.lua
 -- Generate a Visual Studio 2005/2008 C# .user file.
--- Copyright (c) 2009-2012 Jason Perkins and the Premake project
+-- Copyright (c) 2009-2013 Jason Perkins and the Premake project
 --
 
 	local cs2005 = premake.vstudio.cs2005
 --
 -- Generate a Visual Studio 200x C# user file, with support for the new platforms API.
 --
-	
+
 	function cs2005.generate_user_ng(prj)
-		io.eol = "\r\n"
 		io.indent = "  "
-		
+
 		_p('<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">')
 		_p(1,'<PropertyGroup>')
-		
+
 		-- Per-configuration reference paths aren't supported (are they?) so just
 		-- use the first configuration in the project
 		local cfg = project.getfirstconfig(prj)
-		
+
 		local refpaths = path.translate(project.getrelative(prj, cfg.libdirs))
 		_p(2,'<ReferencePath>%s</ReferencePath>', table.concat(refpaths, ";"))
-		
+
 		_p('  </PropertyGroup>')
 		_p('</Project>')
 	end

File src/actions/vstudio/vs2005_solution.lua

 --
 -- vs2005_solution.lua
 -- Generate a Visual Studio 2005-2012 solution.
--- Copyright (c) 2009-2012 Jason Perkins and the Premake project
+-- Copyright (c) 2009-2013 Jason Perkins and the Premake project
 --
 
 	premake.vstudio.sln2005 = {}
 --
 
 	function sln2005.generate_ng(sln)
-		io.eol = '\r\n'
-
 		-- Mark the file as Unicode
 		_p('\239\187\191')
 
 		sln2005.properties(sln)
 		sln2005.NestedProjects(sln)
 		_p('EndGlobal')
+
 	end
 
 
 --
 
 	function sln2005.configurationPlatforms(sln)
-		-- build a VS cfg descriptor for each solution configuration
+
+		-- Build a VS cfg descriptor for each solution configuration.
+
 		local slncfg = {}
 		for cfg in solution.eachconfig(sln) do
 			local platform = vstudio.solutionPlatform(cfg)
 			slncfg[cfg] = string.format("%s|%s", cfg.buildcfg, platform)
 		end
 
+		-- Make a working list of each solution configuration, and sort it into
+		-- Visual Studio's desired ordering. If I don't this, Visual Studio will
+		-- reshuffle everything on the first save.
+
+		local sorted = {}
+		for cfg in solution.eachconfig(sln) do
+			table.insert(sorted, cfg)
+		end
+
+		table.sort(sorted, function(a,b)
+			return slncfg[a]:lower() < slncfg[b]:lower()
+		end)
+
+		-- Now use the sorted list to output the configuration maps.
+
 		_p(1,'GlobalSection(SolutionConfigurationPlatforms) = preSolution')
-		for cfg in solution.eachconfig(sln) do
+		table.foreachi(sorted, function (cfg)
 			_p(2,'%s = %s', slncfg[cfg], slncfg[cfg])
-		end
-		_p(1,'EndGlobalSection')
+		end)
+		_p(1,"EndGlobalSection")
 
-		_p(1,'GlobalSection(ProjectConfigurationPlatforms) = postSolution')
+		_p(1,"GlobalSection(ProjectConfigurationPlatforms) = postSolution")
 		local tr = solution.grouptree(sln)
 		tree.traverse(tr, {
 			onleaf = function(n)
 				local prj = n.project
 
-				for cfg in solution.eachconfig(sln) do
+				table.foreachi(sorted, function (cfg)
 					local prjcfg = project.getconfig(prj, cfg.buildcfg, cfg.platform)
 					if prjcfg then
 						local prjplatform
 						local architecture = prjcfg.platform or vstudio.architecture(prjcfg)
 
 						_p(2,'{%s}.%s.ActiveCfg = %s|%s', prj.uuid, slncfg[cfg], prjplatform, architecture)
-						_p(2,'{%s}.%s.Build.0 = %s|%s', prj.uuid, slncfg[cfg], prjplatform, architecture)
+						if prjcfg.kind ~= premake.NONE then
+							_p(2,'{%s}.%s.Build.0 = %s|%s', prj.uuid, slncfg[cfg], prjplatform, architecture)
+						end
 					end
-				end
+				end)
 			end
 		})
-		_p(1,'EndGlobalSection')
+		_p(1,"EndGlobalSection")
 	end
 
 

File src/actions/vstudio/vs2008.lua

 
 
 ---
--- Register a command-line action for Visual Studio 2008.
+-- Define the Visual Studio 2008 export action.
 ---
 
 	newaction {

File src/actions/vstudio/vs200x_vcproj.lua

 	local project = premake5.project
 
 
---
--- Generate a Visual Studio 200x C++ project, with support for the new platforms API.
---
+---
+-- Generate a Visual Studio 200x C++ or Makefile project.
+---
 
 	function vc200x.generate(prj)
-		io.eol = "\r\n"
 
 		vc200x.xmlElement()
 		vc200x.visualStudioProject(prj)
 
-		-- output the list of configuration/architecture pairs used by
-		-- the project; sends back list of unique architectures
+		-- Output the list of configuration/architecture pairs used by the project.
+		-- Returns the set of unique architectures, to be used in the configuration
+		-- enumeration loop below.
+
 		local architectures = vc200x.platforms(prj)
 
-		if _ACTION > "vs2003" then
-			_p(1,'<ToolFiles>')
-			_p(1,'</ToolFiles>')
-		end
+		vc200x.toolFiles(prj)
+
+		_p(1,'<Configurations>')
 
 		-- Visual Studio requires each configuration to be paired up with each
 		-- architecture, even if the pairing doesn't make any sense (i.e. Win32
-		-- DLL DCRT|PS3). I already have a list of all the unique architectures;
-		-- make a list of configuration-architecture pairs used by the project.
+		-- DLL DCRT|PS3). Start by finding the names of all of the configurations
+		-- that actually are in the project; I'll use this to help identify the
+		-- configurations that *aren't* in the project below.
+
 		local prjcfgs = {}
 		for cfg in project.eachconfig(prj) do
 			local cfgname = vstudio.projectConfig(cfg)
-			prjcfgs[cfgname] = cfgname
+			prjcfgs[cfgname] = true
 		end
 
-		_p(1,'<Configurations>')
+		-- Now enumerate all of the configurations in the project and write
+		-- out their <Configuration> blocks.
+
 		for cfg in project.eachconfig(prj) do
 			local prjcfg = vstudio.projectConfig(cfg)
+
+			-- Visual Studio wants the architectures listed in a specific
+			-- order, so enumerate them that way.
+
 			for _, arch in ipairs(architectures) do
 				local tstcfg = vstudio.projectConfig(cfg, arch)
+
+				-- Does this architecture match the one in the project config
+				-- that I'm trying to write? If so, go ahead and output the
+				-- full <Configuration> block.
+
 				if prjcfg == tstcfg then
 					-- this is a real project configuration
 					vc200x.configuration(cfg)
 					vc200x.tools(cfg)
 					_p(2,'</Configuration>')
+
+				-- Otherwise, check the list of valid configurations I built
+				-- earlier. If this configuration is in the list, then I will
+				-- get to it on another pass of this loop. If it is not in
+				-- the list, then it isn't really part of the project, and I
+				-- need to output a dummy configuration in its place.
+
 				elseif not prjcfgs[tstcfg] then
 					-- this is a fake config to make VS happy
 					vc200x.emptyConfiguration(cfg, arch)
 				end
+
 			end
 		end
+
 		_p(1,'</Configurations>')
 
 		_p(1,'<References>')
 		end
 
 		if isWin then
-			if _ACTION > "vs2003" and not isMakefile then
+
+			-- Technically, this should be skipped for pure makefile projects that
+			-- do not contain any empty configurations. But I need to figure out a
+			-- a good way to check the empty configuration bit first.
+
+			if _ACTION > "vs2003" then
 				_x(1,'RootNamespace="%s"', prj.name)
 			end
 
 		_p(3,'ConfigurationType="1"')
 		_p(3,'>')
 
-		local tools = vc200x.toolsForConfig(cfg)
+		local tools = vc200x.toolsForConfig(cfg, true)
 		for _, tool in ipairs(tools) do
 			vc200x.tool(tool)
 		end
 --
 ---------------------------------------------------------------------------
 
---
+---
 -- Return the list of tools required to build a specific configuration.
 -- Each tool gets represented by an XML element in the project file.
 --
+-- @param cfg
+--    The configuration being written.
+-- @param isEmptyCfg
+--    If true, the list is for the generation of an empty or dummy
+--    configuration block; in this case different rules apply.