diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2002-06-28 18:14:19 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2002-06-28 18:14:19 +0000 |
commit | 650ea028eface5e8f608f82c092fa6d70e9e1fd5 (patch) | |
tree | f39cf03193be950b3dc92a6f63f50deb7639ba3b | |
parent | 282821993b01cf1c1a7ba2670bb72f536cc34e9d (diff) | |
download | ATCD-650ea028eface5e8f608f82c092fa6d70e9e1fd5.tar.gz |
Use crlf() instead of hard coded \n or \r\n
4 files changed, 109 insertions, 68 deletions
diff --git a/bin/MakeProjectCreator/modules/GNUWorkspaceCreator.pm b/bin/MakeProjectCreator/modules/GNUWorkspaceCreator.pm index 98344ff3a9f..ca91b315eb2 100644 --- a/bin/MakeProjectCreator/modules/GNUWorkspaceCreator.pm +++ b/bin/MakeProjectCreator/modules/GNUWorkspaceCreator.pm @@ -32,11 +32,12 @@ sub workspace_file_name { sub pre_workspace { my($self) = shift; my($fh) = shift; + my($crlf) = $self->crlf(); - print $fh "#----------------------------------------------------------------------------\n" . - "# GNU Workspace\n" . - "#----------------------------------------------------------------------------\n" . - "\n"; + print $fh "#----------------------------------------------------------------------------$crlf" . + "# GNU Workspace$crlf" . + "#----------------------------------------------------------------------------$crlf" . + "$crlf"; } @@ -46,21 +47,22 @@ sub write_comps { my($projects) = $self->get_projects(); my($pjs) = $self->get_project_info(); my(@list) = $self->sort_dependencies($projects, $pjs); + my($crlf) = $self->crlf(); ## Print out the projet Makefile - print $fh "include \$(ACE_ROOT)/include/makeinclude/macros.GNU\n" . - "TARGETS_NESTED := \$(TARGETS_NESTED:.nested=)\n" . - "\n" . - "\$(TARGETS_NESTED):\n" . - "ifeq (Windows,\$(findstring Windows,\$(OS)))\n"; + print $fh "include \$(ACE_ROOT)/include/makeinclude/macros.GNU$crlf" . + "TARGETS_NESTED := \$(TARGETS_NESTED:.nested=)$crlf" . + "$crlf" . + "\$(TARGETS_NESTED):$crlf" . + "ifeq (Windows,\$(findstring Windows,\$(OS)))$crlf"; foreach my $project (@list) { - print $fh "\t\@cmd /c \"\$(MAKE) -f " . basename($project) . " -C " . dirname($project) . " \$(\@)\"\n"; + print $fh "\t\@cmd /c \"\$(MAKE) -f " . basename($project) . " -C " . dirname($project) . " \$(\@)\"$crlf"; } - print $fh "else\n"; + print $fh "else$crlf"; foreach my $project (@list) { - print $fh "\t\@\$(MAKE) -f " . basename($project) . " -C " . dirname($project) . " \$(\@);\n"; + print $fh "\t\@\$(MAKE) -f " . basename($project) . " -C " . dirname($project) . " \$(\@);$crlf"; } - print $fh "endif\n"; + print $fh "endif$crlf"; } diff --git a/bin/MakeProjectCreator/modules/NMakeWorkspaceCreator.pm b/bin/MakeProjectCreator/modules/NMakeWorkspaceCreator.pm index 1068aa48319..5fe12db7915 100644 --- a/bin/MakeProjectCreator/modules/NMakeWorkspaceCreator.pm +++ b/bin/MakeProjectCreator/modules/NMakeWorkspaceCreator.pm @@ -24,6 +24,17 @@ use vars qw(@ISA); # ************************************************************ +sub crlf { + my($self) = shift; + if ($^O eq 'MSWin32') { + return "\n"; + } + else { + return "\r\n"; + } +} + + sub workspace_file_name { my($self) = shift; return "Makefile"; @@ -33,8 +44,9 @@ sub workspace_file_name { sub pre_workspace { my($self) = shift; my($fh) = shift; + my($crlf) = $self->crlf(); - print $fh "# Microsoft Developer Studio Generated NMAKE File\r\n\r\n"; + print $fh "# Microsoft Developer Studio Generated NMAKE File$crlf$crlf"; } @@ -44,8 +56,9 @@ sub write_comps { my($projects) = $self->get_projects(); my($pjs) = $self->get_project_info(); my(@list) = $self->sort_dependencies($projects, $pjs); + my($crlf) = $self->crlf(); - print $fh "ALL:\r\n"; + print $fh "ALL:$crlf"; foreach my $project (@list) { my($dir) = dirname($project); my($chdir) = 0; @@ -65,8 +78,8 @@ sub write_comps { ## These commands will work. In practicality, only the ## default configuration can be built at the top level. - print $fh ($chdir ? "\tcd $dir\r\n" : "") . - "\t\$(MAKE) /f " . basename($project) . " CFG=\"\$(CFG)\"\r\n" . + print $fh ($chdir ? "\tcd $dir$crlf" : "") . + "\t\$(MAKE) /f " . basename($project) . " CFG=\"\$(CFG)\"$crlf" . ($chdir ? "\tcd " . ("../" x $back) : ""); } } diff --git a/bin/MakeProjectCreator/modules/VC6WorkspaceCreator.pm b/bin/MakeProjectCreator/modules/VC6WorkspaceCreator.pm index 288695f3054..19edc836b06 100644 --- a/bin/MakeProjectCreator/modules/VC6WorkspaceCreator.pm +++ b/bin/MakeProjectCreator/modules/VC6WorkspaceCreator.pm @@ -23,6 +23,17 @@ use vars qw(@ISA); # ************************************************************ +sub crlf { + my($self) = shift; + if ($^O eq 'MSWin32') { + return "\n"; + } + else { + return "\r\n"; + } +} + + sub workspace_file_name { my($self) = shift; return $self->get_workspace_name() . ".dsw"; @@ -32,10 +43,11 @@ sub workspace_file_name { sub pre_workspace { my($self) = shift; my($fh) = shift; + my($crlf) = $self->crlf(); - print $fh "Microsoft Developer Studio Workspace File, Format Version 6.00\r\n" . - "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r\n" . - "\r\n"; + print $fh "Microsoft Developer Studio Workspace File, Format Version 6.00$crlf" . + "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!$crlf" . + "$crlf"; } @@ -44,6 +56,7 @@ sub write_comps { my($fh) = shift; my($projects) = $self->get_projects(); my($pjs) = $self->get_project_info(); + my($crlf) = $self->crlf(); foreach my $project (@$projects) { my($pi) = $$pjs{$project}; @@ -52,31 +65,31 @@ sub write_comps { ## Convert all /'s to \ $project =~ s/\//\\/g; - print $fh "###############################################################################\r\n" . - "\r\n" . - "Project: \"$name\"=$project - Package Owner=<4>\r\n" . - "\r\n" . - "Package=<5>\r\n" . - "{{{\r\n" . - "}}}\r\n" . - "\r\n" . - "Package=<4>\r\n" . - "{{{\r\n"; + print $fh "###############################################################################$crlf" . + "$crlf" . + "Project: \"$name\"=$project - Package Owner=<4>$crlf" . + "$crlf" . + "Package=<5>$crlf" . + "{{{$crlf" . + "}}}$crlf" . + "$crlf" . + "Package=<4>$crlf" . + "{{{$crlf"; if (defined $deps && $deps ne "") { my($darr) = $self->create_array($deps); foreach my $dep (@$darr) { ## Avoid cirular dependencies if ($name ne $dep) { - print $fh " Begin Project Dependency\r\n" . - " Project_Dep_Name $dep\r\n" . - " End Project Dependency\r\n"; + print $fh " Begin Project Dependency$crlf" . + " Project_Dep_Name $dep$crlf" . + " End Project Dependency$crlf"; } } } - print $fh "}}}\r\n" . - "\r\n"; + print $fh "}}}$crlf" . + "$crlf"; } } @@ -85,20 +98,20 @@ sub post_workspace { my($self) = shift; my($fh) = shift; - print $fh "###############################################################################\r\n" . - "\r\n" . - "Global:\r\n" . - "\r\n" . - "Package=<5>\r\n" . - "{{{\r\n" . - "}}}\r\n" . - "\r\n" . - "Package=<3>\r\n" . - "{{{\r\n" . - "}}}\r\n" . - "\r\n" . - "###############################################################################\r\n" . - "\r\n"; + print $fh "###############################################################################$crlf" . + "$crlf" . + "Global:$crlf" . + "$crlf" . + "Package=<5>$crlf" . + "{{{$crlf" . + "}}}$crlf" . + "$crlf" . + "Package=<3>$crlf" . + "{{{$crlf" . + "}}}$crlf" . + "$crlf" . + "###############################################################################$crlf" . + "$crlf"; } diff --git a/bin/MakeProjectCreator/modules/VC7WorkspaceCreator.pm b/bin/MakeProjectCreator/modules/VC7WorkspaceCreator.pm index 8d6c58c546d..f4c074f00f7 100644 --- a/bin/MakeProjectCreator/modules/VC7WorkspaceCreator.pm +++ b/bin/MakeProjectCreator/modules/VC7WorkspaceCreator.pm @@ -24,6 +24,17 @@ use vars qw(@ISA); # ************************************************************ +sub crlf { + my($self) = shift; + if ($^O eq 'MSWin32') { + return "\n"; + } + else { + return "\r\n"; + } +} + + sub workspace_file_name { my($self) = shift; return $self->get_workspace_name() . ".sln"; @@ -33,8 +44,9 @@ sub workspace_file_name { sub pre_workspace { my($self) = shift; my($fh) = shift; + my($crlf) = $self->crlf(); - print $fh "Microsoft Visual Studio Solution File, Format Version 7.00\r\n"; + print $fh "Microsoft Visual Studio Solution File, Format Version 7.00$crlf"; } @@ -46,6 +58,7 @@ sub write_comps { my($ggen) = new GUID(); my($guid) = $ggen->generate($self->workspace_file_name()); my($pjs) = $self->get_project_info(); + my($crlf) = $self->crlf(); ## Project Information foreach my $project (@$projects) { @@ -55,13 +68,13 @@ sub write_comps { ## Convert all /'s to \ my($cpy) = $project; $cpy =~ s/\//\\/g; - print $fh "Project(\"{$guid}\") = \"$name\", \"$cpy\", \"{$pguid}\"\r\n" . - "EndProject\r\n"; + print $fh "Project(\"{$guid}\") = \"$name\", \"$cpy\", \"{$pguid}\"$crlf" . + "EndProject$crlf"; } ## Project Configurations - print $fh "Global\r\n" . - " GlobalSection(SolutionConfiguration) = preSolution\r\n"; + print $fh "Global$crlf" . + " GlobalSection(SolutionConfiguration) = preSolution$crlf"; my(%configs) = (); foreach my $project (@$projects) { @@ -74,13 +87,13 @@ sub write_comps { } my($count) = 0; foreach my $key (sort keys %configs) { - print $fh " ConfigName.$count = $key\r\n"; + print $fh " ConfigName.$count = $key$crlf"; $count++; } ## Project Dependencies - print $fh " EndGlobalSection\r\n" . - " GlobalSection(ProjectDependencies) = postSolution\r\n"; + print $fh " EndGlobalSection$crlf" . + " GlobalSection(ProjectDependencies) = postSolution$crlf"; foreach my $project (@$projects) { my($pi) = $$pjs{$project}; my($name, $deps, $pguid) = @$pi; @@ -93,14 +106,14 @@ sub write_comps { $val = $dep; } if ($pguid ne $val) { - print $fh " {$pguid}.$i = {$val}\r\n"; + print $fh " {$pguid}.$i = {$val}$crlf"; $i++; } } } } - print $fh " EndGlobalSection\r\n" . - " GlobalSection(ProjectConfiguration) = postSolution\r\n"; + print $fh " EndGlobalSection$crlf" . + " GlobalSection(ProjectConfiguration) = postSolution$crlf"; ## Project Configuration Names foreach my $project (@$projects) { @@ -109,16 +122,16 @@ sub write_comps { foreach my $cfg (@cfgs) { my($c) = $cfg; $c =~ s/\|.*//; - print $fh " {$pguid}.$c.ActiveCfg = $cfg\r\n" . - " {$pguid}.$c.Build.0 = $cfg\r\n"; + print $fh " {$pguid}.$c.ActiveCfg = $cfg$crlf" . + " {$pguid}.$c.Build.0 = $cfg$crlf"; } } - print $fh " EndGlobalSection\r\n" . - " GlobalSection(ExtensibilityGlobals) = postSolution\r\n" . - " EndGlobalSection\r\n" . - " GlobalSection(ExtensibilityAddIns) = postSolution\r\n" . - " EndGlobalSection\r\n" . - "EndGlobal\r\n"; + print $fh " EndGlobalSection$crlf" . + " GlobalSection(ExtensibilityGlobals) = postSolution$crlf" . + " EndGlobalSection$crlf" . + " GlobalSection(ExtensibilityAddIns) = postSolution$crlf" . + " EndGlobalSection$crlf" . + "EndGlobal$crlf"; } |