diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-04 11:59:27 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-04 12:00:07 +0100 |
| commit | 6171a0adfacdc5834f2fc2a9d885ba3ef3cc15d8 (patch) | |
| tree | 5ee9aaa0c073b7929ff799f81f230cd9e98b453b | |
| parent | 4a6ac884b50b7103b41a39800d16ef785e365245 (diff) | |
tools: working on compiler installer.
mpcc: output .64x for 64x0 assembly.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
| -rw-r--r-- | CompilerDriver/cc.cc | 6 | ||||
| -rw-r--r-- | CompilerFrontend/cl/compiler.d | 4 | ||||
| -rw-r--r-- | CompilerFrontend/cl/main.d | 4 | ||||
| -rw-r--r-- | CompilerFrontend/cl/makefile | 7 | ||||
| -rw-r--r-- | CompilerTools/.gitignore | 1 | ||||
| -rw-r--r-- | CompilerTools/install.d | 35 | ||||
| -rw-r--r-- | CompilerTools/makefile | 13 | ||||
| -rw-r--r-- | CompilerTools/test/.gitkeep | 0 |
8 files changed, 60 insertions, 10 deletions
diff --git a/CompilerDriver/cc.cc b/CompilerDriver/cc.cc index e908dc5..7d34875 100644 --- a/CompilerDriver/cc.cc +++ b/CompilerDriver/cc.cc @@ -156,7 +156,7 @@ static std::vector<detail::CompilerType> kCompilerVariables; static std::vector<std::string> kCompilerFunctions; static std::vector<detail::CompilerType> kCompilerTypes; -// @brief this hook code before the begin/end command. +// @brief this hook code before the start/end command. static std::string kAddIfAnyBegin; static std::string kAddIfAnyEnd; static std::string kLatestVar; @@ -1291,7 +1291,7 @@ cc_next_loop: cc_next: - // extern doesnt declare anything, it imports a variable. + // extern does not declare anything, it imports a variable. // so that's why it's not declare upper. if (ParserKit::find_word(ln, "extern")) { @@ -1668,7 +1668,7 @@ public: if (auto err = kCompilerBackend->Check(line_src.c_str(), src.CData()); err.empty()) { - kCompilerBackend->Compile(line_src.c_str(), src.CData()); + kCompilerBackend->Compile(line_src, src.CData()); } else { diff --git a/CompilerFrontend/cl/compiler.d b/CompilerFrontend/cl/compiler.d index d343a75..23cfd22 100644 --- a/CompilerFrontend/cl/compiler.d +++ b/CompilerFrontend/cl/compiler.d @@ -7,7 +7,7 @@ * ======================================================== */ -module cl.compiler; +module mpcc.compiler; ///Authors: amlel ///Bugs: None @@ -84,7 +84,7 @@ public class CompileCommand changed ~= ch; } - changed ~= ".masm"; + changed ~= ".64x"; mcc_summon_executable("/usr/local/bin/bin/masm -m64000 " ~ changed); } diff --git a/CompilerFrontend/cl/main.d b/CompilerFrontend/cl/main.d index ef57284..5ac541b 100644 --- a/CompilerFrontend/cl/main.d +++ b/CompilerFrontend/cl/main.d @@ -10,9 +10,9 @@ // @file main.d // @brief CLI of the X64000 C/C++ compiler -module cl.main; +module mpcc.main; -import cl.compiler; +import mpcc.compiler; import std.container.dlist; ///Authors: Amlal EL Mahrouss diff --git a/CompilerFrontend/cl/makefile b/CompilerFrontend/cl/makefile index e40f46d..fb269a5 100644 --- a/CompilerFrontend/cl/makefile +++ b/CompilerFrontend/cl/makefile @@ -1,12 +1,13 @@ # # ======================================================== # - # C++Kit + # MP-UX C Compiler # Copyright Western Company, all rights reserved. # # ======================================================== # -.PHONY: mcc-build -mcc-build: +# build mpcc +.PHONY: mpcc-build +mpcc-build: dmd -I../ $(wildcard *.d) -ofmpcc
\ No newline at end of file diff --git a/CompilerTools/.gitignore b/CompilerTools/.gitignore new file mode 100644 index 0000000..3ad4db2 --- /dev/null +++ b/CompilerTools/.gitignore @@ -0,0 +1 @@ +test/*.txt
\ No newline at end of file diff --git a/CompilerTools/install.d b/CompilerTools/install.d new file mode 100644 index 0000000..3770eaf --- /dev/null +++ b/CompilerTools/install.d @@ -0,0 +1,35 @@ +/* + * ======================================================== + * + * MP-UX C Compiler + * Copyright Western Company, all rights reserved. + * + * ======================================================== + */ + +module mpcc.install; + +///Author: amlel +///This helps install the mp-ux toolchain. +class InstallFactory +{ + this(string where, string from) + { + import std; + import std.file; + + try + { + from.copy(where); + } + catch(Exception e) + { + writeln("install.d: error: ", e.msg); + } + } +} + +void main(string[] args) +{ + auto factory = new InstallFactory(args[1], args[2]); +} diff --git a/CompilerTools/makefile b/CompilerTools/makefile new file mode 100644 index 0000000..b3a1aef --- /dev/null +++ b/CompilerTools/makefile @@ -0,0 +1,13 @@ + # + # ======================================================== + # + # MP-UX Tools + # Copyright Western Company, all rights reserved. + # + # ======================================================== + # + +# build mpcc +.PHONY: build-installer +build-installer: + dmd -I../ install.d -ofinstall.out
\ No newline at end of file diff --git a/CompilerTools/test/.gitkeep b/CompilerTools/test/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/CompilerTools/test/.gitkeep |
