new build system

This commit is contained in:
TheK0tYaRa 2025-06-15 00:57:10 +03:00
parent c0ca81418b
commit 8a0923f28a
5 changed files with 36 additions and 23 deletions

BIN
bin/main Executable file

Binary file not shown.

6
build.sh Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
c_files=$(find src -name '*.c')
mkdir -p bin
clang ${c_files} -o bin/main

View file

@ -1,20 +0,0 @@
project(
'thread_tree',
'C',
version: '0.0.1',
default_options: [ 'warning_level=3' ]
)
cmd = run_command('/usr/bin/find', 'src', '-name', '*.c')
c_files = cmd.stdout().splitlines()
cmd = run_command('/usr/bin/find', 'src', '-name', '*.h')
h_files = cmd.stdout().splitlines()
executable(
'thread_tree',
sources: [
c_files,
h_files
]
)

View file

@ -1,5 +1,21 @@
#include "main.h"
//
char *scanned_path;
//
void check_args(int argc, char *argv[]) {
char* _scanned_path;
if(argc > 1) {
_scanned_path=argv[1];
}else{
_scanned_path=".";
}
scanned_path=realpath(_scanned_path, NULL);
}
int main(int argc, char *argv[]) {
check_args(argc, argv);
printf("scanned path: %s\n",scanned_path);
//
path_node *parent_node=alloc;
//
return 0;
}

View file

@ -1,5 +1,16 @@
#ifndef __main_h__
#define __main_h__
#include <threads.h>
//
#include <pthread.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
//
struct path_node {
char *path;
uint size;
struct path_node *next;
};
//
#endif