From 51983b47b22db7bf819e9880caa2b72bdb8c9942 Mon Sep 17 00:00:00 2001 From: dacctal Date: Mon, 17 Aug 2026 15:07:02 +0000 Subject: added dynamic version & updated try_pkg_fn macro --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index fb247c1..a86e04f 100644 --- a/Makefile +++ b/Makefile @@ -16,13 +16,21 @@ .PHONY: default debug install defconfig rmconfig clean uninstall +GIT_HASH := $(shell git rev-parse --short HEAD) +GIT_DATE := $(shell git log -1 --format='%ad' --date='format:%y.%m.%d') +GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) +GIT_REMOTE := $(shell git remote get-url origin) +GIT_TAG := $(shell git describe --tags --exact-match HEAD 2>/dev/null) +VERSION := $(if $(GIT_TAG),$(GIT_TAG),$(GIT_DATE)_$(GIT_BRANCH) ($(GIT_HASH))) + CC ?= cc RM = rm -f PREFIX ?= /usr/local OBJDIR = obj SRCS = $(wildcard src/*.c) OBJS = $(SRCS:src/%.c=$(OBJDIR)/%.o) -CFLAGS += $(shell pkg-config --cflags luajit) -I./include -Wno-format-truncation -std=c99 +CFLAGS += $(shell pkg-config --cflags luajit) -I./include +CFLAGS += -Wno-format-truncation -std=c99 -DVERSION='"$(VERSION)"' # pretty print for compilation. To enable verbose (show commands), run with # `make V=1` -- cgit v1.2.3