diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-29 17:27:19 -0500 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-29 17:27:19 -0500 |
| commit | dad25544802de6d4cd839f5d6d5753ad7faeef97 (patch) | |
| tree | ac60308829c163689c47da059d5de14296d81f4e /tools | |
| parent | bdef578a578177ce95c01fa061a028292556ecbe (diff) | |
chore: update general specs and citation file, breaking project structure changes as well.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/asm.cc | 96 | ||||
| -rw-r--r-- | tools/asm.json | 12 | ||||
| -rw-r--r-- | tools/cppdrv.cc | 27 | ||||
| -rw-r--r-- | tools/cppdrv.json | 12 | ||||
| -rw-r--r-- | tools/dbg.cc | 18 | ||||
| -rw-r--r-- | tools/dbg.json | 12 | ||||
| -rw-r--r-- | tools/kdbg.cc | 18 | ||||
| -rw-r--r-- | tools/kdbg.json | 12 | ||||
| -rw-r--r-- | tools/ld64.cc | 16 | ||||
| -rw-r--r-- | tools/ld64.json | 12 | ||||
| -rw-r--r-- | tools/pef-amd64-cxxdrv.cc | 40 | ||||
| -rw-r--r-- | tools/pef-amd64-cxxdrv.json | 19 | ||||
| -rw-r--r-- | tools/pef-arm64-cdrv.cc | 49 | ||||
| -rw-r--r-- | tools/pef-arm64-cdrv.json | 19 |
14 files changed, 0 insertions, 362 deletions
diff --git a/tools/asm.cc b/tools/asm.cc deleted file mode 100644 index 025b158..0000000 --- a/tools/asm.cc +++ /dev/null @@ -1,96 +0,0 @@ -/* ======================================== - - Copyright (C) 2024-2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license - -======================================== */ - -/// @file asm.cc -/// @brief Assembler frontend. - -#include <CompilerKit/Defines.h> -#include <CompilerKit/Version.h> -#include <cstring> -#include <vector> - -CK_IMPORT_C Int32 AssemblerMainPower64(Int32 argc, Char const* argv[]); -CK_IMPORT_C Int32 AssemblerMainARM64(Int32 argc, Char const* argv[]); -CK_IMPORT_C Int32 AssemblerMain64x0(Int32 argc, Char const* argv[]); -CK_IMPORT_C Int32 AssemblerMainAMD64(Int32 argc, Char const* argv[]); - -enum AsmKind : Int32 { - kInvalidAssembler = 0, - kX64Assembler = 100, - k64X0Assembler, - kPOWER64Assembler, - kARM64Assembler, - kAssemblerCount = kARM64Assembler - kX64Assembler + 1, -}; - -Int32 main(Int32 argc, Char const* argv[]) { - std::vector<const Char*> arg_vec_cstr; - arg_vec_cstr.push_back(argv[0]); - - const Int32 kInvalidAssembler = -1; - Int32 asm_type = kInvalidAssembler; - - for (size_t index_arg = 1; index_arg < argc; ++index_arg) { - if (strstr(argv[index_arg], "-asm:h")) { - std::printf("asm: Frontend Assembler (64x0, power64, arm64, x64).\n"); - std::printf("asm: Version: %s, Release: %s.\n", kDistVersion, kDistRelease); - std::printf( - "asm: Designed by Amlal El Mahrouss, Copyright (C) 2024-2025 Amlal El Mahrouss, all " - "rights reserved.\n"); - std::printf( - "CompilerKit: Designed by Amlal El Mahrouss, Copyright (C) 2024-2025 Amlal El Mahrouss, " - "Licensed under the Apache 2.0 license.\n"); - - return 0; - } else if (strstr(argv[index_arg], "-asm:x64")) { - asm_type = kX64Assembler; - } else if (strstr(argv[index_arg], "-asm:aarch64")) { - asm_type = kARM64Assembler; - } else if (strstr(argv[index_arg], "-asm:64x0")) { - asm_type = k64X0Assembler; - } else if (strstr(argv[index_arg], "-asm:power64")) { - asm_type = kPOWER64Assembler; - } else { - arg_vec_cstr.push_back(argv[index_arg]); - } - } - - switch (asm_type) { - case kPOWER64Assembler: { - if (int32_t code = AssemblerMainPower64(arg_vec_cstr.size(), arg_vec_cstr.data()); code) { - std::printf("asm: frontend exited with code %i.\n", code); - return code; - } - break; - } - case k64X0Assembler: { - if (int32_t code = AssemblerMain64x0(arg_vec_cstr.size(), arg_vec_cstr.data()); code) { - std::printf("asm: frontend exited with code %i.\n", code); - return code; - } - break; - } - case kARM64Assembler: { - if (int32_t code = AssemblerMainARM64(arg_vec_cstr.size(), arg_vec_cstr.data()); code) { - std::printf("asm: frontend exited with code %i.\n", code); - return code; - } - break; - } - case kX64Assembler: { - if (int32_t code = AssemblerMainAMD64(arg_vec_cstr.size(), arg_vec_cstr.data()); code) { - std::printf("asm: frontend exited with code %i.\n", code); - return code; - } - break; - } - default: { - return EXIT_FAILURE; - } - } - - return EXIT_SUCCESS; -} diff --git a/tools/asm.json b/tools/asm.json deleted file mode 100644 index e322800..0000000 --- a/tools/asm.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compiler_path": "clang++", - "compiler_std": "c++20", - "headers_path": ["../src/CompilerKit", "../src/", "../src/CompilerKit/src/Detail"], - "sources_path": ["asm.cc"], - "output_name": "asm", - "compiler_flags": ["-L/usr/lib", "-lCompilerKit"], - "cpp_macros": [ - "__ASM__=202401", - "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" - ] -} diff --git a/tools/cppdrv.cc b/tools/cppdrv.cc deleted file mode 100644 index 2cccf2b..0000000 --- a/tools/cppdrv.cc +++ /dev/null @@ -1,27 +0,0 @@ -/* ======================================== - - Copyright (C) 2024-2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license - -======================================== */ - -/// @file cxxdrv.cc -/// @brief NeCTI frontend preprocessor. - -#include <CompilerKit/Defines.h> -#include <CompilerKit/ErrorID.h> -#include <CompilerKit/Version.h> -#include <cstring> -#include <iostream> -#include <vector> - -CK_IMPORT_C int CPlusPlusPreprocessorMain(int argc, char const* argv[]); - -int main(int argc, char const* argv[]) { - if (auto code = CPlusPlusPreprocessorMain(argc, argv); code > 0) { - std::printf("cppdrv: preprocessor exited with code %i.\n", code); - - return NECTI_EXEC_ERROR; - } - - return NECTI_SUCCESS; -} diff --git a/tools/cppdrv.json b/tools/cppdrv.json deleted file mode 100644 index 6bef999..0000000 --- a/tools/cppdrv.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compiler_path": "clang++", - "compiler_std": "c++20", - "headers_path": ["../src/CompilerKit", "../src/", "../src/CompilerKit/src/Detail"], - "sources_path": ["cppdrv.cc"], - "output_name": "cppdrv", - "compiler_flags": ["-L/usr/local/lib", "-lCompilerKit"], - "cpp_macros": [ - "__CPPDRV__=202504", - "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" - ] -} diff --git a/tools/dbg.cc b/tools/dbg.cc deleted file mode 100644 index a54c59e..0000000 --- a/tools/dbg.cc +++ /dev/null @@ -1,18 +0,0 @@ -/* ======================================== - - Copyright (C) 2024-2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license - -======================================== */ - -#include <CompilerKit/Defines.h> - -/// @file dbg.cc -/// @brief NeCTI debugger. - -CK_IMPORT_C Int32 DebuggerMachPOSIX(Int32 argc, Char const* argv[]); - -/// @brief Debugger entrypoint. -/// @return Status code of debugger. -Int32 main(Int32 argc, Char const* argv[]) { - return DebuggerMachPOSIX(argc, argv); -} diff --git a/tools/dbg.json b/tools/dbg.json deleted file mode 100644 index 50feaf3..0000000 --- a/tools/dbg.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compiler_path": "clang++", - "compiler_std": "c++20", - "headers_path": ["../src/CompilerKit", "../src/", "../src/CompilerKit/src/Detail"], - "sources_path": ["dbg.cc"], - "output_name": "dbg", - "compiler_flags": ["-L/usr/lib", "-lDebuggerKit"], - "cpp_macros": [ - "__DBG__=202401", - "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" - ] -} diff --git a/tools/kdbg.cc b/tools/kdbg.cc deleted file mode 100644 index 4ee508d..0000000 --- a/tools/kdbg.cc +++ /dev/null @@ -1,18 +0,0 @@ -/* ======================================== - - Copyright (C) 2024-2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license - -======================================== */ - -#include <CompilerKit/Defines.h> - -/// @file kdbg.cc -/// @brief NeKernel debugger. - -CK_IMPORT_C Int32 DebuggerNeKernel(Int32 argc, Char const* argv[]); - -/// @brief Debugger entrypoint. -/// @return Status code of debugger. -Int32 main(Int32 argc, Char const* argv[]) { - return DebuggerNeKernel(argc, argv); -} diff --git a/tools/kdbg.json b/tools/kdbg.json deleted file mode 100644 index 6828cef..0000000 --- a/tools/kdbg.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compiler_path": "clang++", - "compiler_std": "c++20", - "headers_path": ["../src/CompilerKit", "../src/", "../src/CompilerKit/src/Detail"], - "sources_path": ["kdbg.cc"], - "output_name": "kdbg", - "compiler_flags": ["-L/usr/lib", "-lDebuggerKit"], - "cpp_macros": [ - "__DBG__=202401", - "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" - ] -} diff --git a/tools/ld64.cc b/tools/ld64.cc deleted file mode 100644 index 1f0392d..0000000 --- a/tools/ld64.cc +++ /dev/null @@ -1,16 +0,0 @@ -/* ======================================== - - Copyright (C) 2024-2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license - -======================================== */ - -#include <CompilerKit/Defines.h> - -/// @file ld64.cc -/// @brief NeCTI linker for AE objects. - -CK_IMPORT_C Int32 DynamicLinker64PEF(Int32 argc, Char const* argv[]); - -Int32 main(Int32 argc, Char const* argv[]) { - return DynamicLinker64PEF(argc, argv); -} diff --git a/tools/ld64.json b/tools/ld64.json deleted file mode 100644 index b509926..0000000 --- a/tools/ld64.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compiler_path": "clang++", - "compiler_std": "c++20", - "headers_path": ["../src/CompilerKit", "../src/", "../src/CompilerKit/src/Detail"], - "sources_path": ["ld64.cc"], - "output_name": "ld64", - "compiler_flags": ["-L/usr/lib", "-lCompilerKit"], - "cpp_macros": [ - "__LD64__=202401", - "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" - ] -} diff --git a/tools/pef-amd64-cxxdrv.cc b/tools/pef-amd64-cxxdrv.cc deleted file mode 100644 index 3fc41fe..0000000 --- a/tools/pef-amd64-cxxdrv.cc +++ /dev/null @@ -1,40 +0,0 @@ -/* ======================================== - - Copyright (C) 2024-2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license - -======================================== */ - -/// @file cxxdrv.cc -/// @brief NeCTI C++ frontend compiler. - -#include <CompilerKit/Defines.h> -#include <CompilerKit/ErrorID.h> -#include <CompilerKit/Version.h> -#include <CompilerKit/utils/CompilerUtils.h> -#include <CompilerKit/utils/DylibHelpers.h> - -#ifdef __APPLE__ -static auto kPath = "/usr/local/lib/libCompilerKit.dylib"; -#else -static auto kPath = "/usr/lib/libCompilerKit.so"; -#endif - -static auto kSymbol = "CompilerCPlusPlusAMD64"; - -Int32 main(Int32 argc, Char const* argv[]) { - CompilerKitDylibTraits dylib; - dylib(kPath, kSymbol); - - CompilerKitEntrypoint entrypoint_cxx = (CompilerKitEntrypoint) dylib.fEntrypoint; - - if (!entrypoint_cxx) { - kStdOut; - std::printf("error: Could not find entrypoint in %s: %s\n", kPath, dlerror()); - - return EXIT_FAILURE; - } - - auto ret = (entrypoint_cxx(argc, argv) == NECTI_SUCCESS) ? EXIT_SUCCESS : EXIT_FAILURE; - - return ret; -} diff --git a/tools/pef-amd64-cxxdrv.json b/tools/pef-amd64-cxxdrv.json deleted file mode 100644 index 9d1f360..0000000 --- a/tools/pef-amd64-cxxdrv.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compiler_path": "clang++", - "compiler_std": "c++20", - "headers_path": [ - "../src/CompilerKit", - "../src/", - "../src/CompilerKit/src/Detail" - ], - "sources_path": [ - "pef-amd64-cxxdrv.cc" - ], - "output_name": "pef-amd64-cxxdrv", - "compiler_flags": [ - ], - "cpp_macros": [ - "__CXXDRV__=202504", - "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" - ] -}
\ No newline at end of file diff --git a/tools/pef-arm64-cdrv.cc b/tools/pef-arm64-cdrv.cc deleted file mode 100644 index 0a4a9af..0000000 --- a/tools/pef-arm64-cdrv.cc +++ /dev/null @@ -1,49 +0,0 @@ -/* ======================================== - - Copyright (C) 2024-2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license - -======================================== */ - -/// @file cxxdrv.cc -/// @brief NeCTI C++ frontend compiler. - -#include <CompilerKit/Defines.h> -#include <CompilerKit/ErrorID.h> -#include <CompilerKit/Version.h> -#include <CompilerKit/utils/CompilerUtils.h> -#include <CompilerKit/utils/DylibHelpers.h> - -#ifdef __APPLE__ -static auto kPath = "/usr/local/lib/libCompilerKit.dylib"; -#else -static auto kPath = "/usr/lib/libCompilerKit.so"; -#endif - -static auto kSymbol = "CompilerCLangARM64"; - -Int32 main(Int32 argc, Char const* argv[]) { - CompilerKitDylib handler = dlopen(kPath, RTLD_LAZY | RTLD_GLOBAL); - - if (!handler) { - kStdOut; - std::printf("error: Could not load dylib in %s: %s\n", kPath, dlerror()); - - return EXIT_FAILURE; - } - - CompilerKitEntrypoint entrypoint_cxx = (CompilerKitEntrypoint) dlsym(handler, kSymbol); - - if (!entrypoint_cxx) { - kStdOut; - std::printf("error: Could not find entrypoint in %s: %s\n", kPath, dlerror()); - dlclose(handler); - - return EXIT_FAILURE; - } - - auto ret = (entrypoint_cxx(argc, argv) == NECTI_SUCCESS) ? EXIT_SUCCESS : EXIT_FAILURE; - - dlclose(handler); - - return ret; -} diff --git a/tools/pef-arm64-cdrv.json b/tools/pef-arm64-cdrv.json deleted file mode 100644 index f7186e3..0000000 --- a/tools/pef-arm64-cdrv.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compiler_path": "clang++", - "compiler_std": "c++20", - "headers_path": [ - "../src/CompilerKit", - "../src/", - "../src/CompilerKit/src/Detail" - ], - "sources_path": [ - "pef-arm64-cdrv.cc" - ], - "output_name": "pef-arm64-cdrv", - "compiler_flags": [ - ], - "cpp_macros": [ - "__CXXDRV__=202504", - "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" - ] -}
\ No newline at end of file |
