diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c668ef0 --- /dev/null +++ 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 index 51c332c..509ef23 100644 --- 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 index a95c4df..149e65a 100644 --- a/config.h +++ b/config.h @@ -6,7 +6,7 @@ #define LICENSE_LINE \ "License BSD-3-Clause: BSD-3-Clause " #define AUTHORS "vx_clutch" -#define VERSION "alpha" +#define VERSION "1" #define YEAR 2025 #endif diff --git a/configure b/configure index 1cd93d2..13a8a15 100755 --- 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= 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 index 0d1b79e..264642e 100644 --- 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 index 8a68ba5..ab101c5 100644 --- 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 " + 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;