This repository has been archived by the owner on Dec 20, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
47 lines (39 loc) · 1.55 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
FILESDIR := ./neotags_bin
BUILDDIR = ${FILESDIR}/build
PREFIX ?= ${HOME}/.vim_tags
NPROC != if (command -v nproc >/dev/null 2>&1); then \
nproc; \
else \
echo 2; \
fi
MKFLAGS != if (${MAKE} --no-print-directory --help >/dev/null 2>&1); then \
echo --no-print-directory --silent -j ${NPROC}; \
else \
echo -j ${NPROC}; \
fi \
DBG_TYPE := Debug
STRIP ?= strip
all: install
@printf "Cleaning...\n"
@rm -rf "${FILESDIR}/build"
install: build
@printf "\nInstalling into ~/.vim_tags/bin\n"
@${STRIP} "${BUILDDIR}/src/neotags"
@install -c -m755 "${BUILDDIR}/src/neotags" "${PREFIX}/bin"
build: mkdir
@(cd "${BUILDDIR}" && cmake -DCMAKE_BUILD_TYPE=Release ..)
@${MAKE} -C "${BUILDDIR}" ${MKFLAGS}
debug: dbg_install
@printf "Cleaning...\n"
rm -rf "${FILESDIR}/build"
dbg_install: dbg_build
@printf "\nInstalling into ~/.vim_tags/bin\n"
@cp -a "${BUILDDIR}/src/neotags" "${PREFIX}/bin/neo"
@rm -f "${PREFIX}/bin/neotags"
ln -sr "${PREFIX}/bin/Neotags.sh" "${PREFIX}/bin/neotags"
dbg_build: mkdir
@(cd "${BUILDDIR}" && cmake -DCMAKE_BUILD_TYPE=${DBG_TYPE} ..)
${MAKE} --no-print-directory -C "${BUILDDIR}" VERBOSE=1
mkdir:
@mkdir -p "${BUILDDIR}"
@rm -rf "${BUILDDIR}/{*,.*}"