From 7cd7876202746fded86d770fb77aea0f55b814d8 Mon Sep 17 00:00:00 2001 From: yuzu-eva Date: Tue, 25 Mar 2025 16:15:25 +0100 Subject: added db-setup script; fixed makefile --- Makefile | 5 +++-- README.md | 37 +++++++++++++++++++------------------ db-setup.sql | 12 ++++++++++++ 3 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 db-setup.sql diff --git a/Makefile b/Makefile index 846d202..c8b28bd 100644 --- a/Makefile +++ b/Makefile @@ -9,12 +9,13 @@ INSTALL_PROGRAM=install INSTALL_DATA=install -m 644 CFLAGS=-Wall -Wextra -O3 -ggdb +LIBS=-lsqlite3 BIN=myal all: $(BIN) myal: $(SRCDIR)/main.c - $(CC) $(CFLAGS) $(SRCDIR)/main.c -o myal + $(CC) $(CFLAGS) $(LIBS) $(SRCDIR)/main.c -o myal install: $(INSTALL_PROGRAM) myal $(PREFIX)$(BINDIR)/myal @@ -22,5 +23,5 @@ install: clean: $(RM) myal -distclean: clean +uninstall: $(RM) /usr/local/bin/myal diff --git a/README.md b/README.md index 3cc04ad..65914da 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,34 @@ # myal - My Anime Library -My Anime Library is a cli-tool written in C to manage an anime watchlist. +My Anime Library is a cli-tool written in C to manage an anime and manga list. I used to track which anime I have watched and what episode I'm on by writing in a text file, which got annoying after a while. -This is why I created a simple program to quickly search and change a -csv file. +This is why I created this tool to keep anime and manga organized in a sqlite3 +database. Is it a complete overkill to write this in C? Yes -Could this have been a simple bash script? Definitely - But why not? I wanted some practice with C, so if you see any glaring errors or -unsafe code feel free to point it out and roast me. - -This cli-tool works with csv files in the format - -name,episode,status +unsafe code feel free to point it out and roast me. -For example: +You need a database with tables `anime` and `manga`. Attached in this repo +is a setup script for the database. Simply execute +``` +sqlite3