Merge (#7) from tomasriveral/versionFlagIsBroken Fix: version flag

Fix: version flag is now set with compiler flag
This commit is contained in:
2026-04-23 20:08:32 +02:00
committed by GitHub
3 changed files with 8 additions and 2 deletions
+3
View File
@@ -1,6 +1,9 @@
CC := gcc CC := gcc
VERSION := $(shell git describe --tags --always --dirty)
CFLAGS := -Wall -Wextra -O2 \ CFLAGS := -Wall -Wextra -O2 \
-DVERSION=\"$(VERSION)\" \
$(shell pkg-config --cflags libcjson ncurses) $(shell pkg-config --cflags libcjson ncurses)
LDFLAGS := $(shell pkg-config --libs libcjson ncurses) LDFLAGS := $(shell pkg-config --libs libcjson ncurses)
+1 -1
View File
@@ -322,7 +322,7 @@ for (int i = 1; i < argc; i++) {
return 0; return 0;
} else if (strcmp(arg, "--version") == 0) { } else if (strcmp(arg, "--version") == 0) {
printf("NoteWrapper version 1.0\n"); printf("NoteWrapper %s\n", VERSION);
return 0; return 0;
} else { } else {
+3
View File
@@ -18,6 +18,9 @@
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
#include <ftw.h> #include <ftw.h>
#ifndef VERSION
#define VERSION "dev"
#endif
#define BUFFER_SIZE 256 //standard buffer size. #define BUFFER_SIZE 256 //standard buffer size.
// the three supported values are "daily" "weekly" and "monthly" (for months we use the avarage lenght of a month in a non leap year). All values were calculated on my loyal TI-30 ECO RS // the three supported values are "daily" "weekly" and "monthly" (for months we use the avarage lenght of a month in a non leap year). All values were calculated on my loyal TI-30 ECO RS
#define DAILY 86400 #define DAILY 86400