1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-05-14 23:18:37 +03:00
inform7/inbuild/supervisor-module/Chapter 3/Inform6 Skill.w

39 lines
1.3 KiB
OpenEdge ABL
Raw Normal View History

2020-02-24 01:49:56 +02:00
[Inform6Skill::] Inform6 Skill.
2020-03-30 14:23:06 +03:00
The skill of compiling Inform 6 into a story file for the target VM.
2020-02-24 01:49:56 +02:00
2020-03-30 14:23:06 +03:00
@ This can only be performed via the shell, as the Inform 6 compiler is never
part of the executables of the more modern Inform tools, and so can't be
called as a function.
=
2020-02-24 01:49:56 +02:00
build_skill *compile_using_inform6_skill = NULL;
void Inform6Skill::create(void) {
2020-03-30 14:23:06 +03:00
compile_using_inform6_skill =
BuildSteps::new_skill(I"compile using inform6");
METHOD_ADD(compile_using_inform6_skill, BUILD_SKILL_COMMAND_MTID,
Inform6Skill::inform6_via_shell);
2020-02-24 01:49:56 +02:00
}
2020-03-30 14:23:06 +03:00
int Inform6Skill::inform6_via_shell(build_skill *skill, build_step *S,
text_stream *command, build_methodology *BM, linked_list *search_list) {
2020-03-30 14:23:06 +03:00
Shell::quote_file(command, BM->to_inform6);
2020-02-24 01:49:56 +02:00
2022-12-08 01:28:26 +02:00
inform_project *project = Projects::from_copy(S->associated_copy);
2020-02-24 01:49:56 +02:00
if (project == NULL) internal_error("no project");
pathname *build = Pathnames::down(project->as_copy->location_if_path, I"Build");
filename *inf_F = Filenames::in(build, I"auto.inf");
2020-02-24 01:49:56 +02:00
WRITE_TO(command, "-kE2S");
if (TargetVMs::debug_enabled((S->for_vm))) WRITE_TO(command, "D");
text_stream *ext = TargetVMs::get_unblorbed_extension(S->for_vm);
if (Str::eq(ext, I"ulx")) ext = I"G";
WRITE_TO(command, "w%S ", ext);
Shell::quote_file(command, inf_F);
2020-03-30 14:23:06 +03:00
Shell::quote_file(command, S->vertex->as_file);
2020-02-24 01:49:56 +02:00
return TRUE;
}