-
Notifications
You must be signed in to change notification settings - Fork 41
/
Makefile
54 lines (44 loc) · 1.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
default:
@echo "No target specified"
exit 1
CMAKE := $(shell command -v cmake3 2> /dev/null)
ifndef CMAKE
CMAKE := cmake
endif
CTEST := $(shell command -v ctest3 2> /dev/null)
ifndef CTEST
CTEST := ctest
endif
SUDO := $(shell command -v sudo 2> /dev/null)
.PHONY: build
build:
ifeq ($(shell uname -s),Darwin)
( source build.macos.env.sh && mkdir -p build && cd build && $(CMAKE) .. && make )
else
( mkdir -p build && cd build && $(CMAKE) .. && make )
endif
.PHONY: tests
tests:
(cd build && $(CTEST))
.PHONY: install
install: build
(cd build && $(SUDO) make install)
.PHONY: test-installation
test-installation:
@NGS_PATH=$$(command -v ngs) && echo "-> NGS is available at: $${NGS_PATH}"
@MAN_PATH=$$(man -w ngs) && echo "-> NGS man is available at: $${MAN_PATH}"
.PHONY: clean
clean:
rm -rf build
.PHONY: update-vim-syntax
update-vim-syntax:
./helper-scripts/update-vim-syntax.ngs vim/syntax/ngs.vim
.PHONY: setup-dev-env
setup-dev-env: dir := $(abspath $(shell pwd))
setup-dev-env:
ifeq ($(shell uname -s),Darwin)
(cd /usr/local/bin && ln -sf "$(dir)/build/ngs")
(cd /usr/local/lib && ln -sf "$(dir)/lib" ngs)
else
@echo setup-dev-env is not implemented for your platform
endif