aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile14
1 files changed, 10 insertions, 4 deletions
diff --git a/makefile b/makefile
index 2dcdf4c..fe25fa2 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)
@@ -31,7 +34,7 @@ endif
.PHONY: all
all: $(TARGET)
-release: CFLAGS += -O3
+release: CFLAGS += $(RELEASE_FLAGS)
release: all
.PHONY: install
@@ -53,12 +56,15 @@ 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 += -static-libasan -fsanitize=thread -fsanitize=undefined $(DEBUG_CFLAGS)
+tsan: all
+
reg:
rm src/reg.o