mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
POSIX install, build and config improvements
git-svn-id: svn://ultimatepp.org/upp/trunk@14209 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
23747a75e0
commit
b18be29af9
6 changed files with 47 additions and 27 deletions
|
|
@ -198,7 +198,7 @@ String ConfigFile(const char *file) {
|
|||
return AppendFileName(sConfigFolder, file);
|
||||
#if defined(PLATFORM_WIN32)
|
||||
if(sHomecfg) {
|
||||
String p = GetHomeDirFile(GetExeTitle());
|
||||
String p = GetHomeDirFile(GetAppName());
|
||||
ONCELOCK
|
||||
RealizeDirectory(p);
|
||||
return AppendFileName(p, file);
|
||||
|
|
@ -211,7 +211,8 @@ String ConfigFile(const char *file) {
|
|||
if(!sHomecfg)
|
||||
while(h.GetCount() > 1 && DirectoryExists(h)) {
|
||||
String pp = AppendFileName(h, ".config");
|
||||
if(DirectoryExists(pp)) {
|
||||
FindFile ff(pp);
|
||||
if(ff && ff.IsFolder() && ff.CanWrite()) {
|
||||
cfgdir = pp;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -632,7 +632,7 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
|
|||
String makefile;
|
||||
|
||||
Vector<String> uppdirs = GetUppDirs();
|
||||
String uppout = exporting ? host->GetHostPath(GetVar("OUTPUT")) : "_out/";
|
||||
String uppout = exporting ? host->GetHostPath(GetVar("OUTPUT")) : ".cache/upp.out";
|
||||
String inclist;
|
||||
|
||||
Index<String> allconfig = PackageConfig(GetIdeWorkspace(), 0, bm, mainconfigparam, *host, *b);
|
||||
|
|
@ -657,8 +657,6 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
|
|||
makefile << "UPPDIR" << (i + 1) << " = " << srcdir << "\n";
|
||||
inclist << " -I$(UPPDIR" << (i + 1) << ")";
|
||||
}
|
||||
else
|
||||
inclist << "-I./";
|
||||
|
||||
for(String s : pkg_config)
|
||||
inclist << " `pkg-config --cflags " << s << "`";
|
||||
|
|
@ -666,6 +664,9 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
|
|||
Vector<String> includes = SplitDirs(bm.Get("INCLUDE",""));
|
||||
for(int i = 0; i < includes.GetCount(); i++)
|
||||
inclist << " -I" << includes[i];
|
||||
|
||||
inclist << " -I./";
|
||||
inclist << " -I" << uppout; // build_info.h is created there
|
||||
|
||||
makefile << "\n"
|
||||
"UPPOUT = " << (exporting ? "_out/" : GetMakePath(AdjustMakePath(host->GetHostPath(AppendFileName(uppout, ""))), win32)) << "\n"
|
||||
|
|
@ -702,11 +703,14 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
|
|||
output = Nvl(trg, mf.output);
|
||||
if(exporting)
|
||||
output = wspc[i] + ".out";
|
||||
else
|
||||
output = "./" + wspc[0];
|
||||
StringStream ss;
|
||||
Vector<String> bi = SvnInfo(wspc[i]);
|
||||
String svn_info;
|
||||
String build_info = '\"' + uppout + "/build_info.h\"";
|
||||
for(int i = 0; i < bi.GetCount(); i++)
|
||||
svn_info << " echo '" << bi[i] << "' >> build_info.h\n";
|
||||
svn_info << " echo '" << bi[i] << "' >> " << build_info << "\n";
|
||||
install << "\n"
|
||||
"OutDir = " << tdir << "\n"
|
||||
"OutFile = " << output << "\n"
|
||||
|
|
@ -724,7 +728,7 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
|
|||
"#define bmSECOND %-S%n"
|
||||
"#define bmTIME Time(%y, %-m, %-d, %-H, %-M, %-S)' && \\\n"
|
||||
" echo '#define bmMACHINE \"'`hostname`'\"' && \\\n"
|
||||
" echo '#define bmUSER \"'`whoami`'\"') > build_info.h\n"
|
||||
" echo '#define bmUSER \"'`whoami`'\"') > " << build_info << "\n"
|
||||
<< svn_info <<
|
||||
"\n"
|
||||
".PHONY: prepare\n"
|
||||
|
|
|
|||
|
|
@ -162,7 +162,8 @@ private:
|
|||
void DeletePCHFile(const String& pch_file);
|
||||
|
||||
#ifdef PLATFORM_POSIX
|
||||
void CreateBuildMethods();
|
||||
void CreateBuildMethods();
|
||||
String GetDefaultUppOut();
|
||||
#endif
|
||||
|
||||
INITIALIZE(GccBuilder)
|
||||
|
|
|
|||
|
|
@ -107,4 +107,24 @@ void CreateBuildMethods()
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
String GetDefaultUppOut()
|
||||
{
|
||||
String out;
|
||||
String p = GetExeFolder();
|
||||
while(p.GetCount() > 1 && DirectoryExists(p)) {
|
||||
String h = AppendFileName(p, ".cache");
|
||||
if(DirectoryExists(h)) {
|
||||
out = h;
|
||||
break;
|
||||
}
|
||||
p = GetFileFolder(p);
|
||||
}
|
||||
|
||||
out = Nvl(out, GetHomeDirFile(".cache")) + "/upp.out";
|
||||
|
||||
RealizeDirectory(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -11,20 +11,7 @@ bool Install(bool& hasvars)
|
|||
|
||||
String uppsrc;
|
||||
|
||||
String out;
|
||||
String p = GetExeFolder();
|
||||
while(p.GetCount() > 1 && DirectoryExists(p)) {
|
||||
String h = AppendFileName(p, ".cache");
|
||||
if(DirectoryExists(h)) {
|
||||
out = h;
|
||||
break;
|
||||
}
|
||||
p = GetFileFolder(p);
|
||||
}
|
||||
|
||||
out = Nvl(out, GetHomeDirFile(".cache")) + "/upp.out";
|
||||
|
||||
RealizeDirectory(out);
|
||||
String out = GetDefaultUppOut();
|
||||
|
||||
auto MakeAssembly = [&](String b, String name = Null) {
|
||||
name = Nvl(name, GetFileTitle(b));
|
||||
|
|
|
|||
|
|
@ -4,10 +4,16 @@ bool SilentMode;
|
|||
|
||||
String GetUmkFile(const char *fn)
|
||||
{
|
||||
String h = ConfigFile(fn);
|
||||
if(FileExists(h))
|
||||
return h;
|
||||
String cfgdir = GetFileFolder(GetFileFolder(ConfigFile("x")));
|
||||
ONCELOCK
|
||||
PutVerbose("Config directory: " << cfgdir);
|
||||
return GetFileOnPath(fn,
|
||||
GetHomeDirFile(".upp/umk") + ';' +
|
||||
GetHomeDirFile(".upp/theide") + ';' +
|
||||
GetHomeDirFile(".upp/ide") + ';' +
|
||||
cfgdir + "/umk" + ';' +
|
||||
cfgdir + "/theide" + ';' +
|
||||
cfgdir + "/ide" + ';' +
|
||||
GetHomeDirectory() + ';' +
|
||||
GetFileFolder(GetExeFilePath()));
|
||||
}
|
||||
|
|
@ -100,7 +106,7 @@ CONSOLE_APP_MAIN
|
|||
String x = Join(h, ";");
|
||||
SetVar("UPP", x, false);
|
||||
PutVerbose("Inline assembly: " + x);
|
||||
String outdir = ConfigFile("_out");
|
||||
String outdir = GetDefaultUppOut();
|
||||
RealizeDirectory(outdir);
|
||||
SetVar("OUTPUT", outdir, false);
|
||||
}
|
||||
|
|
@ -220,7 +226,8 @@ CONSOLE_APP_MAIN
|
|||
}
|
||||
else {
|
||||
ide.debug.target_override = ide.release.target_override = true;
|
||||
ide.debug.target = ide.release.target = mkf = arg[i];
|
||||
ide.debug.target = ide.release.target = NormalizePath(arg[i]);
|
||||
PutVerbose("Target override: " << ide.debug.target);
|
||||
}
|
||||
if(clean)
|
||||
ide.Clean();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue