From 45751c6e670f446c8869b762e866621dce4e09d3 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Sun, 1 Mar 2026 20:48:09 +0900 Subject: [PATCH] wip --- Makefile | 2 +- objs.sh | 2 +- src/main.c | 22 +++++++++++++++++++++- src/taiga.h | 8 ++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 src/taiga.h diff --git a/Makefile b/Makefile index 06723c2..aa006f4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CC = cc -CFLAGS = -I external/xemil/include +CFLAGS = -I external/xemil/include -I src LDFLAGS = LIBS = diff --git a/objs.sh b/objs.sh index 66811f0..3defe80 100755 --- a/objs.sh +++ b/objs.sh @@ -1,6 +1,6 @@ #!/bin/sh echo > objs.mk -ls external/xemil/src/*.c src/*.c | while read a; do +ls src/*.c external/xemil/src/*.c | while read a; do O="src/`echo "$a" | sed 's/.c$/.o/' | sed 's/\//_/g'`" echo "OBJS += $O" >> objs.mk echo "$O: $a" >> objs.mk diff --git a/src/main.c b/src/main.c index 7ed3361..321a74d 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,24 @@ -#include +#include int main(int argc, char** argv){ + int i; + char* action; + int target_argc = 0; + char** target_argv = malloc(sizeof(*target_argv)); + target_argv[0] = NULL; + + for(i = 1; i < argc; i++){ + if(argv[i][0] == '-'){ + if(action != NULL) continue; + }else{ + if(action != NULL) continue; + action = argv[i]; + + free(target_argv); + target_argc = argc - i - 1; + target_argv = &argv[i + 1]; + } + } + + if(action == NULL) action = "site"; } diff --git a/src/taiga.h b/src/taiga.h new file mode 100644 index 0000000..d751e10 --- /dev/null +++ b/src/taiga.h @@ -0,0 +1,8 @@ +#ifndef __TAIGA_H__ +#define __TAIGA_H__ + +#include +#include +#include + +#endif