Commit Graph

101 Commits

Author SHA1 Message Date
dundargoc
9b4d0137b8
build: move lint target to cmake #19169
This will ensure less verbose output and faster linting.
2022-07-01 09:15:04 -07:00
Justin M. Keyes
f05a2891d3 build: rename build-related dirs
Problem:
Dirs "config", "packaging", and "third-party" are all closely related
but this is not obvious from the layout. This adds friction for new
contributors.

Solution:
- rename config/ to cmake.config/
- rename test/config/ to test/cmakeconfig/ because it is used in Lua
  tests: require('test.cmakeconfig.paths').
- rename packaging/ to cmake.packaging/
- rename third-party/ to cmake.deps/ (parallel with .deps/)
2022-06-28 04:02:29 -07:00
dundargoc
6d57bb89c1
build: add a cmake target for all used linters #18543
* build: move the logic for linters to cmake
Cmake is our source of truth. We should have as much of our build
process there as possible so everyone can make use of it.

* build: remove redundant check for ninja generator
The minimum cmake version as of writing this is 3.10, which has ninja
support.
2022-06-09 08:09:24 -07:00
Christian Clason
676e9e9334 ci: lint runtime with stylua 2022-05-09 16:31:55 +02:00
Dundar Göc
680970bfbc ci(commitlint): use -u NONE instead of --clean
I get a weird error about syntax.vim not being installed when using
--clean when running it locally.
2022-03-27 18:28:11 +02:00
Eisuke Kawashima
7014731035
build: enhance Makefile
- fix regression where `-j` is not passed to ninja
  (39c886551b, #15708)
- enable to pass `-l` (load) to ninja as well
- s/BUILD_TYPE/CMAKE_GENERATOR/
2021-09-21 15:54:14 +09:00
Justin M. Keyes
41da72ffb6 build(lint): commit linter 2021-09-19 16:39:34 -07:00
kylo252
39c886551b
refactor(Makefile): use built-in make commands #15708
Changes to the main Makefile:
- add `MAKEFILE_PATH` and `MAKEFILE_DIR` that are set with native commands
- add `NVIM_PRG`
- rename `BUILD_TYPE` to `CMAKE_GENERATOR` to align with CMake naming
- remove the misleading `BUILD_CMD` and use `BUILD_TOOL` instead

Add the following phony target to quickly test the changes

```make
debug-print:
	@echo makefile path: $(MAKEFILE_PATH)
	@echo makefile dir: $(MAKEFILE_DIR)
	@echo build dir: $(BUILD_DIR)
	@echo cmake generator tool: $(CMAKE_GENERATOR)
	@echo build-tool: $(BUILD_TOOL)
	@echo nvim-prg: $(NVIM_PRG)
```
2021-09-19 15:53:48 -07:00
dundargoc
65572c719a
build(lint): commit linter #15620 2021-09-19 09:27:08 -07:00
Eisuke Kawashima
250e4e699f
build: Inherit -n and -jN flags if Ninja #12219 2020-05-01 07:36:56 -07:00
Daniel Hahler
0b7a7b23cc
oldtest: support for running by filename (#11473)
Follow-up to 8969efca8 (Vim patch 8.1.0723)

NOTE: This changes the main entrypoint for running single oldtest files
to not use/require the ".res" extension anymore.  But it is handled for
B/C.

Adds a phony rule to run oldtest by filename.
Not going through "$(MAKE)" avoids GNUmakefile being used then (which I
use for WIP things), and it seems like SINGLE_MAKE should be used anyway
probably.
2019-12-02 17:18:37 +01:00
Jan Edmund Lazo
8969efca8c
vim-patch:8.1.0723: cannot easily run specific test when in src/testdir
Problem:    Cannot run specific test when in src/testdir the same was as in
            the src directory.
Solution:   Move build rule to src/testdir/Makefile.
ec50401e1e

Developer can omit '.res' suffix now.
TEST_FILE=test_syntax make oldtest
or
make -C src/nvim/testdir test_syntax
2019-11-22 20:10:12 -05:00
Jan Edmund Lazo
5689008060 build: add shlint target for shellcheck (#11350) 2019-11-09 13:39:01 +01:00
Daniel Hahler
48b2d21d5e vim-patch:8.1.1213: "make clean" in top dir does not cleanup indent test output
Problem:    "make clean" in top dir does not cleanup indent test output.
Solution:   Clean the indent test output.  Do not rely on the vim executable
            for that. (closes vim/vim#4307)
e13a3901ca
2019-09-18 22:46:47 +02:00
Daniel Hahler
6cc76194b2
tests: use runtime from build for doc/tags with :help (#10479)
This is better practice in general, and allows to remove the "helptags
ALL" hacks.

Ref: https://github.com/neovim/neovim/issues/8824
Ref: https://github.com/neovim/neovim/commit/f1b67c3453c

* Makefile: fix dependencies with regard to helptags

- use the file as the main target to avoid unnecessary triggering
- use "make oldtest" on Travis to ensure it gets built
2019-08-28 22:47:54 +02:00
Daniel Hahler
0288ba6e38
build: Makefile: use _opt_pylint [ci skip] (#10720)
A separate rule it clearer, and allows for `make --keep-going lint` in
general later.

Ref: https://github.com/neovim/neovim/pull/10714
2019-08-08 16:02:59 +02:00
Daniel Hahler
95e1ce24e8 build: lint: fix exit with optional pylint
Ref: https://github.com/neovim/neovim/pull/10714#issuecomment-518932355
2019-08-07 12:27:59 +02:00
Daniel Hahler
8218d474fa
build: move pylint to Makefile, optional with "make lint" (#10714)
This avoids errors when using "make lint", but "flake8" is not
available.  We do not want to install it then via third-party.
On CI "make pylint" is used explicitly.
2019-08-06 18:53:51 +02:00
Daniel Hahler
4c35e6fe67
Makefile: only use pattern rules with BUILD_TYPE=Ninja (#10687)
While not doing any harm with "Unix Makefiles", they do not work there
as-is.  Therefore just do not use them then.

Followup to #10366 (7f6ff829a).
2019-08-04 17:13:04 +02:00
Daniel Hahler
7f6ff829aa
Makefile: use pattern rules for build/.deps [ci skip] (#10366)
This allows for `make build/bin/nvim`,
`make build/src/nvim/auto/funcs.generated.h` etc.
2019-07-30 13:53:33 +02:00
Daniel Hahler
d651710de1 ci: pylint target via flake8
Ref: https://github.com/neovim/neovim/pull/10631#issuecomment-515756591
2019-07-29 22:14:23 +02:00
Daniel Hahler
b41507927b
build: fix handling of install prefix with CMAKE_EXTRA_FLAGS (#10530)
Append `CMAKE_INSTALL_PREFIX` to any given `CMAKE_EXTRA_FLAGS` always.

Regressed in 5031e3298.

Fixes https://github.com/neovim/neovim/issues/10524.
2019-07-17 16:38:11 +02:00
Daniel Hahler
32361a1245 Improve luacheck setup [skip appveyor]
- Move .luacheckrc to root, add read_globals=vim
- Simplify lualint target, run it on all lua files
- Lint preload.lua, but ignore W211
- Remove testlint target, included in lualint (and lint)
- Clean up .luacheckrc
2019-07-04 12:29:54 +02:00
Eisuke Kawashima
61790c7b3c build: Fix rule of build/.ran-third-party-cmake #10402
In order that `$(DEPS_BUILD_DIR)/Makefile` exists under parallel make
2019-07-03 00:25:49 +02:00
Daniel Hahler
72ae0a6e5e
Makefile: CMAKE_INSTALL_PREFIX: skip parsing CMAKE_EXTRA_FLAGS if set (#10374)
Fixes:

>  Recursive variable 'CMAKE_EXTRA_FLAGS' references itself (eventually).  Stop.
2019-06-30 01:29:10 +02:00
Daniel Hahler
75be0f0bbb Makefile: move all target to the top [ci skip] #10375
Fixes "make: Nothing to be done for 'checkprefix'." after 5031e3298.
2019-06-30 00:13:53 +02:00
Daniel Hahler
5031e32986
Makefile: revisit/improve checkprefix handling (#10348)
Main improvement: do not error out, but re-run CMake in case
CMAKE_INSTALL_PREFIX changed, and only check it for "install".

- only look at CMAKE_EXTRA_FLAGS via shell if not empty
- add CMAKE_INSTALL_PREFIX to CMAKE_EXTRA_FLAGS (not CMAKE_FLAGS), to
  override it being set in CMAKE_EXTRA_FLAGS from local.mk
- use an empty "checkprefix" target if CMAKE_INSTALL_PREFIX is not
  provided
- skip checking of cached value without build/.ran-cmake; it will be run
  then anyway
- only use it with "install" target; it is only relevant there
- do not error, but re-run CMake (by removing the stamp file)
2019-06-29 21:48:40 +02:00
Daniel Hahler
a924650d98
Makefile: fix regression with "make functionaltest-lua" (#10346)
Regressed in 69eb4fa0c.
2019-06-26 22:44:48 +02:00
Daniel Hahler
10c983fabe
build: Makefile: fix distclean [ci skip] (#10336)
Do not run CMake in build before deleting it unnecessarily:

    % make distclean
    test -d build && ninja -C build clean || true
    ninja: Entering directory `build'
    [0/1] Re-running CMake...
2019-06-25 19:51:28 +02:00
Daniel Hahler
69eb4fa0c5
build: Makefile: handle "rm -rf .deps" (#10305)
- make `build/.ran-third-party-cmake` depend on `$(DEPS_BUILD_DIR)`.
  It still creates `build` there as a side-effect, which does not
  belong there really, but is OK for now.

- add an explicit target for `$(DEPS_BUILD_DIR)` (".deps"), only with
  USE_BUNDLED=1  (the default).

This makes it easier to rebuild deps cleanly, by using `rm -rf .deps; make`.
2019-06-24 04:13:57 +02:00
Daniel Hahler
9ce34050e5 Makefile: fix trailing space in BUILD_CMD #10312
Only append flag for verbosity with ninja if non-empty.

Fixes the trailing space with `ninja  -C .deps`.
2019-06-23 15:25:29 +02:00
Justin M. Keyes
ad3b312cf5 build: do not pass empty CMAKE_INSTALL_PREFIX
ref #9748
ref #9743
2019-03-19 02:51:33 +01:00
Justin M. Keyes
29d6993ccd
build: pass CMAKE_INSTALL_PREFIX explicitly #9748
On some (but not all) systems this works implicitly.

fixes #9743
2019-03-17 23:35:56 +01:00
Daniel Hahler
6b827bb664 build: checkprefix: skip if empty #9624
This regressed in 3b473bb14f:
```
% make 'CMAKE_BUILD_TYPE=RelWithDebInfo' 'CMAKE_EXTRA_FLAGS=-DCMAKE_INSTALL_PREFIX=/vim-build/neovim/neovim/master -DENABLE_JEMALLOC=OFF' 'DEPS_CMAKE_FLAGS=-DUSE_BUNDLED=OFF'

error: CMAKE_INSTALL_PREFIX '/vim-build/neovim/neovim/master' does not match cached value ''
       Run this command, then try again:
         cmake build -DCMAKE_INSTALL_PREFIX=/vim-build/neovim/neovim/master
make: *** [Makefile:169: checkprefix] Error 1
```

It was checking before for non-empty also [1].

1: https://github.com/neovim/neovim/pull/9621/files#diff-b67911656ef5d18c4ae36cb6741b7965L22
2019-02-17 21:41:42 +01:00
Justin M. Keyes
3b473bb14f
build/Makefile: validate prefix for specific targets (#9621)
`clean` and `distclean` should not check CMAKE_INSTALL_PREFIX.
ref #9615

Helped-by: bruce-hill
2019-02-17 05:28:32 +01:00
Justin M. Keyes
05c6c6ae08 build/Makefile: check CMAKE_INSTALL_PREFIX
closes #9615
2019-02-16 00:49:53 +01:00
Justin M. Keyes
685b2028dc build: fix doc_html target
ref 24f2cc55a8 #9430
2019-01-04 02:17:23 +01:00
Justin M. Keyes
1bbbd5f0ff build: make helphtml 2018-11-05 22:45:48 +01:00
Justin M. Keyes
200c8b9cca
build: Unify USE_BUNDLED, USE_BUNDLED_DEPS (#9046)
It's confusing that the Makefile uses a different name than CMake.
2018-09-24 23:18:48 +02:00
Björn Linse
9e8f9dd5d4 cmake: add "generated-sources" target
This is intended to be used with source introspection tools like
clangd, where it would useful to regenerate headers and source files,
which introspection results depend on, without making a full
rebuild which takes much longer time than just generating headers.
2018-09-06 20:54:53 +02:00
Justin M. Keyes
9a0147754c build: respect $DEPS_BUILD_DIR
Without this, the CI_TARGET=lint travis job cant't find the cached deps
(in $HOME/nvim-deps), nor can it update the cache.
2018-03-11 15:38:18 +01:00
Justin M. Keyes
968c7ab17e ci/travis: use ninja instead of make 2018-03-11 12:45:15 +01:00
James McCoy
9dc3cc2c68
genappimage: Include update information for releases/nightlies
This will allow users to use AppImageUpdate to update their AppImage.
It requires publishing the created zsync file alongside the appimage
file for the releases.
2018-03-09 20:49:26 -05:00
ZyX
58f6ef50a8 ci: Also lint lua code in src/nvim/lua 2017-05-25 16:50:06 +03:00
AdnoC
3c0cc028b7 dist: AppImage #6638
scripts/genappimage.sh produces an executable:
    nvim-${NVIM_VERSION}-glibc${GLIBC_VERSION}-${ARCHITECTURE}.AppImage

Closes #6083
2017-05-04 14:43:41 +02:00
ZyX
1e87061294 makefile: Make lint target depend on clint 2017-03-31 16:08:02 +03:00
ZyX
c61858a997 cmake: Replace RunLint.cmake with code in src/nvim/CMakeLists.txt
This also removes LINT_FILE environment variable, other then that functionality 
is kept. It is expected that developers needing partial linting will use `make 
lint`, touching interesting file before (if not done already by writing to 
them).
2017-03-31 16:04:18 +03:00
Justin M. Keyes
afacda046d ci: Run check-single-includes in "lint" build only 2017-03-29 18:02:09 +02:00
Eiichi NISHINA
62774e4356 ci: Check that #include "*.h" works as a single include
Lesser form of include-what-you-use: at least guarantees that header
file did not forget to include something through some other included
file.

Activate run_single_includes_tests on CI.
Fix some IWYU violations.

References #5321
2017-03-27 13:51:05 +02:00
Christian Stigen Larsen
6041fd7a86 build: Makefile: Try other cmake names, or override. #6163
Distributions like RHEL7 (yum) install CMake as `cmake3`.

Closes #6163
2017-02-27 14:28:15 +01:00