Commit 8f495d1c authored by John van Groningen's avatar John van Groningen

add option to compile a module of a project

parent f6f5e582
......@@ -17,6 +17,7 @@ from PmTypes import ::Pathname,::Output
= CreateProject
| ShowProject
| BuildProject Bool FilePath
| Compile !String
| ProjectPath PathAction
| SetRelativeRoot String
| SetTarget String
......
......@@ -16,6 +16,7 @@ import AbsSyn,CpmPaths
* CleanIDE imports
*/
import UtilIO,IdeState,Platform,PmPath,PmEnvironment,PmProject,PmDriver
from PmCleanSystem import :: CompileOrCheckSyntax(..)
/**
* Execute a general CPM action
......@@ -122,6 +123,17 @@ doProjectAction cleanhome pwd pn (BuildProject force ideenvs) world
pinit force_rebuild gst = BringProjectUptoDate force_rebuild cleanup gst
cleanup exepath bool1 bool2 ps = abortLog (not bool2) "" ps
doProjectAction cleanhome pwd pn (Compile module_name) world
# (envs, world) = readIDEEnvs cleanhome EnvsFileName world
(project_path, project, ok, world) = openProject pwd pn cleanhome world
| not ok
= world
# (console, world) = stdio world
iniGeneral = initGeneral False compilerOptions cleanhome project_path project envs console
gst = {ls=iniGeneral,gst_world=world,gst_continue_or_stop=False}
gst = CompileProjectModule Compilation module_name project (\ _ _ _ gst -> gst) gst
= gst.gst_world
doProjectAction cleanhome pwd pn (ProjectPath pa) world
# (proj_path, project, ok, world) = openProject pwd pn cleanhome world
| not ok
......
......@@ -22,6 +22,7 @@ parse_Project ["create"] project_name = Project project_name CreateProject;
parse_Project ["show"] project_name = Project project_name ShowProject;
parse_Project ["build":project_build_args] project_name
= 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 ["path":project_path_args] project_name = parse_Project_path_args project_path_args project_name;
parse_Project ["root",s] project_name
| 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