summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2020-03-21 12:58:56 -0600
committerAaron Ball <nullspoon@oper.io>2020-03-21 12:58:56 -0600
commitcf15673142ac1b405eb04f06c28c2ce6f5836a78 (patch)
treef6757b2366d268918ec84d738651910b4d34c336
parentad3b04713df7ed28922c005ba6346afbd77331c0 (diff)
downloadluminous-cf15673142ac1b405eb04f06c28c2ce6f5836a78.tar.gz
luminous-cf15673142ac1b405eb04f06c28c2ce6f5836a78.tar.xz
Add compile date to version output
-rw-r--r--Makefile8
-rw-r--r--src/main.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index b2970e9..778231f 100644
--- a/Makefile
+++ b/Makefile
@@ -10,13 +10,17 @@ PATCHLEVEL = 1
SUBLEVEL = 0
EXTRAVERSION = -rc2
-VERSTR = "$(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL))$(EXTRAVERSION)"
+VERSTR = "$(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL))$(EXTRAVERSION)"
+DATESTR = "$(shell date '+%F')"
all:
if [ ! -d obj ]; then mkdir obj; fi
cc $(CCOPTS) $(DBG) src/config.c -c -o obj/config.o
- cc $(CCOPTS) $(DBG) -DVERSTR=$(VERSTR) obj/*.o src/main.c -o luminous
+ cc $(CCOPTS) $(DBG) \
+ -DVERSTR=$(VERSTR) \
+ -D DATESTR=$(DATESTR) \
+ obj/*.o src/main.c -o luminous
install:
install -D luminous ${DESTDIR}/${BINDIR}/luminous
diff --git a/src/main.c b/src/main.c
index 3bce0f0..bcd76db 100644
--- a/src/main.c
+++ b/src/main.c
@@ -61,7 +61,7 @@ void props_new(struct props* p) {
* NOTE: Version information is pulled from a macro defined by the Makefile.
*/
void version_print(FILE* fd) {
- fprintf(fd, "luminous %s\n", xstr(VERSTR));
+ fprintf(fd, "luminous %s (compiled: %s)\n", xstr(VERSTR), xstr(DATESTR));
}

Generated by cgit