mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-29 22:04:02 -06:00
41 lines
1 KiB
C++
41 lines
1 KiB
C++
#include "umake.h"
|
|
|
|
void Ide::ExportMakefile(const String& ep)
|
|
{
|
|
SaveMakeFile(AppendFileName(ep, "Makefile"), true);
|
|
}
|
|
|
|
void Ide::ExportProject(const String& ep, bool all)
|
|
{
|
|
::Workspace wspc;
|
|
wspc.Scan(main);
|
|
Index<String> used;
|
|
HdependClearDependencies();
|
|
for(int i = 0; i < wspc.GetCount(); i++) {
|
|
const Package& p = wspc.GetPackage(i);
|
|
String pn = wspc[i];
|
|
for(int j = 0; j < p.GetCount(); j++) {
|
|
const Package::File& f = p[j];
|
|
if(!f.separator) {
|
|
String p = SourcePath(pn, f);
|
|
used.FindAdd(p);
|
|
Vector<String> d = HdependGetDependencies(p);
|
|
for(int q = 0; q < d.GetCount(); q++)
|
|
used.FindAdd(d[q]);
|
|
for(int q = 0; q < f.depends.GetCount(); q++)
|
|
used.FindAdd(SourcePath(pn, f.depends[q].text));
|
|
}
|
|
}
|
|
used.FindAdd(SourcePath(pn, "init"));
|
|
}
|
|
if(FileExists(ep))
|
|
FileDelete(ep);
|
|
|
|
if(DirectoryExists(ep))
|
|
DeleteFolderDeep(ep);
|
|
|
|
for(int i = 0; i < wspc.GetCount(); i++)
|
|
CopyFolder(AppendFileName(ep, wspc[i]), PackageDirectory(wspc[i]), used, all);
|
|
|
|
ExportMakefile(ep);
|
|
}
|