~quadrispro/codelite/trunk

« back to all changes in this revision

Viewing changes to Plugin/builder_gnumake.cpp

  • Committer: eranif
  • Date: 2009-11-16 18:45:13 UTC
  • Revision ID: svn-v4:9da81c78-c036-0410-9e1f-a2b0375e4b5a:trunk:3361
- Build System: Added support for pre-compiled header
- Project Settings: Added new 'Browse Button' to the 'Select program to debug / run' field

Show diffs side-by-side

added added

removed removed

Lines of Context:
496
496
        if (bldConf->IsLinkerRequired()) {
497
497
                CreateTargets(proj->GetSettings()->GetProjectType(bldConf->GetName()), bldConf, text);
498
498
        }
499
 
        CreatePostBuildEvents(bldConf, text);
500
 
        CreateMakeDirsTarget(bldConf, targetName, text);
501
 
        CreatePreBuildEvents(bldConf, text);
 
499
        CreatePostBuildEvents        (bldConf, text);
 
500
        CreateMakeDirsTarget         (bldConf, targetName, text);
 
501
        CreatePreBuildEvents         (bldConf, text);
 
502
        CreatePreCompiledHeaderTarget(bldConf, text);
502
503
 
503
504
        //-----------------------------------------------------------
504
505
        // Create a list of targets that should be built according to
695
696
                        //make sure we deletes it as well
696
697
                        exeExt = wxT(".exe");
697
698
                }
698
 
                text << wxT("\t") << wxT("$(RM) ") << wxT("$(OutputFile)") << wxT("\n");;
699
 
                text << wxT("\t") << wxT("$(RM) ") << wxT("$(OutputFile)") << exeExt << wxT("\n");;
 
699
                text << wxT("\t") << wxT("$(RM) ") << wxT("$(OutputFile)") << wxT("\n");
 
700
                text << wxT("\t") << wxT("$(RM) ") << wxT("$(OutputFile)") << exeExt << wxT("\n");
 
701
                text << wxT("\t") << wxT("$(RM) ") << wxT("*.gch") << wxT("\n");
700
702
        } else {
701
703
                //on linux we dont really need resource compiler...
702
704
                for (size_t i=0; i<abs_files.size(); i++) {
715
717
 
716
718
                //delete the output file as well
717
719
                text << wxT("\t") << wxT("$(RM) ") << wxT("$(OutputFile)\n");
 
720
                text << wxT("\t") << wxT("$(RM) ") << wxT("*.gch") << wxT("\n");
718
721
        }
719
722
 
720
723
        if (generateDependeciesFiles) {
1205
1208
        makeCommand << wxT("\t") << GetCdCmd(wspfile, projectPath);
1206
1209
        if( bldConf ) {
1207
1210
                wxString preprebuild = bldConf->GetPreBuildCustom();
 
1211
                wxString precmpheader = bldConf->GetPrecompiledHeader();
 
1212
                precmpheader.Trim().Trim(false);
1208
1213
                preprebuild.Trim().Trim(false);
 
1214
 
1209
1215
                if (preprebuild.IsEmpty() == false) {
1210
1216
                        makeCommand << basicMakeCommand << wxT(" PrePreBuild && ");
1211
1217
                }
1214
1220
                        makeCommand << basicMakeCommand << wxT(" PreBuild && ");
1215
1221
                }
1216
1222
 
 
1223
                // Run pre-compiled header compilation if any
 
1224
                if( precmpheader.IsEmpty() == false) {
 
1225
                        makeCommand << basicMakeCommand << wxT(" ") << precmpheader << wxT(".gch") << wxT(" && ");
 
1226
                }
 
1227
 
1217
1228
        }
1218
1229
 
1219
1230
        makeCommand << basicMakeCommand << wxT("\n");
1234
1245
 
1235
1246
        if( bldConf ) {
1236
1247
                wxString preprebuild = bldConf->GetPreBuildCustom();
 
1248
                wxString precmpheader = bldConf->GetPrecompiledHeader();
 
1249
                precmpheader.Trim().Trim(false);
1237
1250
                preprebuild.Trim().Trim(false);
 
1251
 
1238
1252
                if (preprebuild.IsEmpty() == false) {
1239
1253
                        makeCommand << basicMakeCommand << wxT(" PrePreBuild && ");
1240
1254
                }
1243
1257
                        makeCommand << basicMakeCommand << wxT(" PreBuild && ");
1244
1258
                }
1245
1259
 
 
1260
                // Run pre-compiled header compilation if any
 
1261
                if( precmpheader.IsEmpty() == false) {
 
1262
                        makeCommand << basicMakeCommand << wxT(" ") << precmpheader << wxT(".gch") << wxT(" && ");
 
1263
                }
1246
1264
        }
1247
1265
 
1248
1266
        makeCommand << basicMakeCommand;
1249
1267
        return makeCommand;
1250
1268
}
 
1269
 
 
1270
void BuilderGnuMake::CreatePreCompiledHeaderTarget(BuildConfigPtr bldConf, wxString& text)
 
1271
{
 
1272
        wxString filename = bldConf->GetPrecompiledHeader();
 
1273
        filename.Trim().Trim(false);
 
1274
 
 
1275
        if(filename.IsEmpty()) return;
 
1276
        text << wxT("\n");
 
1277
        text << wxT("# PreCompiled Header\n");
 
1278
        text << filename << wxT(".gch: ") << filename << wxT("\n");
 
1279
        text << wxT("\t") << wxT("$(CompilerName) $(SourceSwitch) ") << filename << wxT(" $(CmpOptions) $(IncludePath)\n");
 
1280
        text << wxT("\n");
 
1281
}