-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (29 loc) · 863 Bytes
/
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
SHELL := /bin/bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
SHELLCHECK = shellcheck
IGNORE = "(\.gitmodules|\.editorconfig|fish_variables|Taskfile\.y*ml|submodules|Makefile\.*|README\.md|\.drone.yml|\.github|\.gitlab-ci\.yml|Jenkinsfile|LICENSE)"
STOW = stow -v -t $(DEST) --ignore=$(IGNORE) --no-folding --dotfiles
ALL = $(shell git ls-files | grep -vE $(IGNORE))
DEST = $(HOME)
all: $(ALL)
shellcheck: $(shell grep --exclude-dir=.git -rlE '^#!/.*(sh|bash)' | xargs) $(shell git ls-files dot-config/bash.d | xargs)
@echo "+ $@ : $^"
$(SHELLCHECK) $^
.PHONY: shellcheck
test: shellcheck
stow: $(ALL)
@echo "+ $@"
$(STOW) -S ./
.PHONY: stow
unstow: $(ALL)
@echo "+ $@"
$(STOW) -D ./
.PHONY: unstow
restow: $(ALL)
@echo "+ $@"
$(STOW) -R ./
.PHONY: restow