ppremake 1.20, introducing #output

This commit is contained in:
David Rose 2006-04-20 04:04:47 +00:00
parent 57338ee24d
commit 4062b2c939
7 changed files with 98 additions and 27 deletions

View File

@ -86,5 +86,5 @@
** Also be sure to change the version number ** ** Also be sure to change the version number **
** at the beginning of configure.in. ** ** at the beginning of configure.in. **
**************** ****************/ **************** ****************/
#define VERSION "1.19" #define VERSION "1.20"
/**************** UPDATE VERSION NUMBER HERE ****************/ /**************** UPDATE VERSION NUMBER HERE ****************/

View File

@ -5,7 +5,7 @@ dnl **************** UPDATE VERSION NUMBER HERE ****************
dnl ** Also be sure to change the version number ** dnl ** Also be sure to change the version number **
dnl ** at the end of config_msvc.h. ** dnl ** at the end of config_msvc.h. **
dnl **************** **************** dnl **************** ****************
AM_INIT_AUTOMAKE(ppremake, 1.19) AM_INIT_AUTOMAKE(ppremake, 1.20)
dnl **************** UPDATE VERSION NUMBER HERE **************** dnl **************** UPDATE VERSION NUMBER HERE ****************
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)

View File

@ -665,6 +665,9 @@ handle_command(const string &line) {
} else if (_command == "sinclude") { } else if (_command == "sinclude") {
return handle_sinclude_command(); return handle_sinclude_command();
} else if (_command == "copy") {
return handle_copy_command();
} else if (_command == "call") { } else if (_command == "call") {
return handle_call_command(); return handle_call_command();
@ -1404,6 +1407,56 @@ handle_sinclude_command() {
return include_file(filename); return include_file(filename);
} }
////////////////////////////////////////////////////////////////////
// Function: PPCommandFile::handle_copy_command
// Access: Protected
// Description: Handles the #copy command: the indicated file is
// read and output at this point. This is useful for
// inserting within an #output sequence, to copy the
// contents of some file into the target file.
////////////////////////////////////////////////////////////////////
bool PPCommandFile::
handle_copy_command() {
string filename = trim_blanks(_scope->expand_string(_params));
// We allow optional quotation marks around the filename.
if (filename.length() >= 2 &&
filename[0] == '"' &&
filename[filename.length() - 1] == '"') {
filename = filename.substr(1, filename.length() - 2);
}
Filename fn(filename);
fn.set_text();
ifstream in;
if (!fn.open_read(in)) {
cerr << "Unable to open copy file " << fn << ".\n";
errors_occurred = true;
return false;
}
if (verbose) {
cerr << "Reading (copy) \"" << fn << "\"\n";
}
string line;
getline(in, line);
while (!in.fail() && !in.eof()) {
if (!_write_state->write_line(line)) {
return false;
}
getline(in, line);
}
if (!in.eof()) {
cerr << "Error reading " << fn << ".\n";
errors_occurred = true;
return false;
}
return true;
}
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: PPCommandFile::handle_call_command // Function: PPCommandFile::handle_call_command
// Access: Protected // Access: Protected

View File

@ -59,6 +59,7 @@ protected:
bool handle_printvar_command(); bool handle_printvar_command();
bool handle_include_command(); bool handle_include_command();
bool handle_sinclude_command(); bool handle_sinclude_command();
bool handle_copy_command();
bool handle_call_command(); bool handle_call_command();
bool handle_error_command(); bool handle_error_command();
bool handle_mkdir_command(); bool handle_mkdir_command();

View File

@ -10,6 +10,7 @@
#include "ppCommandFile.h" #include "ppCommandFile.h"
#include "ppDependableFile.h" #include "ppDependableFile.h"
#include "tokenize.h" #include "tokenize.h"
#include "ppremake.h"
#ifdef HAVE_DIRENT_H #ifdef HAVE_DIRENT_H
#include <dirent.h> #include <dirent.h>
@ -365,9 +366,10 @@ get_dependable_file(const string &filename, bool is_header) {
if (_tree != main_tree && if (_tree != main_tree &&
other->get_directory()->get_tree() != main_tree) { other->get_directory()->get_tree() != main_tree) {
// Both files are in external dependable trees. // Both files are in external dependable trees.
cerr << "Warning: header file " << dependable->get_fullpath() cerr << "Error: header file " << dependable->get_fullpath()
<< " may be confused with " << other->get_fullpath() << " may be confused with " << other->get_fullpath()
<< ".\n"; << ".\n";
errors_occurred = true;
} else if (other->get_directory()->get_tree() != _tree) { } else if (other->get_directory()->get_tree() != _tree) {
// This file is a source file in this tree, while the other // This file is a source file in this tree, while the other
@ -377,9 +379,10 @@ get_dependable_file(const string &filename, bool is_header) {
} else { } else {
// Both files are within the same source tree. // Both files are within the same source tree.
cerr << "Warning: source file " << dependable->get_pathname() cerr << "Error: source file " << dependable->get_pathname()
<< " may be confused with " << other->get_pathname() << " may be confused with " << other->get_pathname()
<< ".\n"; << ".\n";
errors_occurred = true;
} }
} }
} }

View File

@ -1,12 +1,12 @@
Microsoft Visual Studio Solution File, Format Version 7.00 Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ppremake", "ppremake.vcproj", "{B2B6A5F5-4403-4386-9294-B10EE8B0B3E8}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ppremake", "ppremake.vcproj", "{B2B6A5F5-4403-4386-9294-B10EE8B0B3E8}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug Debug = Debug
ConfigName.1 = Release Release = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution GlobalSection(ProjectConfiguration) = postSolution
{B2B6A5F5-4403-4386-9294-B10EE8B0B3E8}.Debug.ActiveCfg = Debug|Win32 {B2B6A5F5-4403-4386-9294-B10EE8B0B3E8}.Debug.ActiveCfg = Debug|Win32

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.00" Version="7.10"
Name="ppremake" Name="ppremake"
ProjectGUID="{B2B6A5F5-4403-4386-9294-B10EE8B0B3E8}" ProjectGUID="{B2B6A5F5-4403-4386-9294-B10EE8B0B3E8}"
Keyword="CustomAppWizProj"> Keyword="CustomAppWizProj">
@ -32,8 +32,14 @@
Name="VCResourceCompilerTool"/> Name="VCResourceCompilerTool"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
@ -57,10 +63,18 @@
Name="VCResourceCompilerTool"/> Name="VCResourceCompilerTool"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
</Configurations> </Configurations>
<References>
</References>
<Files> <Files>
<Filter <Filter
Name="Template Files" Name="Template Files"
@ -87,9 +101,6 @@
<Filter <Filter
Name="Miscellaneous Files" Name="Miscellaneous Files"
Filter="vsz;vsdir;ico;vcproj;csproj;css;inf"> Filter="vsz;vsdir;ico;vcproj;csproj;css;inf">
<File
RelativePath="Templates\1033\Templates.inf">
</File>
<File <File
RelativePath="default.vcproj"> RelativePath="default.vcproj">
</File> </File>
@ -102,6 +113,9 @@
<File <File
RelativePath="ppremake.vsz"> RelativePath="ppremake.vsz">
</File> </File>
<File
RelativePath="Templates\1033\Templates.inf">
</File>
</Filter> </Filter>
<File <File
RelativePath="check_include.cxx"> RelativePath="check_include.cxx">
@ -112,24 +126,21 @@
<File <File
RelativePath="config_msvc.h"> RelativePath="config_msvc.h">
</File> </File>
<File
RelativePath="dSearchPath.I">
</File>
<File <File
RelativePath="dSearchPath.cxx"> RelativePath="dSearchPath.cxx">
</File> </File>
<File <File
RelativePath="dSearchPath.h"> RelativePath="dSearchPath.h">
</File> </File>
<File
RelativePath="dSearchPath.I">
</File>
<File <File
RelativePath="executionEnvironment.cxx"> RelativePath="executionEnvironment.cxx">
</File> </File>
<File <File
RelativePath="executionEnvironment.h"> RelativePath="executionEnvironment.h">
</File> </File>
<File
RelativePath="filename.I">
</File>
<File <File
RelativePath="filename.cxx"> RelativePath="filename.cxx">
</File> </File>
@ -137,7 +148,7 @@
RelativePath="filename.h"> RelativePath="filename.h">
</File> </File>
<File <File
RelativePath="globPattern.I"> RelativePath="filename.I">
</File> </File>
<File <File
RelativePath="globPattern.cxx"> RelativePath="globPattern.cxx">
@ -145,6 +156,9 @@
<File <File
RelativePath="globPattern.h"> RelativePath="globPattern.h">
</File> </File>
<File
RelativePath="globPattern.I">
</File>
<File <File
RelativePath="gnu_getopt.c"> RelativePath="gnu_getopt.c">
</File> </File>
@ -205,6 +219,12 @@
<File <File
RelativePath="ppNamedScopes.h"> RelativePath="ppNamedScopes.h">
</File> </File>
<File
RelativePath="ppremake.cxx">
</File>
<File
RelativePath="ppremake.h">
</File>
<File <File
RelativePath="ppScope.cxx"> RelativePath="ppScope.cxx">
</File> </File>
@ -217,12 +237,6 @@
<File <File
RelativePath="ppSubroutine.h"> RelativePath="ppSubroutine.h">
</File> </File>
<File
RelativePath="ppremake.cxx">
</File>
<File
RelativePath="ppremake.h">
</File>
<File <File
RelativePath="sedAddress.cxx"> RelativePath="sedAddress.cxx">
</File> </File>