aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/makefile b/makefile
index 30a261a..2f65509 100644
--- a/makefile
+++ b/makefile
@@ -1,14 +1,20 @@
CC := clang
-GIT_COMMIT := "$(shell git describe --tags)-$(shell git describe --always --match 'NOT A TAG')"
+GIT_COMMIT := "$(shell git -c safe.directory='*' describe --tags)-$(shell git -c safe.directory='*' describe --always --match 'NOT A TAG')"
-version ?= lua5.4
+version ?= 5.4
+install_version = $(version)
-CFLAGS := -fPIC -DGIT_COMMIT='$(GIT_COMMIT)' `pkg-config --cflags $(version)`
+ifeq ($(version),jit)
+ install_version = 5.1
+endif
+
+CFLAGS := -fPIC -DGIT_COMMIT='$(GIT_COMMIT)' `pkg-config --cflags lua$(version)`
LFLAGS := -lm -shared -lcrypto -lssl
LINKER := $(CC)
TARGET := lullaby.so
+INSTALL_DIR := /usr/lib64/lua/
SRCS := $(wildcard src/*.c) $(wildcard src/*/*.c)
OBJS := $(SRCS:.c=.o)
@@ -26,6 +32,10 @@ all: $(TARGET)
release: CFLAGS += -O3
release: all
+install::
+ mkdir $(INSTALL_DIR)$(install_version) -p
+ cp $(TARGET) $(INSTALL_DIR)$(install_version)/$(TARGET)
+
# ok so im pretty sure asan should be linked too, however dlclose needs to be masked anyways
# and since libasan needs to be the first thing to load, you'll have to add it anyways
# run with something like 'LD_PRELOAD="/usr/lib/gcc/x86_64-pc-linux-gnu/14/libasan.so ./fakedlclose.so" lua5.4 ...'