// Undo
// Redo
- //ToolSeparator separator2 { this };
+ // ToolSeparator separator2 { this };
/* Project options */
// New project
// Add project to workspace
ToolButton buttonAddProject { this, toolTip = $"Add project to workspace", menuItemPtr = IDEItem(projectAddItem), disabled = true; };
// Close project
- //ToolButton buttonCloseProject { this, toolTip = $"Close project", menuItemPtr = IDEItem(projectCloseItem), disabled = true; };
+ // ToolButton buttonCloseProject { this, toolTip = $"Close project", menuItemPtr = IDEItem(projectCloseItem), disabled = true; };
ToolSeparator separator3 { this };
ToolButton buttonRebuild { this, toolTip = $"Rebuild project", menuItemPtr = IDEItem(projectRebuildItem), disabled = true; };
// Clean
ToolButton buttonClean { this, toolTip = $"Clean project", menuItemPtr = IDEItem(projectCleanItem), disabled = true; };
+ // Real Clean
+ // ToolButton buttonRealClean { this, toolTip = $"Real clean project", menuItemPtr = IDEItem(projectRealCleanItem), disabled = true; };
// Regenerate Makefile
ToolButton buttonRegenerateMakefile { this, toolTip = $"Regenerate Makefile", menuItemPtr = IDEItem(projectRegenerateItem), disabled = true; };
// Compile actual file
return true;
}
}
+ MenuItem projectRealCleanItem
+ {
+ projectMenu, $"Real Clean", e, disabled = true;
+ bitmap = { ":actions/clean.png" };
+ bool NotifySelect(MenuItem selection, Modifiers mods)
+ {
+ if(projectView)
+ {
+ debugger.Stop();
+ projectView.ProjectRealClean(projectView.active ? selection : null, mods);
+ }
+ return true;
+ }
+ }
MenuItem projectRegenerateItem
{
projectMenu, $"Regenerate Makefile", m, disabled = true;
projectQuickItem.disabled = !unavailable;
projectAddItem.disabled = unavailable;
- ((IDEMainFrame)master).toolBar.buttonAddProject.disabled = unavailable;
+ toolBar.buttonAddProject.disabled = unavailable;
activeCompilerItem.disabled = unavailable;
projectActiveConfigItem.disabled = unavailable;
{
bool unavailable = project && projectView.buildInProgress;
- projectNewItem.disabled = unavailable;
- toolBar.buttonNewProject.disabled = unavailable;
- projectOpenItem.disabled = unavailable;
- toolBar.buttonOpenProject.disabled = unavailable;
+ projectNewItem.disabled = unavailable;
+ toolBar.buttonNewProject.disabled = unavailable;
+ projectOpenItem.disabled = unavailable;
+ toolBar.buttonOpenProject.disabled = unavailable;
unavailable = !project || projectView.buildInProgress;
- projectCloseItem.disabled = unavailable;
+ projectCloseItem.disabled = unavailable;
// toolBar.buttonCloseProject.disabled = unavailable;
- projectRunItem.disabled = unavailable || project.GetTargetType(project.config) != executable;
+ projectRunItem.disabled = unavailable || project.GetTargetType(project.config) != executable;
toolBar.buttonRun.disabled = unavailable || project.GetTargetType(project.config) != executable;
- projectBuildItem.disabled = unavailable;
- toolBar.buttonBuild.disabled = unavailable;
- projectLinkItem.disabled = unavailable;
- toolBar.buttonReLink.disabled = unavailable;
- projectRebuildItem.disabled = unavailable;
- toolBar.buttonRebuild.disabled = unavailable;
- projectCleanItem.disabled = unavailable;
- toolBar.buttonClean.disabled = unavailable;
- projectRegenerateItem.disabled = unavailable;
+ projectBuildItem.disabled = unavailable;
+ toolBar.buttonBuild.disabled = unavailable;
+ projectLinkItem.disabled = unavailable;
+ toolBar.buttonReLink.disabled = unavailable;
+ projectRebuildItem.disabled = unavailable;
+ toolBar.buttonRebuild.disabled = unavailable;
+ projectCleanItem.disabled = unavailable;
+ toolBar.buttonClean.disabled = unavailable;
+ projectRealCleanItem.disabled = unavailable;
+ // toolBar.buttonRealClean.disabled = unavailable;
+ projectRegenerateItem.disabled = unavailable;
toolBar.buttonRegenerateMakefile.disabled = unavailable;
- projectCompileItem.disabled = unavailable;
+ projectCompileItem.disabled = unavailable;
}
void AdjustDebugMenus()
return result;
}
- void Clean(CompilerConfig compiler, ProjectConfig config)
+ void Clean(CompilerConfig compiler, ProjectConfig config, bool realclean)
{
char makeFile[MAX_LOCATION];
char makeFilePath[MAX_LOCATION];
}
else
{
- sprintf(command, "%s clean -C \"%s\" -f \"%s\"", compiler.makeCommand, topNode.path, makeFilePath);
+ sprintf(command, "%s %sclean -C \"%s\" -f \"%s\"", compiler.makeCommand, realclean ? "real" : "", topNode.path, makeFilePath);
if((f = DualPipeOpen(PipeOpenMode { output = 1, error = 1, input = 2 }, command)))
{
ide.outputView.buildBox.Tell($"Deleting target and object files...");
sameObjTargetDirs = !fstrcmp(objDirExpNoSpaces, targetDirExpNoSpaces);
- f.Printf(".PHONY: all objdir%s clean distclean\n\n", sameObjTargetDirs ? "" : " targetdir");
+ f.Printf(".PHONY: all objdir%s clean realclean\n\n", sameObjTargetDirs ? "" : " targetdir");
f.Printf("# CONTENT\n\n");
}
f.Printf("\n");
- f.Printf("distclean: clean\n");
- f.Printf("\t$(call rmdirq,$(OBJ))\n");
+ f.Printf("realclean: clean\n");
+ f.Printf("\t$(call rmrq,$(OBJ))\n");
if(!sameObjTargetDirs)
f.Printf("\t$(call rmdirq,%s)\n", targetDirExpNoSpaces);
MenuItem { popupContent, $"Relink", l, NotifySelect = ProjectLink }.disabled = buildMenuUnavailable;
MenuItem { popupContent, $"Rebuild", r, NotifySelect = ProjectRebuild }.disabled = buildMenuUnavailable;
MenuItem { popupContent, $"Clean", c, NotifySelect = ProjectClean }.disabled = buildMenuUnavailable;
+ MenuItem { popupContent, $"Real Clean", d, NotifySelect = ProjectRealClean }.disabled = buildMenuUnavailable;
MenuItem { popupContent, $"Regenerate Makefile", m, NotifySelect = ProjectRegenerate }.disabled = buildMenuUnavailable;
MenuDivider { popupContent };
}
// TODO: Disabled until problems fixed... is it fixed?
if(buildType == rebuild || (config && config.compilingModified))
- prj.Clean(compiler, config);
+ prj.Clean(compiler, config, false);
else
{
if(buildType == relink || (config && config.linkingModified))
if(ProjectPrepareForToolchain(prj, normal, true, true, compiler, config))
{
ide.outputView.buildBox.Logf($"Cleaning project %s using the %s configuration...\n", prj.name, GetConfigName(config));
-
+
+ buildInProgress = prj == project ? buildingMainProject : buildingSecondaryProject;
+ ide.AdjustBuildMenus();
+
+ prj.Clean(compiler, config, false);
+ buildInProgress = none;
+ ide.AdjustBuildMenus();
+ }
+ delete compiler;
+ return true;
+ }
+
+ bool ProjectRealClean(MenuItem selection, Modifiers mods)
+ {
+ Project prj = project;
+ CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+ ProjectConfig config;
+ if(selection || !ide.activeClient)
+ {
+ DataRow row = fileList.currentRow;
+ ProjectNode node = row ? (ProjectNode)row.tag : null;
+ if(node) prj = node.project;
+ }
+ else
+ {
+ ProjectNode node = GetNodeFromWindow(ide.activeClient, null);
+ if(node)
+ prj = node.project;
+ }
+ config = prj.config;
+ if(ProjectPrepareForToolchain(prj, normal, true, true, compiler, config))
+ {
+ ide.outputView.buildBox.Logf($"Removing intermediate objects directory for project %s using the %s configuration...\n", prj.name, GetConfigName(config));
+
buildInProgress = prj == project ? buildingMainProject : buildingSecondaryProject;
ide.AdjustBuildMenus();
- prj.Clean(compiler, config);
+ prj.Clean(compiler, config, true);
buildInProgress = none;
ide.AdjustBuildMenus();
}