-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (51 loc) · 1.44 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
VERSION = $(shell date "+%Y%m%d")
DESTDIR ?=
PREFIX ?= /usr/local
SYSCONFDIR ?= /etc
ESELECTCONFDIR ?= $(DESTDIR)/$(SYSCONFDIR)/eselect/hypr-dotfiles
CONFDIR ?= $(ESELECTCONFDIR)/configs
ESELECTDIR ?= $(DESTDIR)/$(PREFIX)/share/eselect/modules
BUILDDIR ?= build
SPECDATADIR ?= spec/data
CPCMD ?= cp -ar
INSTALLMKDIRCMD ?= install -d
INSTALLFILECMD ?= install -D -m0644
JOINCMD ?= contrib/join
RMDIRCMD ?= rm -fr
SEDCMD ?= sed
SHELLSPECCMD ?= shellspec
.PHONY: all
all: $(BUILDDIR)/hypr-dotfiles.eselect
$(BUILDDIR):
$(INSTALLMKDIRCMD) $@
$(BUILDDIR)/hypr-dotfiles.eselect: src/hypr-dotfiles.eselect.in $(BUILDDIR)
$(JOINCMD) \
VERSION='"$(VERSION)"' \
DIRECTORIES=src/directories.sh \
CORE=src/core \
HELPERS=src/helpers \
ACTIONS=src/actions \
$< > $@
$(BUILDDIR)/test-hypr-dotfiles.eselect: src/hypr-dotfiles.eselect.in $(BUILDDIR)
$(JOINCMD) \
VERSION='"$(VERSION)"' \
DIRECTORIES=helper/include/directories.sh \
CORE=helper/include/core.sh \
HELPERS=helper/include/helpers.sh \
ACTIONS=helper/include/actions.sh \
$< > $@
.PHONY: clean
clean:
$(RMDIRCMD) $(BUILDDIR)
.PHONY: coverage
coverage: $(BUILDDIR)/test-hypr-dotfiles.eselect
$(SHELLSPECCMD) --kcov
.PHONY: test
test: $(BUILDDIR)/test-hypr-dotfiles.eselect
$(SHELLSPECCMD)
.PHONY: install
install: $(BUILDDIR)/hypr-dotfiles.eselect
$(INSTALLMKDIRCMD) $(CONFDIR)
$(INSTALLFILECMD) \
$(BUILDDIR)/hypr-dotfiles.eselect \
$(ESELECTDIR)/hypr-dotfiles.eselect