-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
84 lines (67 loc) · 2.15 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#
# install, uninstall and friends ghc-tags-plugin in cabal store
#
GHC_VERSION ?= 9.10.1
GHC=ghc-${GHC_VERSION}
GHC_PKG=ghc-pkg-${GHC_VERSION}
GHC_STORE_TAG ?= ""
ifneq (,$(wildcard ${HOME}/.local/state/cabal/store))
PACKAGE_DB = ${HOME}/.local/state/cabal/store/ghc-${GHC_VERSION}${GHC_STORE_TAG}/package.db
else
PACKAGE_DB = ${HOME}/.cabal/store/ghc-${GHC_VERSION}${GHC_STORE_TAG}/package.db
endif
# this avoids changing the default environment:
# ~/.ghc/x86_64-linux-8.6.5/environments/default
# file; Unfortunatelly `/dev/null` is not accepted.
#
# THIS FILE WILL BE REMOVED!
ENV=.ghc-tags-plugin.env
uninstall:
${GHC_PKG} unregister \
--package-db=${PACKAGE_DB} \
--force \
ghc-tags-plugin
uninstall-core:
${GHC_PKG} unregister \
--package-db=${PACKAGE_DB} \
--force \
ghc-tags-core
install:
# avoid changing the default environment
cabal install --package-db=${PACKAGE_DB} \
--package-env=${ENV} \
--with-compiler=${GHC} \
--disable-documentation \
--reinstall \
--lib \
ghc-tags-plugin
rm ${ENV}
${GHC_PKG} describe --package-db=${PACKAGE_DB} ghc-tags-plugin | grep -A1 ^id
prof-install:
# avoid changing the default environment
cabal install --package-db=${PACKAGE_DB} \
--package-env=${ENV} \
--with-compiler=${GHC} \
--lib \
--disable-documentation \
--enable-profiling \
ghc-tags-plugin
rm ${ENV}
${GHC_PKG} describe --package-db=${PACKAGE_DB} ghc-tags-plugin | grep -A1 ^id
# reinstall ghc-tags-core and ghc-tags-plugin
reinstall-core: uninstall uninstall-core install
# reinstall only ghc-tags-plugin
reinstall: uninstall install
list:
${GHC_PKG} list --package-db=${PACKAGE_DB} | grep ghc-tags
latest:
${GHC_PKG} latest --package-db=${PACKAGE_DB} ghc-tags-plugin
recache:
${GHC_PKG} recache --package-db=${PACKAGE_DB}
check:
${GHC_PKG} check --package-db=${PACKAGE_DB} 2>&1 | grep ghc-tags
describe:
${GHC_PKG} describe --package-db=${PACKAGE_DB} ghc-tags-plugin
describe-core:
${GHC_PKG} describe --package-db=${PACKAGE_DB} ghc-tags-core
.PHONY: install, uninstall, uninstall-core, reinstall, reinstall-core, latest, check