Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
4b20a7ad
Commit
4b20a7ad
authored
Oct 15, 2004
by
Brad King
Browse files
ENH: Added generation of rule to build object file.
parent
39f112b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/cmLocalUnixMakefileGenerator2.cxx
View file @
4b20a7ad
...
...
@@ -106,7 +106,7 @@ void cmLocalUnixMakefileGenerator2::GenerateMakefile()
{
std
::
vector
<
std
::
string
>
depends
;
std
::
vector
<
std
::
string
>
commands
;
//
commands.push_back(runRule);
commands
.
push_back
(
runRule
);
commands
.
push_back
(
depRule
);
commands
.
push_back
(
allRule
);
this
->
OutputMakeRule
(
...
...
@@ -343,6 +343,46 @@ cmLocalUnixMakefileGenerator2
this
->
OutputMakeRule
(
ruleFileStream
,
depComment
.
c_str
(),
depTarget
.
c_str
(),
depends
,
commands
);
}
// Write the requires rule.
{
std
::
vector
<
std
::
string
>
depends
;
std
::
vector
<
std
::
string
>
commands
;
std
::
string
reqComment
=
"requirements for "
;
reqComment
+=
target
.
GetName
();
std
::
string
reqTarget
=
target
.
GetName
();
reqTarget
+=
".requires"
;
for
(
std
::
vector
<
std
::
string
>::
const_iterator
obj
=
objects
.
begin
();
obj
!=
objects
.
end
();
++
obj
)
{
depends
.
push_back
(
*
obj
);
}
depends
.
push_back
(
ruleFileName
);
this
->
OutputMakeRule
(
ruleFileStream
,
reqComment
.
c_str
(),
reqTarget
.
c_str
(),
depends
,
commands
);
}
#if 0
// Write the build rule.
{
std::vector<std::string> depends;
std::vector<std::string> commands;
std::string buildComment = " target ";
buildComment += objName;
for(std::vector<std::string>::const_iterator obj = objects.begin();
obj != objects.end(); ++obj)
{
depends.push_back(*obj);
}
depends.push_back(ruleFileName);
std::string touchCmd = "@touch ";
touchCmd += this->ConvertToRelativeOutputPath(obj.c_str());
// TODO: Construct build rule and append command.
commands.push_back(touchCmd);
this->OutputMakeRule(ruleFileStream, buildComment.c_str(), obj.c_str(),
depends, commands);
}
#endif
}
//----------------------------------------------------------------------------
...
...
@@ -398,13 +438,13 @@ cmLocalUnixMakefileGenerator2
<<
"
\n\n
"
;
// Write the dependency generation rule.
std
::
string
depTarget
=
obj
;
depTarget
+=
".depends"
;
{
std
::
vector
<
std
::
string
>
depends
;
std
::
vector
<
std
::
string
>
commands
;
std
::
string
depComment
=
"dependencies for "
;
depComment
+=
objName
;
std
::
string
depTarget
=
obj
;
depTarget
+=
".depends"
;
depends
.
push_back
(
source
.
GetFullPath
());
depends
.
push_back
(
ruleFileName
);
std
::
string
touchCmd
=
"@touch "
;
...
...
@@ -414,6 +454,22 @@ cmLocalUnixMakefileGenerator2
this
->
OutputMakeRule
(
ruleFileStream
,
depComment
.
c_str
(),
depTarget
.
c_str
(),
depends
,
commands
);
}
// Write the build rule.
{
std
::
vector
<
std
::
string
>
depends
;
std
::
vector
<
std
::
string
>
commands
;
std
::
string
buildComment
=
"object "
;
buildComment
+=
objName
;
depends
.
push_back
(
depTarget
);
depends
.
push_back
(
ruleFileName
);
std
::
string
touchCmd
=
"@touch "
;
touchCmd
+=
this
->
ConvertToRelativeOutputPath
(
obj
.
c_str
());
// TODO: Construct build rule and append command.
commands
.
push_back
(
touchCmd
);
this
->
OutputMakeRule
(
ruleFileStream
,
buildComment
.
c_str
(),
obj
.
c_str
(),
depends
,
commands
);
}
}
//----------------------------------------------------------------------------
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment