aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 26 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 264ae8a470..39f42739ff 100644
--- a/Makefile
+++ b/Makefile
@@ -58,11 +58,15 @@ endif
BUILD_CMD = $(BUILD_TOOL)
-ifneq ($(VERBOSE),)
- # Only need to handle Ninja here. Make will inherit the VERBOSE variable.
- ifeq ($(BUILD_TYPE),Ninja)
+# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j and -n flags.
+ifeq ($(BUILD_TYPE),Ninja)
+ ifneq ($(VERBOSE),)
BUILD_CMD += -v
endif
+ BUILD_CMD += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- '-j[0-9]\+')
+ ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
+ BUILD_CMD += -n
+ endif
endif
DEPS_CMAKE_FLAGS ?=
@@ -119,8 +123,13 @@ oldtest: | nvim build/runtime/doc/tags
ifeq ($(strip $(TEST_FILE)),)
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" $(MAKEOVERRIDES)
else
- +$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" NEW_TESTS=$(TEST_FILE) SCRIPTS= $(MAKEOVERRIDES)
+ @# Handle TEST_FILE=test_foo{,.res,.vim}.
+ +$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
endif
+# Build oldtest by specifying the relative .vim filename.
+.PHONY: phony_force
+src/nvim/testdir/%.vim: phony_force
+ +$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
build/runtime/doc/tags helptags: | nvim
+$(BUILD_CMD) -C build runtime/doc/tags
@@ -138,6 +147,14 @@ functionaltest-lua: | nvim
lualint: | build/.ran-cmake deps
$(BUILD_CMD) -C build lualint
+shlint:
+ @shellcheck --version | head -n 2
+ shellcheck scripts/vim-patch.sh
+
+_opt_shlint:
+ @command -v shellcheck && { $(MAKE) shlint; exit $$?; } \
+ || echo "SKIP: shlint (shellcheck not found)"
+
pylint:
flake8 contrib/ scripts/ src/ test/
@@ -158,6 +175,7 @@ clean:
+test -d build && $(BUILD_CMD) -C build clean || true
$(MAKE) -C src/nvim/testdir clean
$(MAKE) -C runtime/doc clean
+ $(MAKE) -C runtime/indent clean
distclean:
rm -rf $(DEPS_BUILD_DIR) build
@@ -187,16 +205,16 @@ appimage:
appimage-%:
bash scripts/genappimage.sh $*
-lint: check-single-includes clint lualint _opt_pylint
+lint: check-single-includes clint lualint _opt_pylint _opt_shlint
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
# Does not work with "Unix Makefiles".
ifeq ($(BUILD_TYPE),Ninja)
-build/%:
+build/%: phony_force
$(BUILD_CMD) -C build $(patsubst build/%,%,$@)
-$(DEPS_BUILD_DIR)/%:
+$(DEPS_BUILD_DIR)/%: phony_force
$(BUILD_CMD) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
endif
-.PHONY: test lualint pylint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix
+.PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix