/// <summary> /// Creates a makefile for the project passed in. /// </summary> private static void createProjectMakefile(ProjectInfo projectInfo) { // Are we ignoring this project? if (MakeItSoConfig.Instance.ignoreProject(projectInfo.Name) == true) { return; } // We build a different makefile, depending on the // project type... if (projectInfo is ProjectInfo_CPP) { MakefileBuilder_Project_CPP.createMakefile(projectInfo as ProjectInfo_CPP); } if (projectInfo is ProjectInfo_CSharp) { MakefileBuilder_Project_CSharp.createMakefile(projectInfo as ProjectInfo_CSharp); } }
/// <summary> /// Adds a project to the collection that this project depends on. /// </summary> public void addRequiredProject(ProjectInfo project) { m_requiredProjects.Add(project); }
/// <summary> /// Writes a section of the master Makefile for the project passed in. /// </summary> private void writeProjectSection(ProjectInfo projectInfo) { // We check if this project should be excluded from the makefiles... if (MakeItSoConfig.Instance.ignoreProject(projectInfo.Name) == true) { return; } // We create a target like: // .PHONY: [project-name] // [project-name]: [required-project-1] [required-project-2] // make --directory=[project-folder] -f [makefile-name] m_file.WriteLine("# Builds project '{0}'...", projectInfo.Name); m_file.WriteLine(".PHONY: {0}", projectInfo.Name); string dependencies = String.Format("{0}: ", projectInfo.Name); foreach (ProjectInfo requiredProject in projectInfo.getRequiredProjects()) { if (MakeItSoConfig.Instance.ignoreProject(requiredProject.Name) == false) { dependencies += (requiredProject.Name + " "); } } m_file.WriteLine(dependencies); string directory = Utils.quote(projectInfo.RootFolderRelative); string makefile = projectInfo.Name + ".makefile"; m_file.WriteLine("\tmake --directory={0} --file={1}", directory, makefile); m_file.WriteLine(""); }
/// <summary> /// Adds a project to the collection in the solution. /// </summary> public void addProjectInfo(string projectName, ProjectInfo project) { project.ParentSolution = this; m_projectInfos.Add(projectName, project); }