Skip to content

Commit 6d62218

Browse files
committed
Added vim.makefile with custom build commands for IDEs
1 parent 388fb4c commit 6d62218

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ compile_commands.json
66
**/.idea/
77
**/config.json
88
.vscode
9+
**/.vim-build/*

3d/vim.makefile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
# This file allows for convenient compilation and execution
3+
# of the project from inside vim (or any other IDE for that matter)
4+
5+
build-directory ?= .vim-build
6+
jobs=8
7+
8+
all: _vim_run
9+
10+
# Commands for Vim to compile and run the project
11+
.PHONY: _vim_run _vim_build _vim_clean _vim_test
12+
_vim_run: _vim_build
13+
cd $(build-directory)
14+
./watersim-gui
15+
16+
_vim_build: watersim-gui
17+
18+
_vim_test: watersim-tests
19+
20+
_vim_clean: clean
21+
rm -rf $(build-directory)
22+
23+
$(build-directory)/Makefile:
24+
mkdir -p $(build-directory)
25+
cd $(build-directory)
26+
cmake ..
27+
28+
binaries = watersim-cli watersim-gui watersim-tests
29+
$(binaries): $(build-directory)/Makefile .FORCE
30+
cd $(build-directory)
31+
make -j$(jobs) $@
32+
33+
.PHONY: .ONESHELL .FORCE
34+
.ONESHELL:
35+
36+

0 commit comments

Comments
 (0)