Commit 1e0aa2e1 authored by John van Groningen's avatar John van Groningen

remove field built from record Project

parent 7fd7c053
......@@ -19,8 +19,7 @@ ApplicationOptionsTable :: OptionsTable ApplicationOptions
ProjectFileVersion :== "1.4"
:: ProjectGlobalOptions =
{ pg_built :: !Bool
, pg_codegen :: CodeGenOptions
{ pg_codegen :: CodeGenOptions
, pg_application :: ApplicationOptions
, pg_link :: LinkOptions
, pg_projectPaths :: List Pathname
......
......@@ -11,8 +11,7 @@ from PmPath import convert_path_separators,convert_exec_path_separators_and_exte
ProjectFileVersion :== "1.4"
:: ProjectGlobalOptions =
{ pg_built :: !Bool
, pg_codegen :: CodeGenOptions
{ pg_codegen :: CodeGenOptions
, pg_application :: ApplicationOptions
, pg_link :: LinkOptions
, pg_projectPaths :: List Pathname
......@@ -89,7 +88,6 @@ wrap s = Just s
ProjectGlobalOptionsTable :: OptionsTable ProjectGlobalOptions
ProjectGlobalOptionsTable =
{ project_root_option
, SimpleOption "Built" (\a->a.pg_built) (\v a->{a & pg_built=v})
, target_option
, SimpleWithStringConversionOption convert_exec_path_separators_and_extension "Exec" (\a->a.pg_execpath) (\v a->{a & pg_execpath=v})
, code_gen_option
......
......@@ -52,7 +52,7 @@ PR_ProjectSet :: !Project -> Bool
PR_NewProject :: !String !EditWdOptions !CompilerOptions !CodeGenOptions !ApplicationOptions
!(List String) !LinkOptions -> Project
PR_SetBuilt :: ![!ModuleDirAndName] !.Project -> .Project
PR_SetBuilt :: ![!ModuleDirAndName] !u:Project -> u:Project
PR_ClearDependencies :: !Project -> Project
PR_SetRoot :: !String !EditWdOptions !CompilerOptions !Project -> Project
PR_SetRelativeRootDir :: !String !Project -> Project
......@@ -80,7 +80,6 @@ PR_GetDirAndModulenames :: !Project -> ([!ModuleDirAndName],Project)
PR_GetOpenModulenames :: !Project -> List String
PR_GetModuleStuff :: !Project -> List (Modulename,String,Modulename,String)
PR_Built :: !Project -> Bool
PR_SrcUpToDate :: !Modulename !Project -> Bool
PR_ABCUpToDate :: !Modulename !Project -> Bool
PR_SysUptoDate :: !Project -> Bool
......
......@@ -25,8 +25,7 @@ Unmodified :== False;
// The Project: A list of constituent modules and their mutual dependencies
:: Project =
{ built :: !Bool // Was dependency list generated?
, saved :: !Bool
{ saved :: !Bool
, exec :: !Bool // exe linked ok?
, inflist :: !InfList // list with constituent modules
, codegenopt :: !CodeGenOptions // code generator options
......@@ -61,8 +60,7 @@ Unmodified :== False;
PR_InitProject :: Project;
PR_InitProject =
{ built = True
, saved = True
{ saved = True
, exec = True
, execpath = EmptyPathname
, inflist = Nil
......@@ -102,8 +100,7 @@ PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptio
# modname = GetModuleName main_module_file_name;
dirname = RemoveFilename main_module_file_name;
= { PR_InitProject
& built = False
, saved = False
& saved = False
, exec = False
, execpath = PlatformDependant //MakeExecPathname main_module_file_name
("{Project}"+++DirSeparatorString+++modname+++".exe") // Win
......@@ -128,15 +125,15 @@ PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptio
, root_directory = dirname
}
PR_SetBuilt :: ![!ModuleDirAndName] !.Project -> .Project;
PR_SetBuilt :: ![!ModuleDirAndName] !u:Project -> u:Project;
PR_SetBuilt used project=:{inflist=Nil}
= {Project | project & built = True};
= project;
PR_SetBuilt used prj=:{inflist=infl=:(root:!rest),saved}
#! len = LLength rest
# rest = RemoveUnusedModules used rest
# len` = LLength rest
# unchanged = len == len`
= {prj & built=True,saved=saved && unchanged,inflist= root:!rest}
= {prj & saved=saved && unchanged,inflist= root:!rest}
where
{mn=rootmn,info} = root
RemoveUnusedModules used list = FilterR member list
......@@ -153,7 +150,7 @@ PR_AddABCInfo mdn dep_objects dep_libraries compilerOptions project=:{inflist=Ni
PR_AddABCInfo {mdn_dir=mod_dir,mdn_name=mod_name} dep_objects dep_libraries compilerOptions project=:{inflist}
# inflist = TryInsertInList mod_name mod_dir inflist
# (inflist,_) = UpdateList mod_name update inflist;
= {project & saved=False,inflist=inflist, built=False}
= {project & saved=False,inflist=inflist}
where
update infListItem=:{InfListItem | info}
= ( { InfListItem | infListItem
......@@ -193,9 +190,9 @@ where
PR_ClearDependencies :: !Project -> Project
PR_ClearDependencies project=:{inflist=Nil}
= {project & saved = False, inflist = Nil, built = False}
= {project & saved = False, inflist = Nil}
PR_ClearDependencies project=:{inflist=il=:(root :! rest)}
= {project & saved = False, inflist = root` :! Nil, built = False}
= {project & saved = False, inflist = root` :! Nil}
where
root` = {InfListItem | root & info.abcLinkInfo = {linkObjFileNames = Nil, linkLibraryNames = Nil}}
......@@ -204,7 +201,6 @@ PR_SetRoot root eo co project=:{inflist=Nil}
= project;
PR_SetRoot newroot eo compilerOptions project=:{prjpaths}
= {project & saved = False,
built = False,
exec = False,
inflist = { mn = modname,
info = { dir = dirname,
......@@ -329,13 +325,11 @@ PR_GetLinkOptions project
PR_SetPaths :: !Bool !(List String) !(List String) !Project -> Project;
PR_SetPaths def defs new project=:{Project | inflist=Nil} = project;
PR_SetPaths def defs new project=:{Project | built,inflist=infl=:((root=:{InfListItem | info={dir}}):!rest),prjpaths,saved}
PR_SetPaths def defs new project=:{Project | inflist=infl=:((root=:{InfListItem | info={dir}}):!rest),prjpaths,saved}
| def = {Project | project &
built = built && olddirs,
saved = saved && olddirs,
inflist = inflist1 };
= {Project | project &
built = built && olddirs,
saved = saved && unchanged && olddirs,
inflist = inflist1,
prjpaths = prjpaths1 };
......@@ -456,9 +450,6 @@ where
GetModulenames :: !InfListItem -> ((!Modulename,!String,!Modulename,!String),!Bool)
GetModulenames {mn,info={dir}}
= ((MakeDefPathname mn,dir,MakeImpPathname mn,dir),True)
PR_Built :: !Project -> Bool;
PR_Built project=:{Project | built} = built;
PR_SrcUpToDate :: !Modulename !Project -> Bool;
PR_SrcUpToDate modname project=:{inflist}
......@@ -485,12 +476,11 @@ PR_ExecUpToDate project=:{exec} = exec;
PR_Saved :: !Project -> Bool;
PR_Saved {Project | saved} = saved;
PR_AddRootModule :: !Bool !CodeGenOptions !ApplicationOptions !(List String) !LinkOptions
PR_AddRootModule :: !CodeGenOptions !ApplicationOptions !(List String) !LinkOptions
!Modulename !ModInfo -> Project;
PR_AddRootModule built cg ao prjs linkOptions mn info=:{dir}
PR_AddRootModule cg ao prjs linkOptions mn info=:{dir}
= { PR_InitProject
& built = built && dir <> ""
, saved = False
& saved = False
, exec = True
, execpath = ""
, code_gen_options_unchanged
......@@ -507,15 +497,15 @@ where
root = { mn = mn,info = info,src = True,abc = True };
PR_AddModule :: !Modulename !ModInfo !Project -> Project;
PR_AddModule mn info=:{dir} project=:{built,inflist=root:!rest}
= {project & built = built && dir<>"", inflist = root:!new:!rest};
PR_AddModule mn info=:{dir} project=:{inflist=root:!rest}
= {project & inflist = root:!new:!rest};
where
new = { mn = mn,
info = info,
src = True,
abc = True };
PR_AddModule mn info=:{dir} project=:{built,inflist=Nil}
= {project & built = built && dir<>"", inflist = new:!Nil};
PR_AddModule mn info=:{dir} project=:{inflist=Nil}
= {project & inflist = new:!Nil};
where
new = { mn = mn,
info = info,
......@@ -584,7 +574,7 @@ FindInList key ((itm=:{mn,info}):!rest) | mn <> key = FindInList key rest
SetProject :: !{#Char} !{#Char} !ProjectGlobalOptions -> Project
SetProject applicationDir project_file_dir
{ pg_built, pg_codegen, pg_application
{ pg_codegen, pg_application
, pg_projectPaths, pg_link, pg_mainModuleInfo={name, info}, pg_otherModules
, pg_target, pg_staticLibInfo, pg_execpath, pg_dynamic
, pg_root_directory, pg_precompile, pg_postlink
......@@ -593,7 +583,7 @@ SetProject applicationDir project_file_dir
# paths = ExpandPaths applicationDir project_dir pg_projectPaths
# linkOptions = ExpandLinkOptionsPaths applicationDir project_dir pg_link
# project = PR_AddRootModule pg_built pg_codegen pg_application paths linkOptions name (ExpandModuleInfoPaths applicationDir project_dir info)
# project = PR_AddRootModule pg_codegen pg_application paths linkOptions name (ExpandModuleInfoPaths applicationDir project_dir info)
# project = addModules pg_otherModules project_dir project
# staticLibInfo = ExpandStaticLibPaths applicationDir project_dir pg_staticLibInfo
# project = PR_SetStaticLibsInfo staticLibInfo project
......@@ -626,8 +616,7 @@ GetProject applicationDir project
linkOptions = SubstituteLinkOptionsPaths applicationDir project_dir (PR_GetLinkOptions project)
projectPaths = SubstitutePaths applicationDir project_dir (PR_GetPaths project)
staticLibInfo = SubstituteStaticLibPaths applicationDir project_dir (PR_GetStaticLibsInfo project)
= { pg_built = PR_Built project
, pg_codegen = PR_GetCodeGenOptions project
= { pg_codegen = PR_GetCodeGenOptions project
, pg_application = PR_GetApplicationOptions project
, pg_projectPaths = projectPaths
, pg_link = linkOptions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment