diff -urb qt-creator-2.5.0-rc-orig/src/plugins/projectexplorer/abstractprocessstep.h qt-creator-2.5.0-rc-patched/src/plugins/projectexplorer/abstractprocessstep.h
--- qt-creator-2.5.0-rc-orig/src/plugins/projectexplorer/abstractprocessstep.h	2012-04-23 18:17:53.000000000 +0700
+++ qt-creator-2.5.0-rc-patched/src/plugins/projectexplorer/abstractprocessstep.h	2012-04-25 14:46:29.470998498 +0700
@@ -72,6 +72,9 @@
     void setOutputParser(ProjectExplorer::IOutputParser *parser);
     void appendOutputParser(ProjectExplorer::IOutputParser *parser);
     ProjectExplorer::IOutputParser *outputParser() const;
+    virtual QString userArguments() { return QString(); }
+    virtual void setUserArguments(const QString & /*arguments*/) {}
+
 protected:
     AbstractProcessStep(BuildStepList *bsl, const QString &id);
     AbstractProcessStep(BuildStepList *bsl, AbstractProcessStep *bs);
diff -urb qt-creator-2.5.0-rc-orig/src/plugins/projectexplorer/projectexplorerconstants.h qt-creator-2.5.0-rc-patched/src/plugins/projectexplorer/projectexplorerconstants.h
--- qt-creator-2.5.0-rc-orig/src/plugins/projectexplorer/projectexplorerconstants.h	2012-04-23 18:17:53.000000000 +0700
+++ qt-creator-2.5.0-rc-patched/src/plugins/projectexplorer/projectexplorerconstants.h	2012-04-25 14:54:17.151564470 +0700
@@ -184,6 +184,7 @@
 const char PROJECTEXPLORER_SETTINGS_CATEGORY_ICON[]  = ":/core/images/category_buildrun.png";
 const char PROJECTEXPLORER_SETTINGS_ID[] = "A.ProjectExplorer.ProjectExplorer";
 const char TOOLCHAIN_SETTINGS_PAGE_ID[] = "M.ProjectExplorer.ToolChainOptions";
+const char * const BUILDFILE            = "ProjectExplorer.BuildFile";
 
 // Task categories
 const char TASK_CATEGORY_COMPILE[] = "Task.Category.Compile";
diff -urb qt-creator-2.5.0-rc-orig/src/plugins/projectexplorer/projectexplorer.cpp qt-creator-2.5.0-rc-patched/src/plugins/projectexplorer/projectexplorer.cpp
--- qt-creator-2.5.0-rc-orig/src/plugins/projectexplorer/projectexplorer.cpp	2012-04-23 18:17:53.000000000 +0700
+++ qt-creator-2.5.0-rc-patched/src/plugins/projectexplorer/projectexplorer.cpp	2012-04-25 15:09:47.579286526 +0700
@@ -179,6 +179,7 @@
     QAction *m_buildProjectOnlyAction;
     Utils::ParameterAction *m_buildAction;
     Utils::ParameterAction *m_buildActionContextMenu;
+    Utils::ParameterAction *m_buildFileAction;
     QAction *m_buildSessionAction;
     QAction *m_rebuildProjectOnlyAction;
     Utils::ParameterAction *m_rebuildAction;
@@ -235,6 +236,7 @@
     RunConfiguration *m_delayedRunConfiguration; // TODO this is not right
     RunMode m_runMode;
     QString m_projectFilterString;
+    QString m_currentFile;
     Internal::MiniProjectTargetSelector * m_targetSelector;
     Internal::ProjectExplorerSettings m_projectExplorerSettings;
     Internal::ProjectWelcomePage *m_welcomePage;
@@ -695,6 +697,16 @@
     // Add to mode bar
     Core::ModeManager::addAction(cmd->action(), Constants::P_ACTION_BUILDPROJECT);
 
+    // build current file action
+    d->m_buildFileAction = new Utils::ParameterAction(tr("Build Current File"), tr("Build File \"%1\""),
+                                                      Utils::ParameterAction::EnabledWithParameter, this);
+    cmd = am->registerAction(d->m_buildFileAction, Constants::BUILDFILE, globalcontext);
+    cmd->setAttribute(Core::Command::CA_UpdateText);
+    cmd->setDescription(d->m_buildFileAction->text());
+    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B")));
+    mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
+    d->m_buildFileAction->setEnabled(!d->m_currentFile.isEmpty());
+
     // rebuild action
     d->m_rebuildAction = new Utils::ParameterAction(tr("Rebuild Project"), tr("Rebuild Project \"%1\""),
                                                        Utils::ParameterAction::AlwaysEnabled, this);
@@ -703,6 +715,7 @@
     cmd->setDescription(d->m_rebuildAction->text());
     mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
 
+
     // deploy action
     d->m_deployAction = new Utils::ParameterAction(tr("Deploy Project"), tr("Deploy Project \"%1\""),
                                                      Utils::ParameterAction::AlwaysEnabled, this);
@@ -965,6 +978,7 @@
     connect(d->m_buildProjectOnlyAction, SIGNAL(triggered()), this, SLOT(buildProjectOnly()));
     connect(d->m_buildAction, SIGNAL(triggered()), this, SLOT(buildProject()));
     connect(d->m_buildActionContextMenu, SIGNAL(triggered()), this, SLOT(buildProjectContextMenu()));
+    connect(d->m_buildFileAction, SIGNAL(triggered()), this, SLOT(buildFile()));
     connect(d->m_buildSessionAction, SIGNAL(triggered()), this, SLOT(buildSession()));
     connect(d->m_rebuildProjectOnlyAction, SIGNAL(triggered()), this, SLOT(rebuildProjectOnly()));
     connect(d->m_rebuildAction, SIGNAL(triggered()), this, SLOT(rebuildProject()));
@@ -1630,6 +1644,13 @@
     else
         node = d->m_session->nodeForFile(filePath, project);
 
+    QFileInfo fi(filePath);
+    QString suffix = fi.suffix().toLower();
+    if (suffix == QLatin1String("cpp") || (suffix == QLatin1String("c")))
+        d->m_currentFile = fi.fileName();
+    else
+        d->m_currentFile.clear();
+    d->m_buildFileAction->setParameter(d->m_currentFile);
     bool projectChanged = false;
     if (d->m_currentProject != project) {
         Core::Context oldContext;
@@ -1877,6 +1898,77 @@
           QStringList(QLatin1String(Constants::BUILDSTEPS_BUILD)));
 }
 
+static QString getObjectName(const QString &workingDir, const QString &fileName)
+{
+    QFileInfo srcFile(fileName);
+    QRegExp objDirRE("OBJECTS_DIR\\s*=\\s*(.*)$");
+    QRegExp objSuffixRE("\\.cpp.*\\.([^:]*):");
+    QDir objDir;
+    QString objSuffix;
+    int found = 0;
+    QFile make(QDir(workingDir).absoluteFilePath("Makefile"));
+    make.open(QIODevice::ReadOnly | QIODevice::Text);
+    while (!make.atEnd() && (found < 2))
+    {
+        QString line = QString::fromLocal8Bit(make.readLine()).trimmed();
+        if (objDirRE.indexIn(line) != -1)
+        {
+            objDir.setPath(objDirRE.cap(1));
+            ++found;
+        }
+        else if (objSuffixRE.indexIn(line) != -1)
+        {
+            objSuffix = objSuffixRE.cap(1);
+            ++found;
+        }
+    }
+    make.close();
+    if (found < 2)
+        return QString();
+    QString objFile = srcFile.fileName().replace(srcFile.suffix(), objSuffix);
+    return QDir().relativeFilePath(objDir.filePath(objFile));
+}
+
+void ProjectExplorerPlugin::buildFile()
+{
+    AbstractProcessStep *makeStep = NULL;
+    QList<BuildStepList *> stepLists;
+    QStringList stepNames, stepMessages;
+    foreach (Project *pro, d->m_session->projectOrder(d->m_session->startupProject())) {
+        if (!pro || !pro->activeTarget())
+            continue;
+        BuildStepList *bsl = 0;
+        if (pro->activeTarget()->activeBuildConfiguration())
+            bsl = pro->activeTarget()->activeBuildConfiguration()->stepList(Constants::BUILDSTEPS_BUILD);
+
+        if (!bsl || bsl->isEmpty())
+            continue;
+        stepLists << bsl;
+        stepNames << ""; //TODO
+        stepMessages << ""; //TODO
+    }
+    foreach (BuildStep *step, stepLists.at(0)->steps())
+    {
+        if (step->id() == QLatin1String("Qt4ProjectManager.MakeStep"))
+        {
+            makeStep = (AbstractProcessStep *)step;
+            break;
+        }
+    }
+    if (makeStep)
+    {
+        QString args = makeStep->userArguments();
+        makeStep->init();
+        QString workingDir = makeStep->processParameters()->effectiveWorkingDirectory();
+        QString objName = getObjectName(workingDir, d->m_currentFile);
+        if (objName.isEmpty())
+            return;
+        makeStep->setUserArguments(objName);
+        d->m_buildManager->buildLists(stepLists, stepNames, stepMessages);
+        makeStep->setUserArguments(args);
+    }
+}
+
 void ProjectExplorerPlugin::buildSession()
 {
     queue(d->m_session->projectOrder(),
diff -urb qt-creator-2.5.0-rc-orig/src/plugins/projectexplorer/projectexplorer.h qt-creator-2.5.0-rc-patched/src/plugins/projectexplorer/projectexplorer.h
--- qt-creator-2.5.0-rc-orig/src/plugins/projectexplorer/projectexplorer.h	2012-04-23 18:17:53.000000000 +0700
+++ qt-creator-2.5.0-rc-patched/src/plugins/projectexplorer/projectexplorer.h	2012-04-25 14:44:56.146221846 +0700
@@ -159,6 +159,7 @@
     void buildProjectOnly();
     void buildProject();
     void buildProjectContextMenu();
+    void buildFile();
     void buildSession();
     void rebuildProjectOnly();
     void rebuildProject();
