From 4d2a2af0c7d4eec9a9e43e0ba08813fdebaf8f9c Mon Sep 17 00:00:00 2001 From: nasr Date: Tue, 14 Apr 2026 23:11:40 +0200 Subject: feature(setup): defininig the setup of the project --- build.sh | 0 source/base/base_rand.h | 0 source/base/base_string.c | 0 source/scb/scb.c | 8 +++++ source/scb/scb.h | 82 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 build.sh create mode 100644 source/base/base_rand.h create mode 100644 source/base/base_string.c create mode 100755 source/scb/scb.c create mode 100644 source/scb/scb.h diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..e69de29 diff --git a/source/base/base_rand.h b/source/base/base_rand.h new file mode 100644 index 0000000..e69de29 diff --git a/source/base/base_string.c b/source/base/base_string.c new file mode 100644 index 0000000..e69de29 diff --git a/source/scb/scb.c b/source/scb/scb.c new file mode 100755 index 0000000..d81f244 --- /dev/null +++ b/source/scb/scb.c @@ -0,0 +1,8 @@ +#include "scb.h" + +s32 main(s32 argument_count, char **argument, char **env) +{ + assert_msg(argument_count < 2, "no arguments passed to scb"); + init(argument_count, argument, env); + +} diff --git a/source/scb/scb.h b/source/scb/scb.h new file mode 100644 index 0000000..39f5e89 --- /dev/null +++ b/source/scb/scb.h @@ -0,0 +1,82 @@ +/* descrition: meta program, build tool + author: Abdellah El Morabit */ +#define BASE_UNITY +#include "../base/base_include.h" + +#define scbdef static + +typedef struct config config; + +struct config { + string8 compiler; + string8 output; + string8 flags[]; +}; + + +internal void +self_rebuild(const char *binary_path) +{ + + struct stat scb_binary_stats; + assert_msg((lstat(binary_path), &sb == -1),"\nlstat failed to initialize\n"); + + if(ctime(&sb.st_mtime)) + { + + } +} + +//@documentatie: hebfjlberln +internal void +init(int argument_count, char **argument, char **env) +{ + mem_arena *global_arena = arena_create(KiB(2)); + assert_msg(argument_count > 2, "no program passed"); + + string8 command = PushString(global_arena, Len(*argument[2])); + + command.data = (u8 *) *argument; + command.size = Len(*argument[2]); + + //- load files into buffer + { + + + + //- TODO(nasr): ... + } + + if(string8_cmp(command, StringCast("doc", 3))) + { + //- run meta program that builds tool documentation + //- hmmm how do i store the documentation + { + } + } + else if(string8_cmp(command, StringCast("build", 5))) + { + + + //- search for the binary in PATH + { + for(s32 index = 0; *env[index]; ++index) + { + + } + } + + //- run the simple build tool + pid_t pid = fork(); + assert_msg(pid == -1, "failed to start fork process"); + + + if(pid == 0) { + + } + } + else if(string8_cmp(command, StringCast("meta", 5))) + { + //- run the meta program + } +} -- cgit v1.3