#include "NMakefile.hpp"

#include <configure/Build.hpp>
#include <configure/Filesystem.hpp>
#include <configure/quote.hpp>
#include <configure/Node.hpp>

namespace configure { namespace generators {

	bool NMakefile::is_available(Build& build)
	{
		return build.fs().which("nmake") != boost::none;
	}

	std::string NMakefile::dump_command(std::vector<std::string> const& cmd) const
	{ return quote<CommandParser::nmake>(cmd); }

	std::vector<std::string>
	NMakefile::build_command(std::string const& target) const
	{
		return {
			"nmake", "-nologo", "-f", (_build.directory() / "Makefile").string(),
			target.empty() ? "all" : target
		};
	}

	bool NMakefile::use_relative_path() const { return false; }

	void NMakefile::include_dependencies(std::ostream& out, bool /* XXX relative */) const
	{
		for (auto& node: _includes)
			out
				<< "!IF EXISTS(" << node->path().string() << ")" << std::endl
				<< "  !INCLUDE " << node->path().string() << std::endl
				<< "!ENDIF" << std::endl;
	}

}}

#include "NMakefile.hpp"

#include <configure/Build.hpp>
#include <configure/Filesystem.hpp>
#include <configure/quote.hpp>
#include <configure/Node.hpp>

namespace configure { namespace generators {

	bool NMakefile::is_available(Build& build)
	{
		return build.fs().which("nmake") != boost::none;
	}

	std::string NMakefile::dump_command(std::vector<std::string> const& cmd) const
	{ return quote<CommandParser::nmake>(cmd); }

	std::vector<std::string>
	NMakefile::build_command(std::string const& target) const
	{
		return {
			"nmake", "-nologo", "-f", (_build.directory() / "Makefile").string(),
			target.empty() ? "all" : target
		};
	}

	bool NMakefile::use_relative_path() const { return false; }

	void NMakefile::include_dependencies(std::ostream& out, bool /* XXX relative */) const
	{
		for (auto& node: _includes)
			out << "!include " << node->path().string() << std::endl;
	}

}}

--- 
+++ 
@@ -29,7 +29,10 @@
 	void NMakefile::include_dependencies(std::ostream& out, bool /* XXX relative */) const
 	{
 		for (auto& node: _includes)
-			out << "!include " << node->path().string() << std::endl;
+			out
+				<< "!IF EXISTS(" << node->path().string() << ")" << std::endl
+				<< "  !INCLUDE " << node->path().string() << std::endl
+				<< "!ENDIF" << std::endl;
 	}
 
 }}
Check that include files exists in nmakefiles.
