mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:00:04 +08:00
41 lines
916 B
Makefile
41 lines
916 B
Makefile
CFLAGS = -Wall -Werror -fpic -std=gnu99
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
MKD = -mkdir
|
|
RM = cmd /C rmdir /Q /S
|
|
CC = gcc
|
|
TARGET := libfzf.dll
|
|
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
|