From 80ecd9dcd3d3b75ef46a2f48a309b7458adeb58c Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Tue, 11 Nov 2025 10:40:17 +0100 Subject: Change the database name Also properly define it at compile-time. Later, it will likely be moved to "$HOME/.cache/ftag/ftag.sqlite3". --- Makefile | 7 ++++--- src/main.c | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2619f92..288082b 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ +export FTAG_ROOT := $(shell pwd) +export __CFLAGS := -std=c99 -Wall -DFTAG_ROOT=\"$(FTAG_ROOT)\" +export __LIBS := $(shell pkg-config --libs sqlite3) + export PROG ?= ftag export CFLAGS ?= -O0 -g3 -export __CFLAGS := -std=c99 -Wall -export __LIBS := $(shell pkg-config --libs sqlite3) -export FTAG_ROOT := $(shell pwd) all: $(PROG) diff --git a/src/main.c b/src/main.c index 6afa907..dd047e2 100644 --- a/src/main.c +++ b/src/main.c @@ -4,7 +4,7 @@ #include #include -#define DATABASE_PATH "ftag.db" +#define DATABASE_PATH (FTAG_ROOT "/ftag.sqlite3") static void ftag_init(int, char **); static void ftag_help(int, char **); @@ -43,6 +43,8 @@ static void ftag_help(int, char **) printf("Available values for COMMAND:\n"); printf(" init initialize the database\n"); printf(" help print this message\n"); + printf("Configuration:\n"); + printf(" database path %s\n", DATABASE_PATH); } static void parse_args(int argc, -- cgit v1.2.3