aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-15 05:34:32 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-15 05:34:32 -0400
commite237b6858830f9d8355b7ae91506bf6af3f15009 (patch)
treece7150380522af2d52f7bc0cb43455f18b40d377
parentffebfdcc4f37d905ccb1a21105e2998b5af9bc55 (diff)
downloadfujinet-chat-e237b6858830f9d8355b7ae91506bf6af3f15009.tar.gz
Embed git hash and build host in binary.
-rw-r--r--Makefile6
-rw-r--r--Makefile.client2
-rw-r--r--config/Makefile2
-rw-r--r--config/config.c9
-rw-r--r--src/irc.c6
-rw-r--r--src/main.c2
6 files changed, 20 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 8d9af7b..83a7c33 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,8 @@ PARTS=loading1.xex config/config.xex loading2.xex memsetup.xex font_dl.xex clien
TESTXEX=fnchat-$(shell date +%Y%m%d-%H%M).xex
+VERSION:=$(shell git describe --long 2>/dev/null || echo NOGIT )+$(shell date +%Y%m%d-%H%M )@$(shell hostname -s 2>/dev/null || echo UNKNOWN )
+
# remove the -a if using older versions of atasm
ATASM=atasm -s -a
@@ -14,10 +16,10 @@ fnchat.xex: $(PARTS)
client.xex: client
client:
- $(MAKE) -f Makefile.client
+ $(MAKE) -f Makefile.client VERSION=$(VERSION)
config/config.xex:
- $(MAKE) -C config
+ $(MAKE) -C config VERSION=$(VERSION)
clean:
rm -f $(PARTS) *.o src/*.o obj/atari/*.o config/*.o fnchat.xex
diff --git a/Makefile.client b/Makefile.client
index 754c4f8..a6b8b01 100644
--- a/Makefile.client
+++ b/Makefile.client
@@ -27,7 +27,7 @@ CONFIG :=
# Additional C compiler flags and options.
# Default: none
-CFLAGS = -Oris
+CFLAGS = -Oris -DVERSION='"$(VERSION)"'
# Additional assembler flags and options.
# Default: none
diff --git a/config/Makefile b/config/Makefile
index 65de826..2e0fd05 100644
--- a/config/Makefile
+++ b/config/Makefile
@@ -3,7 +3,7 @@ all: config.xex
#config.xex: config.c exetrailer.s ../src/config.h ../src/config.c
config.xex:
- cl65 -Oris -t atari -C ../src/atari.cfg -o config.xex config.c exetrailer.s ../src/config.c
+ cl65 -DVERSION='"$(VERSION)"' -Oris -t atari -C ../src/atari.cfg -o config.xex config.c exetrailer.s ../src/config.c
test:
cl65 -Oris -t atari -C ../src/atari.cfg -o config.xex config.c exetrailer.s ../src/config.c
diff --git a/config/config.c b/config/config.c
index f84f196..6b22e06 100644
--- a/config/config.c
+++ b/config/config.c
@@ -11,12 +11,16 @@
#include "../src/config.h"
+#ifndef VERSION
+#define VERSION "?????"
+#endif
+
conf_t defaults = {
"N:TCP://irc.libera.chat:6667",
"FNChatTest",
"FujiNetChat User",
{ 0xc0, 0x0c },
- { "#testari8", { 0 }, { 0 }, { 0 }, { 0 } },
+ { "#fnchat", { "##atari" }, { "#atari8" }, { 0 }, { 0 } },
{ 0 }, /* extra_channels */
3, /* alert_type, default = both */
0, /* show_ping, default = N */
@@ -437,7 +441,8 @@ void main(void) {
OS.color1 = conf->colors[1];
cursor(1);
- print("\x7d" "FujiNetChat Setup\n\n");
+ print("\x7d" "FujiNetChat Config\n");
+ print("Version " VERSION "\n\n");
detect_dos();
if(!load(0))
diff --git a/src/irc.c b/src/irc.c
index 49eea56..cd11ba8 100644
--- a/src/irc.c
+++ b/src/irc.c
@@ -14,6 +14,10 @@
#include "nio.h"
#include "config.h"
+#ifndef VERSION
+#define VERSION "?????"
+#endif
+
#define MAX_MSG 512
char *msg_src, *msg_cmd, *msg_dest, *msg_text;
@@ -203,7 +207,7 @@ static void do_ctcp(int is_notice) {
} else if(streq_i(ctcp_type, "CLIENTINFO")) {
resp = "PING VERSION CLIENTINFO";
} else if(streq_i(ctcp_type, "VERSION")) {
- resp = "FujiNetChat pre-alpha on an Atari 8-bit";
+ resp = "FujiNetChat (" VERSION "; Atari 8-bit)";
} else {
/* unknown CTCP type, ignore */
return;
diff --git a/src/main.c b/src/main.c
index e5df909..60313d2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,8 +1,10 @@
/* FujiNetChat, an IRC client. Based on NetCat and the old FujiChat. */
+/*
#define SELF "FujiNetChat"
#define VERSION "0.0"
#define BANNER SELF " v" VERSION " (B. Watson)\n"
+*/
#include <atari.h>
#include <stdlib.h>