Commit d7dc7b05 authored by Mart Lubbers's avatar Mart Lubbers
Browse files

cpm: Allow multiple modules in compile and document

parent 418cc580
Pipeline #17737 passed with stage
in 44 seconds
...@@ -17,7 +17,7 @@ from PmTypes import ::Pathname,::Output ...@@ -17,7 +17,7 @@ from PmTypes import ::Pathname,::Output
= CreateProject = CreateProject
| ShowProject | ShowProject
| BuildProject Bool FilePath | BuildProject Bool FilePath
| Compile !String | Compile [String]
| ProjectPath PathAction | ProjectPath PathAction
| SetRelativeRoot String | SetRelativeRoot String
| SetTarget String | SetTarget String
......
...@@ -127,15 +127,15 @@ doProjectAction cleanhome pwd pn (BuildProject force ideenvs) world ...@@ -127,15 +127,15 @@ doProjectAction cleanhome pwd pn (BuildProject force ideenvs) world
pinit force_rebuild gst = BringProjectUptoDate force_rebuild cleanup gst pinit force_rebuild gst = BringProjectUptoDate force_rebuild cleanup gst
cleanup exepath bool1 bool2 ps = abortLog (not bool2) "" ps cleanup exepath bool1 bool2 ps = abortLog (not bool2) "" ps
doProjectAction cleanhome pwd pn (Compile module_name) world doProjectAction cleanhome pwd pn (Compile module_names) world
# (envs, world) = readIDEEnvs cleanhome EnvsFileName world # (envs, world) = readIDEEnvs cleanhome EnvsFileName world
(project_path, project, ok, world) = openProject pwd pn cleanhome world (project_path, project, ok, world) = openProject pwd pn cleanhome world
| not ok | not ok
= world = world
# (console, world) = stdio world # (console, world) = stdio world
iniGeneral = initGeneral False compilerOptions cleanhome project_path project envs console iniGeneral = initGeneral False compilerOptions cleanhome project_path project envs console
gst = {ls=iniGeneral,gst_world=world,gst_continue_or_stop=False} gst = {ls=iniGeneral,gst_world=world,gst_continue_or_stop=False}
gst = CompileProjectModule Compilation module_name project (\ _ _ _ gst -> gst) gst gst = foldl (\gst module_name->CompileProjectModule Compilation module_name project (\_ _ _ gst->gst) gst) gst module_names
= gst.gst_world = gst.gst_world
doProjectAction cleanhome pwd pn (ProjectPath pa) world doProjectAction cleanhome pwd pn (ProjectPath pa) world
...@@ -205,6 +205,7 @@ doProjectAction _ _ _ _ world = ...@@ -205,6 +205,7 @@ doProjectAction _ _ _ _ world =
help "cpm project <projectfile> <action>" help "cpm project <projectfile> <action>"
[ "Where <action> is one of the following" [ "Where <action> is one of the following"
, " create : create a new project" , " create : create a new project"
, " compile <modulename> [..] : compile the given modules"
, " show : show project information" , " show : show project information"
, " build [--force] [--envs=filename] : build the project. Optionally force build (default: 'false')" , " build [--force] [--envs=filename] : build the project. Optionally force build (default: 'false')"
, " Optionally specify the environments file (default: 'IDEEnvs')" , " Optionally specify the environments file (default: 'IDEEnvs')"
...@@ -213,7 +214,11 @@ doProjectAction _ _ _ _ world = ...@@ -213,7 +214,11 @@ doProjectAction _ _ _ _ world =
, " : . is the same dir, .. the parent, ... the grandparent, etc." , " : . is the same dir, .. the parent, ... the grandparent, etc."
, " target <env> : set target environment to <env>" , " target <env> : set target environment to <env>"
, " exec <execname> : set executable name to <execname>" , " exec <execname> : set executable name to <execname>"
, " set option [option] : Set one or more of the following options:" , " set <option> [<option>] : Set one or more of the following options:"
, " : -h SIZE"
, " : Change the heapsize (e.g. 2M)"
, " : -s SIZE"
, " : Change the stacksize (e.g. 200K)"
, " : -generic_fusion,-ngeneric_fusion" , " : -generic_fusion,-ngeneric_fusion"
, " : Enable or disable generic fusion" , " : Enable or disable generic fusion"
, " : -strip,-nstrip" , " : -strip,-nstrip"
......
...@@ -22,7 +22,8 @@ parse_Project ["create"] project_name = Project project_name CreateProject; ...@@ -22,7 +22,8 @@ parse_Project ["create"] project_name = Project project_name CreateProject;
parse_Project ["show"] project_name = Project project_name ShowProject; parse_Project ["show"] project_name = Project project_name ShowProject;
parse_Project ["build":project_build_args] project_name parse_Project ["build":project_build_args] project_name
= parse_Project_build_args project_build_args False EnvsFileName project_name (Project "" ProjectHelp); = parse_Project_build_args project_build_args False EnvsFileName project_name (Project "" ProjectHelp);
parse_Project ["compile",s] project_name = Project project_name (Compile s); parse_Project ["compile":s] project_name
| length s <> 0 = Project project_name (Compile s);
parse_Project ["path":project_path_args] project_name = parse_Project_path_args project_path_args project_name; parse_Project ["path":project_path_args] project_name = parse_Project_path_args project_path_args project_name;
parse_Project ["root",s] project_name parse_Project ["root",s] project_name
| size s > 0 && and [c == '.'\\ c<-:s] | size s > 0 && and [c == '.'\\ c<-:s]
......
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