commit a2bc8dd002d2cbc924cad8a1156f2872599fb93f
parent b62d6b1a618e8a80185a9ff3cdf5628535f027d8
Author: vx-clutch <[email protected]>
Date: Sat, 23 Aug 2025 15:12:21 -0400
fix warning
Diffstat:
6 files changed, 50 insertions(+), 10 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -0,0 +1,9 @@
+[submodule "foo/ncurses"]
+ path = foo/ncurses
+ url = https://github.com/mirror/ncurses
+[submodule "dd/ncurses"]
+ path = dd/ncurses
+ url = https://github.com/mirror/ncurses
+[submodule "dd/uthash"]
+ path = dd/uthash
+ url = https://github.com/troydhanson/uthash
diff --git a/Makefile b/Makefile
@@ -1,4 +1,4 @@
-prefix = /usr/bin
+PREFIX = /usr/bin
YAIT_SRCS := $(wildcard src/*.c)
YAIT_OBJS := $(patsubst src/%.c,build/obj/%.o,$(YAIT_SRCS))
@@ -27,13 +27,12 @@ $(YAIT): $(YAIT_OBJS)
endif
-install:
- @echo "NOT IMPL"
- exit 1
+install: $(YAIT)
+ mkdir -p $(DESTDIR)$(PREFIX)/bin
+ cp $(YAIT) $(DESTDIR)$(PREFIX)/bin/
uninstall:
- @echo "NOT IMPL"
- exit 1
+ $(RM) $(DESTDIR)$(PREFIX)/bin/yait
clean:
$(RM) -rf bin
diff --git a/config.h b/config.h
@@ -6,7 +6,7 @@
#define LICENSE_LINE \
"License BSD-3-Clause: BSD-3-Clause <https://opensource.org/license/bsd-3-clause>"
#define AUTHORS "vx_clutch"
-#define VERSION "alpha"
+#define VERSION "1"
#define YEAR 2025
#endif
diff --git a/configure b/configure
@@ -7,8 +7,11 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.
- CC C compiler command [detected]
- CFLAGS C compiler flags [-g, ...]
+ CC C compiler command [detected]
+ CFLAGS C compiler flags [-g, ...]
+ LDFLAGS C linker flags
+
+ --prefix=<path> Set the install path
EOF
exit 0
@@ -32,6 +35,7 @@ printf "%s\n" "$CC"
for arg ; do
case "$arg" in
--help|h) usage ;;
+--prefix=*) prefix=${arg#*=} ;;
CFLAGS=*) CFLAGS=${arg#*=} ;;
LDFLAGS=*) LDFLAGS=${arg#*=} ;;
CC=*) CC=${arg#*=} ;;
diff --git a/src/create_project.c b/src/create_project.c
@@ -113,5 +113,16 @@ int create_project(manifest_t manifest)
abort();
}
+ if (manifest.libraries.ncurses)
+ system("git submodule add --quiet https://github.com/mirror/ncurses");
+ if (manifest.libraries.raylib)
+ system("git submodule add --quiet https://github.com/raysan5/raylib");
+ if (manifest.libraries.stb)
+ system("git submodule add --quiet https://github.com/nothings/stb");
+ if (manifest.libraries.uthash)
+ system("git submodule add --quiet https://github.com/troydhanson/uthash");
+ if (manifest.libraries.linenoise)
+ system("git submodule add --quiet https://github.com/antirez/linenoise");
+
return 0;
}
diff --git a/src/main.c b/src/main.c
@@ -84,7 +84,24 @@ static int parse_arguments(manifest_t *conf, int argc, char **argv)
conf->licence = TOlicence(optarg);
break;
case 'l':
-#warning "Implement -l <lib>"
+ if (strcmp(optarg, "list") == 0) {
+ puts("ncurses\nraylib\nstb\nuthash\nlinenoise");
+ exit(EXIT_SUCCESS);
+ }
+ if (strcmp(optarg, "ncurses") == 0)
+ conf->libraries.ncurses = true;
+ else if (strcmp(optarg, "raylib") == 0)
+ conf->libraries.raylib = true;
+ else if (strcmp(optarg, "stb") == 0)
+ conf->libraries.stb = true;
+ else if (strcmp(optarg, "uthash") == 0)
+ conf->libraries.uthash = true;
+ else if (strcmp(optarg, "linenoise") == 0)
+ conf->libraries.linenoise = true;
+ else
+ fprintf(stderr,
+ "warning: %s is not a support library",
+ optarg);
break;
default:
return 1;