-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
38 lines (28 loc) · 893 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# !!!
# !!! You should probably be using `luarocks make` instead of this
# !!!
# !!! This is mostly for quick and dirty testing
# !!!
HEADERS=$(wildcard csrc/*.h) $(wildcard include/ltreesitter/*.h)
SRC=$(wildcard csrc/*.c)
OBJ=$(SRC:.c=.o)
CFLAGS := -I./include -Wall -Wextra -Werror -Og -ggdb -std=c99 -pedantic -fPIC
# CFLAGS += -DLOG_GC
# CFLAGS += -fsanitize=address,undefined,leak
LIBS :=
# LIBS += -lasan -lubsan -lpthread
LIBS += -ltree-sitter -llua -ldl
INSTALL_PREFIX:=/usr/local/lib
dynamic: ltreesitter.so
static: ltreesitter.a
ltreesitter.a: $(OBJ) $(HEADERS)
$(AR) r $@ $(OBJ)
ltreesitter.so: $(OBJ) $(HEADERS)
$(CC) -shared $(OBJ) -o $@ $(LIBS)
clean:
rm -f $(OBJ) ltreesitter.a ltreesitter.so
all: clean ltreesitter.a ltreesitter.so
install: ltreesitter.a ltreesitter.so
cp ltreesitter.a $(INSTALL_PREFIX)/
cp ltreesitter.so $(INSTALL_PREFIX)/
.PHONY: clean all