diff options
-rw-r--r-- | Makefile | 51 | ||||
-rwxr-xr-x | scripts/travis.sh | 2 | ||||
-rw-r--r-- | src/nvim/testdir/Makefile | 6 |
3 files changed, 37 insertions, 22 deletions
@@ -1,3 +1,6 @@ +filter-false = $(strip $(filter-out 0 off OFF false FALSE,$1)) +filter-true = $(strip $(filter-out 1 on ON true TRUE,$1)) + -include local.mk CMAKE_BUILD_TYPE ?= Debug @@ -9,23 +12,23 @@ BUILD_TYPE ?= $(shell (type ninja > /dev/null 2>&1 && echo "Ninja") || \ ifeq (,$(BUILD_TOOL)) ifeq (Ninja,$(BUILD_TYPE)) - ifneq ($(shell cmake --help 2>/dev/null | grep Ninja),) - BUILD_TOOL := ninja - else - # User's version of CMake doesn't support Ninja - BUILD_TOOL = $(MAKE) - BUILD_TYPE := Unix Makefiles - endif - else + ifneq ($(shell cmake --help 2>/dev/null | grep Ninja),) + BUILD_TOOL := ninja + else + # User's version of CMake doesn't support Ninja BUILD_TOOL = $(MAKE) + BUILD_TYPE := Unix Makefiles + endif + else + BUILD_TOOL = $(MAKE) endif endif ifneq ($(VERBOSE),) - # Only need to handle Ninja here. Make will inherit the VERBOSE variable. - ifeq ($(BUILD_TYPE),Ninja) - VERBOSE_FLAG := -v - endif + # Only need to handle Ninja here. Make will inherit the VERBOSE variable. + ifeq ($(BUILD_TYPE),Ninja) + VERBOSE_FLAG := -v + endif endif BUILD_CMD = $(BUILD_TOOL) $(VERBOSE_FLAG) @@ -33,9 +36,14 @@ BUILD_CMD = $(BUILD_TOOL) $(VERBOSE_FLAG) # Extra CMake flags which extend the default set CMAKE_EXTRA_FLAGS ?= DEPS_CMAKE_FLAGS ?= +USE_BUNDLED_DEPS ?= -# For use where we want to make sure only a single job is run. This also avoids -# any warnings from the sub-make. +ifneq (,$(USE_BUNDLED_DEPS)) + BUNDLED_CMAKE_FLAG := -DUSE_BUNDLED=$(USE_BUNDLED_DEPS) +endif + +# For use where we want to make sure only a single job is run. This does issue +# a warning, but we need to keep SCRIPTS argument. SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE) all: nvim @@ -48,21 +56,26 @@ cmake: $(MAKE) build/.ran-cmake build/.ran-cmake: | deps - mkdir -p build cd build && cmake -G '$(BUILD_TYPE)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) .. touch $@ -deps: | .deps/build/third-party/.ran-cmake +deps: | build/.ran-third-party-cmake +ifeq ($(call filter-true,$(USE_BUNDLED_DEPS)),) +$(BUILD_CMD) -C .deps/build/third-party +endif -.deps/build/third-party/.ran-cmake: +build/.ran-third-party-cmake: +ifeq ($(call filter-true,$(USE_BUNDLED_DEPS)),) mkdir -p .deps/build/third-party cd .deps/build/third-party && \ - cmake -G '$(BUILD_TYPE)' $(DEPS_CMAKE_FLAGS) ../../../third-party + cmake -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) \ + $(DEPS_CMAKE_FLAGS) ../../../third-party +endif + mkdir -p build touch $@ test: | nvim - +$(SINGLE_MAKE) -C src/nvim/testdir + +$(SINGLE_MAKE) -C src/nvim/testdir $(MAKEOVERRIDES) unittest: | nvim +$(BUILD_CMD) -C build unittest diff --git a/scripts/travis.sh b/scripts/travis.sh index 6b540dbccf..ec617a42c6 100755 --- a/scripts/travis.sh +++ b/scripts/travis.sh @@ -59,7 +59,7 @@ set_environment() { eval $($prefix/bin/luarocks path) export PATH="$prefix/bin:$PATH" export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" - export DEPS_CMAKE_FLAGS="-DUSE_BUNDLED=OFF" + export USE_BUNDLED_DEPS=OFF } # install prebuilt dependencies diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 5582a9f159..c93706fce2 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -8,7 +8,7 @@ VIMPROG := ../../../build/bin/nvim SCRIPTS := test_autoformat_join.out \ test_eval.out \ - test1.out test2.out test3.out test4.out test5.out \ + test2.out test3.out test4.out test5.out \ test6.out test7.out test8.out test9.out test10.out \ test11.out test12.out test13.out test14.out test15.out \ test17.out test18.out test19.out test20.out \ @@ -80,7 +80,9 @@ report: echo ALL DONE; \ fi" -$(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) +test1.out: $(VIMPROG) + +$(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) test1.out RM_ON_RUN := test.out X* viminfo RM_ON_START := tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok |