forked from nvim-telescope/telescope-fzf-native.nvim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (36 loc) · 1.01 KB
/
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
39
40
41
42
43
44
45
46
CFLAGS += -Wall -Werror -fpic -std=gnu99
ifeq ($(OS),Windows_NT)
CC = gcc
TARGET := libfzf.dll
ifeq (,$(findstring MSYS,$(MSYSTEM)))
# On Windows, but NOT msys
MKD = cmd /C mkdir
RM = cmd /C rmdir /Q /S
else
MKD = mkdir -p
RM = rm -rf
endif
else
MKD = mkdir -p
RM = rm -rf
TARGET := libfzf.so
endif
all: build/$(TARGET)
build/$(TARGET): src/fzf.c src/fzf.h
$(MKD) build
$(CC) -O3 $(CFLAGS) -shared src/fzf.c -o build/$(TARGET)
build/test: build/$(TARGET) test/test.c
$(CC) -Og -ggdb3 $(CFLAGS) test/test.c -o build/test -I./src -L./build -lfzf -lexaminer
.PHONY: lint format clangdhappy clean test ntest
lint:
luacheck lua
format:
clang-format --style=file --dry-run -Werror src/fzf.c src/fzf.h test/test.c
test: build/test
@LD_LIBRARY_PATH=${PWD}/build:${PWD}/examiner/build:${LD_LIBRARY_PATH} ./build/test
ntest:
nvim --headless --noplugin -u test/minrc.vim -c "PlenaryBustedDirectory test/ { minimal_init = './test/minrc.vim' }"
clangdhappy:
compiledb make
clean:
$(RM) build