/* 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 } }