aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorame <[email protected]>2025-12-01 04:22:17 -0600
committerame <[email protected]>2025-12-01 04:22:17 -0600
commita187892a6c544e5b19e8429fd447773e4135b4eb (patch)
tree271cd19ea481b7b4cd97501ec6b3fa530c464b7b /makefile
parente13cc14a618a1ba817f8d667ea333133028f7e47 (diff)
makefile changes and better versioning
Diffstat (limited to 'makefile')
-rw-r--r--makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/makefile b/makefile
index 3c69707..9e9679d 100644
--- a/makefile
+++ b/makefile
@@ -1,7 +1,7 @@
CC := clang
MAJOR_VERSION := "$(shell git -c safe.directory='*' describe --tags --abbrev=0)"
-GIT_COMMIT := "$(shell git -c safe.directory='*' describe --tags)-$(shell git -c safe.directory='*' describe --always --match 'NOT A TAG')"
+GIT_COMMIT := "$(shell git -c safe.directory='*' describe --tags --abbrev=0)-$(shell git -c safe.directory='*' describe --always --match 'NOT A TAG')"
version ?= 5.4
install_version = $(version)
@@ -17,6 +17,9 @@ LINKER := $(CC)
TARGET := lullaby.so
INSTALL := /usr/local/lib/lua/
+DEBUG_CFLAGS := -ggdb3 -fno-omit-frame-pointer -fno-optimize-sibling-calls
+RELEASE_FLAGS := -O3
+
SRCS := $(wildcard src/*.c) $(wildcard src/*/*.c)
OBJS := $(SRCS:.c=.o)
@@ -30,7 +33,7 @@ endif
all: $(TARGET)
-release: CFLAGS += -O3
+release: CFLAGS += $(RELEASE_FLAGS)
release: all
install::
@@ -51,13 +54,13 @@ install::
# https://github.com/google/sanitizers/issues/89#issuecomment-406316683
#
# this also requires lua to be built with asan
-debug: CFLAGS += -ggdb3 -fno-omit-frame-pointer -fno-optimize-sibling-calls
+debug: CFLAGS += $(DEBUG_CFLAGS)
debug: all
-san: CFLAGS += -ggdb3 -static-libasan -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls
+san: CFLAGS += -static-libasan -fsanitize=address -fsanitize=undefined $(DEBUG_CFLAGS)
san: all
-tsan: CFLAGS += -ggdb3 -static-libasan -fsanitize=undefined -fsanitize=thread -fno-omit-frame-pointer -fno-optimize-sibling-calls
+tsan: CFLAGS += -static-libasan -fsanitize=thread -fsanitize=undefined $(DEBUG_CFLAGS)
tsan: all
reg: