new build system
This commit is contained in:
parent
c0ca81418b
commit
8a0923f28a
5 changed files with 36 additions and 23 deletions
BIN
bin/main
Executable file
BIN
bin/main
Executable file
Binary file not shown.
6
build.sh
Executable file
6
build.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
c_files=$(find src -name '*.c')
|
||||
|
||||
mkdir -p bin
|
||||
clang ${c_files} -o bin/main
|
||||
20
meson.build
20
meson.build
|
|
@ -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
|
||||
]
|
||||
)
|
||||
18
src/main.c
18
src/main.c
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
15
src/main.h
15
src/main.h
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue