bump version info and add compile info to version

This commit is contained in:
2024-12-19 11:46:19 -06:00
parent 8ac77308f4
commit ec2591c926
3 changed files with 22 additions and 4 deletions

View File

@ -19,7 +19,7 @@ install: XD
chmod 755 $(PREFIX)/bin/XD chmod 755 $(PREFIX)/bin/XD
mkdir -p $(MANDIR)/man1 mkdir -p $(MANDIR)/man1
cp -f XD.1 $(MANDIR)/man1 cp -f XD.1 $(MANDIR)/man1
chmod 644 $(PREFIX)/man1/XD.1 chmod 644 $(MANDIR)/man1/XD.1
uninstall: XD uninstall: XD
rm -f $(PREFIX)/bin/XD $(MANDIR)/man1/XD.1 rm -f $(PREFIX)/bin/XD $(MANDIR)/man1/XD.1

12
XD.c
View File

@ -1,8 +1,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#ifdef ERR #ifdef ERR
#include <stdarg.h> #include <stdarg.h>
#include <string.h>
#endif #endif
#ifdef GIT #ifdef GIT
@ -155,9 +155,17 @@ has_staged(git_repository *repo)
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
int code = -1; int i, code = -1;
char face[] = { ':', 0, '|' }; char face[] = { ':', 0, '|' };
/* print version information */
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-v") == 0) {
printf("XD v%s\n", VERSION);
return 0;
}
}
#ifdef GIT #ifdef GIT
git_repository *repo; git_repository *repo;
int git_ok = 0; int git_ok = 0;

View File

@ -1,4 +1,4 @@
VERSION = 1.0 VERSION = 1.1
PKG_CONFIG = pkg-config PKG_CONFIG = pkg-config
@ -16,4 +16,14 @@ ERR =
# uncomment to enable errors # uncomment to enable errors
# ERR = -DERR # ERR = -DERR
# add compilation details to VERSION variable
ifneq ($(GIT),)
VERSION := $(VERSION)"\\nlibgit2 "`$(PKG_CONFIG) --modversion $(GITLIB)`
endif
ifeq ($(ERR),)
VERSION := $(VERSION)"\\nerrors disabled"
else
VERSION := $(VERSION)"\\nerrors enabled"
endif
CC = cc CC = cc