diff -urb qt-creator-2.4.1-orig/src/plugins/projectexplorer/abstractprocessstep.h qt-creator-2.4.1-patched/src/plugins/projectexplorer/abstractprocessstep.h
--- qt-creator-2.4.1-orig/src/plugins/projectexplorer/abstractprocessstep.h	2012-01-24 21:37:13.000000000 +0700
+++ qt-creator-2.4.1-patched/src/plugins/projectexplorer/abstractprocessstep.h	2012-03-29 12:43:03.087325958 +0700
@@ -74,6 +74,10 @@
     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.4.1-orig/src/plugins/projectexplorer/projectexplorerconstants.h qt-creator-2.4.1-patched/src/plugins/projectexplorer/projectexplorerconstants.h
--- qt-creator-2.4.1-orig/src/plugins/projectexplorer/projectexplorerconstants.h	2012-01-24 21:37:13.000000000 +0700
+++ qt-creator-2.4.1-patched/src/plugins/projectexplorer/projectexplorerconstants.h	2012-03-29 12:43:57.184829219 +0700
@@ -82,6 +82,7 @@
 const char RENAMEFILE[]           = "ProjectExplorer.RenameFile";
 const char SETSTARTUP[]           = "ProjectExplorer.SetStartup";
 const char PROJECTTREE_COLLAPSE_ALL[] = "ProjectExplorer.CollapseAll";
+const char * const BUILDFILE            = "ProjectExplorer.BuildFile";
 
 const char SHOW_TASK_IN_EDITOR[]  = "ProjectExplorer.ShowTaskInEditor";
 const char VCS_ANNOTATE_TASK[]    = "ProjectExplorer.VcsAnnotateTask";
diff -urb qt-creator-2.4.1-orig/src/plugins/projectexplorer/projectexplorer.cpp qt-creator-2.4.1-patched/src/plugins/projectexplorer/projectexplorer.cpp
--- qt-creator-2.4.1-orig/src/plugins/projectexplorer/projectexplorer.cpp	2012-01-24 21:37:13.000000000 +0700
+++ qt-creator-2.4.1-patched/src/plugins/projectexplorer/projectexplorer.cpp	2012-03-29 13:43:42.866947586 +0700
@@ -180,6 +180,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;
@@ -234,6 +235,7 @@
     RunConfiguration *m_delayedRunConfiguration; // TODO this is not right
     QString m_runMode;
     QString m_projectFilterString;
+    QString m_currentFile;
     Internal::MiniProjectTargetSelector * m_targetSelector;
     Internal::ProjectExplorerSettings m_projectExplorerSettings;
     Internal::ProjectWelcomePage *m_welcomePage;
@@ -693,6 +695,15 @@
     // Add to mode bar
     Core::ModeManager::instance()->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->setDefaultText(d->m_buildFileAction->text());
+    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B")));
+    mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
+
     // rebuild action
     d->m_rebuildAction = new Utils::ParameterAction(tr("Rebuild Project"), tr("Rebuild Project \"%1\""),
                                                        Utils::ParameterAction::AlwaysEnabled, this);
@@ -944,6 +955,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()));
@@ -1583,6 +1595,13 @@
 
     Core::ICore *core = Core::ICore::instance();
 
+    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;
@@ -1642,6 +1661,7 @@
     d->m_cleanAction->setParameter(projectName);
 
     d->m_buildAction->setEnabled(buildActionState.first);
+    d->m_buildFileAction->setEnabled(buildActionState.first  && !d->m_currentFile.isEmpty());
     d->m_rebuildAction->setEnabled(buildActionState.first);
     d->m_cleanAction->setEnabled(buildActionState.first);
 
@@ -1810,6 +1830,77 @@
           QStringList() << 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;
+    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;
+    }
+    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()) {
+            QMessageBox::critical(Core::ICore::instance()->mainWindow(), tr("Error"),
+                                  QString("Failed to find related object target in global make file!\n Looked for %1 (.o) in %2/Makefile").arg(d->m_currentFile).arg(workingDir));
+            return;
+        }
+        makeStep->setUserArguments(objName);
+        d->m_buildManager->buildLists(stepLists);
+        makeStep->setUserArguments(args);
+    }
+}
+
 void ProjectExplorerPlugin::buildSession()
 {
     queue(d->m_session->projectOrder(),
diff -urb qt-creator-2.4.1-orig/src/plugins/projectexplorer/projectexplorer.h qt-creator-2.4.1-patched/src/plugins/projectexplorer/projectexplorer.h
--- qt-creator-2.4.1-orig/src/plugins/projectexplorer/projectexplorer.h	2012-01-24 21:37:13.000000000 +0700
+++ qt-creator-2.4.1-patched/src/plugins/projectexplorer/projectexplorer.h	2012-03-29 12:42:32.933526329 +0700
@@ -155,6 +155,7 @@
     void buildProjectOnly();
     void buildProject();
     void buildProjectContextMenu();
+    void buildFile();
     void buildSession();
     void rebuildProjectOnly();
     void rebuildProject();
