summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2005-03-07 16:09:55 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2005-03-07 16:09:55 +0000
commitbfb9241b0fdf1697de837a9c6152954b375bec39 (patch)
tree69efc0b975c67e09a6ab5056d83c3ab8e566c986
parent03163e463d76ac155b89c68b43a49917da1c652e (diff)
downloadMPC-bfb9241b0fdf1697de837a9c6152954b375bec39.tar.gz
ChangeLogTag: Mon Mar 7 10:01:34 2005 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog22
-rw-r--r--README35
-rw-r--r--modules/ProjectCreator.pm42
-rw-r--r--templates/em3.mpd6
-rw-r--r--templates/em3vcp.mpd6
-rw-r--r--templates/ghs.mpd3
-rw-r--r--templates/vc6.mpd6
-rw-r--r--templates/vc6dsp.mpd6
-rw-r--r--templates/vc7.mpd10
9 files changed, 113 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index c61dde4a..292bb71e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+Mon Mar 7 10:01:34 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * README:
+
+ Documented both changes below.
+
+ * modules/ProjectCreator.pm:
+
+ Added a new operator, '>>' to allow user to specify multiple
+ unrelated (file name wise) output files based on a custom input
+ file.
+
+ * templates/em3vcp.mpd:
+ * templates/ghs.mpd:
+ * templates/vc6dsp.mpd:
+ * templates/vc7.mpd:
+
+ If a custom defintion does not have an output extension specified,
+ you can list custom input files, but they will not be compiled
+ or processed. In the above graphical tools they will be
+ listed/displayed and excluded from the build.
+
Fri Mar 4 12:03:48 2005 Chad Elliott <elliott_c@ociweb.com>
* config/boost_regex.mpb:
diff --git a/README b/README
index 8b83a697..9a7913f5 100644
--- a/README
+++ b/README
@@ -436,6 +436,33 @@ generic_outputext If the command does not generate any of the other output
types listed above, then the extensions should be listed
under this.
+If the custom output can not be represented with the above output extension
+keywords (*_outputext) and you have knowlege of the output files a priori,
+you can represent them with the '>>' construct.
+
+Below is an example that demonstrates the use of '>>'. The command takes an
+input file name of foo.prp and produces two files that have a completely
+unrelated filename (i.e. foo !~ hello).
+
+project {
+ Define_Custom(Quogen) {
+ automatic = 0
+ command = perl quogen.pl
+ commandflags = --debuglevel=1 --language=c++ \
+ --kernel_language=c++
+ inputext = .prp
+ keyword quogenflags = commandflags
+ }
+
+ Quogen_Files {
+ foo.prp >> hello.h hello.cpp
+ }
+
+ Source_Files {
+ hello.cpp
+ }
+}
+
There is a new construct that can be used within a Define_Custom section.
It is called 'optional' and can be used to represent optional custom output
dependent upon particular command line parameters passed to the custom
@@ -471,10 +498,10 @@ optional clause can be read as follows: If 'commandflags' contains -GA then
add A to source_pre_extension.
Particular output extensions are not required. However at least one output
-extension type is required in order for MPC to generate a target. Your
-command doesn't necessarily have to generate output, but an extension type
-is none the less required. In this case, it's best to use
-generic_outputext.
+extension type is required in order for MPC to generate a target. Within
+graphical build environments, the custom input file will be listed
+regardless of the presence of an extension definition. In this case, the
+input file will be "excluded" from the build.
For custom file types, there are a few keywords that can be used within the
custom file type input lists: command, commandflags, dependent, gendir and
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index ecb88ff8..66a987d1 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -256,6 +256,7 @@ sub new {
$self->{'lib_template_input'} = undef;
$self->{'dll_template_input'} = undef;
$self->{'flag_overrides'} = {};
+ $self->{'custom_special_output'} = {};
$self->{'special_supplied'} = {};
$self->{'pctype'} = $self->extractType("$self");
$self->{'verbatim'} = {};
@@ -572,14 +573,15 @@ sub parse_line {
$self->restore_state($self->{'addtemp_state'}, 'addtemp');
$self->{'addtemp_state'} = undef;
}
- $self->{'assign'} = {};
- $self->{'verbatim'} = {};
- $self->{'verbatim_accessed'} = {$self->{'pctype'} => {}};
- $self->{'special_supplied'} = {};
- $self->{'flag_overrides'} = {};
- $self->{'parents_read'} = {};
- $self->{'inheritance_tree'} = {};
- $self->{'remove_files'} = {};
+ $self->{'assign'} = {};
+ $self->{'verbatim'} = {};
+ $self->{'verbatim_accessed'} = {$self->{'pctype'} => {}};
+ $self->{'special_supplied'} = {};
+ $self->{'flag_overrides'} = {};
+ $self->{'parents_read'} = {};
+ $self->{'inheritance_tree'} = {};
+ $self->{'remove_files'} = {};
+ $self->{'custom_special_output'} = {};
$self->reset_generating_types();
}
}
@@ -869,6 +871,13 @@ sub process_component_line {
$line =~ s/\\/\//g;
}
+ ## Now look for specially listed files
+ if ($line =~ /(.*)\s+>>\s+(.*)/) {
+ $line = $1;
+ my(@extra) = split(/\s+/, $2);
+ $self->{'custom_special_output'}->{$line} = \@extra;
+ }
+
## Set up the files array. If the line contains a wild card
## character use CORE::glob() to get the files specified.
my(@files) = ();
@@ -3154,11 +3163,28 @@ sub get_custom_value {
$ainput =~ s/\\/\//g;
}
+ ## Add all of the output files
foreach my $vc (keys %{$self->{'valid_components'}}, $generic_key) {
push(@outputs,
$self->check_custom_output($based, $cinput,
$ainput, $vc, $vcomps{$vc}));
}
+
+ ## Add specially listed files avoiding duplicates
+ if (defined $self->{'custom_special_output'}->{$ainput}) {
+ foreach my $file (@{$self->{'custom_special_output'}->{$ainput}}) {
+ my($found) = 0;
+ foreach my $output (@outputs) {
+ if ($output eq $file) {
+ $found = 1;
+ last;
+ }
+ }
+ if (!$found) {
+ push(@outputs, $file);
+ }
+ }
+ }
$self->{'custom_output_files'}->{$input} = \@outputs;
}
}
diff --git a/templates/em3.mpd b/templates/em3.mpd
index 2b8223f8..20482f77 100644
--- a/templates/em3.mpd
+++ b/templates/em3.mpd
@@ -282,10 +282,10 @@ SOURCE="<%resource_file%>"
# PROP Default_Filter "<%foreach(custom_type->inputexts)%><%custom_type->inputext%><%fornotlast(";")%><%endfor%>"
<%foreach(custom_type->input_files)%>
-<%if(custom_type->input_file->output_files)%>
# Begin Source File
SOURCE="<%custom_type->input_file%>"
+<%if(custom_type->input_file->output_files)%>
<%foreach(platforms)%>
<%foreach(configurations)%>
@@ -341,8 +341,10 @@ BuildCmds= \
!ENDIF
<%endfor%>
-# End Source File
+<%else%>
+# PROP Exclude_From_Build 1
<%endif%>
+# End Source File
<%endfor%>
# End Group
<%endif%>
diff --git a/templates/em3vcp.mpd b/templates/em3vcp.mpd
index 2b8223f8..20482f77 100644
--- a/templates/em3vcp.mpd
+++ b/templates/em3vcp.mpd
@@ -282,10 +282,10 @@ SOURCE="<%resource_file%>"
# PROP Default_Filter "<%foreach(custom_type->inputexts)%><%custom_type->inputext%><%fornotlast(";")%><%endfor%>"
<%foreach(custom_type->input_files)%>
-<%if(custom_type->input_file->output_files)%>
# Begin Source File
SOURCE="<%custom_type->input_file%>"
+<%if(custom_type->input_file->output_files)%>
<%foreach(platforms)%>
<%foreach(configurations)%>
@@ -341,8 +341,10 @@ BuildCmds= \
!ENDIF
<%endfor%>
-# End Source File
+<%else%>
+# PROP Exclude_From_Build 1
<%endif%>
+# End Source File
<%endfor%>
# End Group
<%endif%>
diff --git a/templates/ghs.mpd b/templates/ghs.mpd
index 716dbc22..c0a5ea68 100644
--- a/templates/ghs.mpd
+++ b/templates/ghs.mpd
@@ -47,6 +47,9 @@ default:
:preexec=<mv("mv -f")%> temporary.src <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>
<%endfor%>
<%endif%>
+<%else%>
+<%custom_type->input_file%>
+ documentation
<%endif%>
<%endfor%>
<%endfor%>
diff --git a/templates/vc6.mpd b/templates/vc6.mpd
index 8cddab58..e8034495 100644
--- a/templates/vc6.mpd
+++ b/templates/vc6.mpd
@@ -273,10 +273,10 @@ SOURCE="<%resource_file%>"
# PROP Default_Filter "<%foreach(custom_type->inputexts)%><%custom_type->inputext%><%fornotlast(";")%><%endfor%>"
<%foreach(custom_type->input_files)%>
-<%if(custom_type->input_file->output_files)%>
# Begin Source File
SOURCE="<%custom_type->input_file%>"
+<%if(custom_type->input_file->output_files)%>
<%foreach(configurations)%>
!<%fornotfirst("ELSE")%>IF "$(CFG)" == "<%project_name%> - <%platform%> <%configuration%>"
@@ -330,8 +330,10 @@ BuildCmds= \
<%endfor%>
!ENDIF
-# End Source File
+<%else%>
+# PROP Exclude_From_Build 1
<%endif%>
+# End Source File
<%endfor%>
# End Group
<%endif%>
diff --git a/templates/vc6dsp.mpd b/templates/vc6dsp.mpd
index 8cddab58..e8034495 100644
--- a/templates/vc6dsp.mpd
+++ b/templates/vc6dsp.mpd
@@ -273,10 +273,10 @@ SOURCE="<%resource_file%>"
# PROP Default_Filter "<%foreach(custom_type->inputexts)%><%custom_type->inputext%><%fornotlast(";")%><%endfor%>"
<%foreach(custom_type->input_files)%>
-<%if(custom_type->input_file->output_files)%>
# Begin Source File
SOURCE="<%custom_type->input_file%>"
+<%if(custom_type->input_file->output_files)%>
<%foreach(configurations)%>
!<%fornotfirst("ELSE")%>IF "$(CFG)" == "<%project_name%> - <%platform%> <%configuration%>"
@@ -330,8 +330,10 @@ BuildCmds= \
<%endfor%>
!ENDIF
-# End Source File
+<%else%>
+# PROP Exclude_From_Build 1
<%endif%>
+# End Source File
<%endfor%>
# End Group
<%endif%>
diff --git a/templates/vc7.mpd b/templates/vc7.mpd
index 1686a809..ec5bb9ed 100644
--- a/templates/vc7.mpd
+++ b/templates/vc7.mpd
@@ -233,12 +233,16 @@
Name="<%ucw(custom_type)%>"
Filter="<%foreach(custom_type->inputexts)%><%custom_type->inputext%><%fornotlast(";")%><%endfor%>">
<%foreach(custom_type->input_files)%>
-<%if(custom_type->input_file->output_files)%>
<File
RelativePath="<%custom_type->input_file%>">
<%foreach(configurations)%>
<FileConfiguration
- Name="<%configuration%>|<%platform%>">
+ Name="<%configuration%>|<%platform%>"
+<%if(!custom_type->input_file->output_files)%>
+ ExcludedFromBuild="TRUE"
+<%endif%>
+ >
+<%if(custom_type->input_file->output_files)%>
<Tool
Name="VCCustomBuildTool"
Description="Invoking <%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> on <%custom_type->input_file%>"
@@ -251,10 +255,10 @@
<%endif%>
<%endif%>
Outputs="<%foreach(custom_type->input_file->output_files)%><%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%fornotlast(";")%><%endfor%>"/>
+<%endif%>
</FileConfiguration>
<%endfor%>
</File>
-<%endif%>
<%endfor%>
</Filter>
<%endif%>