diff options
| author | dacctal <donotcontactmevia@email.invalid> | 2026-08-17 15:07:02 +0000 |
|---|---|---|
| committer | dacctal <donotcontactmevia@email.invalid> | 2026-08-17 15:07:02 +0000 |
| commit | 51983b47b22db7bf819e9880caa2b72bdb8c9942 (patch) | |
| tree | 489119bbd32a9fb67b6d917457001c52c888e913 /Makefile | |
| parent | 7db56ed3f9d1fcb8b6780b7c30ad93904625a0a3 (diff) | |
added dynamic version & updated try_pkg_fn macro
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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` |
