Add a new target cscope-hook.
This adds a Mercurial hook to automatically update the cscope data base every time you pull, switch branch, or update.
This commit is contained in:
parent
17d15b2511
commit
fb256796eb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266115
19
sys/Makefile
19
sys/Makefile
@ -47,6 +47,25 @@ ${.CURDIR}/cscope.files: .PHONY
|
|||||||
cscope-clean:
|
cscope-clean:
|
||||||
rm -f cscope.files cscope.out cscope.in.out cscope.po.out
|
rm -f cscope.files cscope.out cscope.in.out cscope.po.out
|
||||||
|
|
||||||
|
#
|
||||||
|
# Installs SCM hooks to update the cscope database every time the source tree
|
||||||
|
# is updated.
|
||||||
|
# cscope understands incremental updates, so it's considerably faster when only
|
||||||
|
# a few files have changed.
|
||||||
|
#
|
||||||
|
HG_DIR=${.CURDIR}/../.hg
|
||||||
|
HG_HOOK=if [ \$$HG_ERROR -eq 0 ]; then cd sys && make -m ../share/mk cscope; fi
|
||||||
|
cscope-hook:
|
||||||
|
@if [ -d ${HG_DIR} ]; then \
|
||||||
|
if [ "`grep hooks ${HG_DIR}/hgrc`" = "" ]; then \
|
||||||
|
echo "[hooks]" >> ${HG_DIR}/hgrc; \
|
||||||
|
echo "update = ${HG_HOOK}" >> ${HG_DIR}/hgrc; \
|
||||||
|
echo "Hook installed in ${HG_DIR}/hgrc"; \
|
||||||
|
else \
|
||||||
|
echo "Mercurial update hook already exists."; \
|
||||||
|
fi; \
|
||||||
|
fi
|
||||||
|
|
||||||
# You need the devel/global and one of editor/emacs* ports for that.
|
# You need the devel/global and one of editor/emacs* ports for that.
|
||||||
TAGS ${.CURDIR}/TAGS: ${.CURDIR}/cscope.files
|
TAGS ${.CURDIR}/TAGS: ${.CURDIR}/cscope.files
|
||||||
rm -f ${.CURDIR}/TAGS
|
rm -f ${.CURDIR}/TAGS
|
||||||
|
Loading…
Reference in New Issue
Block a user