summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Preprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/Preprocessor.cpp')
-rw-r--r--cpp/src/Slice/Preprocessor.cpp42
1 files changed, 41 insertions, 1 deletions
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp
index 8759bee15be..03403498703 100644
--- a/cpp/src/Slice/Preprocessor.cpp
+++ b/cpp/src/Slice/Preprocessor.cpp
@@ -258,7 +258,7 @@ Slice::Preprocessor::preprocess(bool keepComments)
bool
Slice::Preprocessor::printMakefileDependencies(Language lang, const vector<string>& includePaths,
- const string& cppSourceExt)
+ const string& cppSourceExt, const string& pyPrefix)
{
if(!checkInputFile())
{
@@ -529,6 +529,46 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector<strin
}
break;
}
+ case Python:
+ {
+ //
+ // Change .o[bj] suffix to .py suffix.
+ //
+ if(pyPrefix.size() != 0)
+ {
+ result = pyPrefix + result;
+ }
+ string::size_type pos;
+ while((pos = result.find(suffix)) != string::npos)
+ {
+ result.replace(pos, suffix.size() - 1, "_ice.py");
+ }
+ break;
+ }
+ case Ruby:
+ {
+ //
+ // Change .o[bj] suffix to .rb suffix.
+ //
+ string::size_type pos;
+ while((pos = result.find(suffix)) != string::npos)
+ {
+ result.replace(pos, suffix.size() - 1, ".rb");
+ }
+ break;
+ }
+ case PHP:
+ {
+ //
+ // Change .o[bj] suffix to .php suffix.
+ //
+ string::size_type pos;
+ while((pos = result.find(suffix)) != string::npos)
+ {
+ result.replace(pos, suffix.size() - 1, ".php");
+ }
+ break;
+ }
default:
{
abort();