diff options
author | Luke Bratch <luke@bratch.co.uk> | 2024-03-30 13:32:19 +0000 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2024-03-30 13:32:19 +0000 |
commit | ef5ef17bab5581bc001da0e2a9ab77620a19ffb0 (patch) | |
tree | 88d2ca2ed43774391f618f49c78fd978e40e08cd /Makefile | |
parent | 8450fa9418e3d0003a6990a5384437bde4ea76c0 (diff) |
Pass VERSION at compile time based on "git describe". Add fallback VERSION file for if Git isn't installed.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,4 +1,5 @@ CC=gcc +GIT_VERSION := "$(shell git describe --abbrev=4 --dirty --always --tags || cat VERSION)" BINARY=blabouncer ifeq ($(PREFIX),) @@ -6,7 +7,7 @@ ifeq ($(PREFIX),) endif blabouncer: blabouncer.c functions.c sockets.c config.c replay.c logging.c message.c config.h functions.h logging.h message.h replay.h sockets.h structures.h - $(CC) -D_DEFAULT_SOURCE -D_BSD_SOURCE -std=gnu99 -Wall -Wextra -lssl -lcrypto -o $(BINARY) blabouncer.c functions.c sockets.c config.c replay.c logging.c message.c + $(CC) -D_DEFAULT_SOURCE -D_BSD_SOURCE -DVERSION=\"$(GIT_VERSION)\" -std=gnu99 -Wall -Wextra -lssl -lcrypto -o $(BINARY) blabouncer.c functions.c sockets.c config.c replay.c logging.c message.c .PHONY: clean clean: |