diff options
| author | Amlal El Mahrouss <113760121+Amlal-ElMahrouss@users.noreply.github.com> | 2024-03-19 21:03:14 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <113760121+Amlal-ElMahrouss@users.noreply.github.com> | 2024-03-19 21:03:14 +0100 |
| commit | bb46b236ad72934469060706afe7cc3708cc299b (patch) | |
| tree | 38fa8b570c183d5a39c49fe7feec67a9856defcd /Private/Frontend/Compiler | |
| parent | d4e878c1facf7bbd5b35d36840fb0a28460528c5 (diff) | |
Compiler(Secret): Major commit
What is needed:
- Finish AMD64 assembler.
- Work on a C++ compiler.
- Work on a installer wizard.
Diffstat (limited to 'Private/Frontend/Compiler')
| -rw-r--r-- | Private/Frontend/Compiler/compiler_command.d | 42 | ||||
| -rw-r--r-- | Private/Frontend/Compiler/compiler_start.d | 12 | ||||
| -rw-r--r-- | Private/Frontend/Compiler/makefile | 2 | ||||
| -rw-r--r-- | Private/Frontend/Compiler/man/mpcc.8 | 2 |
4 files changed, 20 insertions, 38 deletions
diff --git a/Private/Frontend/Compiler/compiler_command.d b/Private/Frontend/Compiler/compiler_command.d index ecc3e1e..ef84919 100644 --- a/Private/Frontend/Compiler/compiler_command.d +++ b/Private/Frontend/Compiler/compiler_command.d @@ -1,7 +1,7 @@ /* * ======================================================== * - * MP-UX C Compiler + * MultiProcessor C Compiler * Copyright Mahrouss Logic, all rights reserved. * * ======================================================== @@ -28,32 +28,16 @@ public class Platform { public static string getIncludePath() { - import core.stdc.stdlib; - import std.string; - import std.conv; - import std.path; - - string pathHome = expandTilde("~"); - pathHome ~= "/mp-ux/libc/"; - - return pathHome; + return "C:/SDK/Public/Kits/"; } public static string getKernelPath() { - import core.stdc.stdlib; - import std.string; - import std.conv; - import std.path; - - string pathHome = expandTilde("~"); - pathHome ~= "/mp-ux/mp-ux/"; - - return pathHome; + return "C:/SDK/Private/Kits/"; } } -public class CompileCommand +public class CompileCommandAMD64 { public void compile(string includePath, string[] files, bool is_lib, string output, bool compile_only) { @@ -67,23 +51,23 @@ public class CompileCommand import std.datetime; - string input = "/usr/local/bin/bin/cpp"; + string input = "bpp"; string[] arr_macros = CompilerMacroHelpers.getStandardMacros(); foreach (string macro_name; arr_macros) { - input ~= " --define "; + input ~= " -define "; input ~= macro_name; input ~= "1 "; input ~= " "; } - input ~= "--define __FILE__ " ~ file; + input ~= "-define __FILE__ " ~ file; input ~= " "; - input ~= "--define __DATE__ " ~ Clock.currTime(UTC()).toString(); + input ~= "-define __DATE__ " ~ Clock.currTime(UTC()).toString(); input ~= " "; - input ~= "--working-dir ./ --include-dir " ~ includePath ~ " " ~ file; + input ~= "-working-dir ./ -include-dir " ~ includePath ~ " " ~ file; mpcc_summon_executable(input); @@ -105,12 +89,12 @@ public class CompileCommand ext ~= ch; } - mpcc_summon_executable("/usr/local/bin/bin/ccplus --asm=masm -fmax-exceptions 10 --compiler=vanhalen " ~ + mpcc_summon_executable("ccplus -fmax-exceptions 10 " ~ file ~ ".pp"); - assembly_source ~= ".64x"; + assembly_source ~= ".s"; - mpcc_summon_executable("/usr/local/bin/bin/64asm " ~ assembly_source); + mpcc_summon_executable("i64asm " ~ assembly_source); } if (compile_only) @@ -147,6 +131,6 @@ public class CompileCommand output_object ~= " -o "; output_object ~= output; - mpcc_summon_executable("/usr/local/bin/bin/ld " ~ obj ~ output_object); + mpcc_summon_executable("link -amd64 " ~ obj ~ output_object); } } diff --git a/Private/Frontend/Compiler/compiler_start.d b/Private/Frontend/Compiler/compiler_start.d index 002bb16..300beac 100644 --- a/Private/Frontend/Compiler/compiler_start.d +++ b/Private/Frontend/Compiler/compiler_start.d @@ -1,7 +1,7 @@ /* * ======================================================== * - * MP-UX C Compiler + * MultiProcessor C Compiler * Copyright Mahrouss Logic, all rights reserved. * * ======================================================== @@ -24,8 +24,6 @@ void mpcc_summon_manual(string path) import std.file; string base = "man "; - base ~= "/usr/local/bin/man/"; - string extension = ".8"; core.stdc.stdlib.system(toStringz(base ~ path ~ extension)); @@ -38,7 +36,7 @@ void main(string[] args) bool shared_library = false; bool compile_only = false; bool kernel_driver = false; - string output_file = "a.out"; + string output_file = "Executable.exe"; size_t index = 0UL; string[255] args_list; @@ -55,7 +53,7 @@ void main(string[] args) } else if (arg == "-dialect") { - mpcc_summon_executable("/usr/local/bin/bin/ccplus --asm=masm --compiler=vanhalen --dialect"); + mpcc_summon_executable("ccplus --pdialect"); return; } else if (arg == "--help" || @@ -78,7 +76,7 @@ void main(string[] args) } else if (arg == "-shared") { - output_file = "a.lib"; + output_file = "Library.lib"; shared_library = true; continue; } @@ -103,7 +101,7 @@ void main(string[] args) return; } - auto compiler = new CompileCommand(); + auto compiler = new CompileCommandAMD64(); if (kernel_driver) compiler.compile(Platform.getKernelPath(), args_list, shared_library, output_file, compile_only); diff --git a/Private/Frontend/Compiler/makefile b/Private/Frontend/Compiler/makefile index d0eeb3b..8a03fd0 100644 --- a/Private/Frontend/Compiler/makefile +++ b/Private/Frontend/Compiler/makefile @@ -1,7 +1,7 @@ # # ======================================================== # - # MP-UX C Compiler + # MultiProcessor C Compiler # Copyright Mahrouss Logic, all rights reserved. # # ======================================================== diff --git a/Private/Frontend/Compiler/man/mpcc.8 b/Private/Frontend/Compiler/man/mpcc.8 index a573128..370a49a 100644 --- a/Private/Frontend/Compiler/man/mpcc.8 +++ b/Private/Frontend/Compiler/man/mpcc.8 @@ -1,6 +1,6 @@ .Dd Jan 21, 2024 .Dt mpcc 1.11 -.Os MP-UX +.Os MultiProcessor .Sh NAME .Nm mpcc |
