-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
48 lines (41 loc) · 1.52 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
.PHONY: all bin dotfiles etc test shellcheck
all: bin dotfiles etc
bin:
# add aliases for all the things in bin
for file in $(shell find $(CURDIR)/bin -type f -not -name "*-backlight" -not -name ".*.swp"); do \
f=$$(basename $$file); \
sudo ln -sf $$file /usr/local/bin/$$f; \
done
dotfiles:
# add aliases for dotfiles
for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".travis.yml" -not -name ".git" -not -name ".*.swp" -not -name ".gnupg"); do \
f=$$(basename $$file); \
ln -sf $$file $(HOME)/$$f; \
done; \
gpg --list-keys || true;
ln -sfn $(CURDUR)/.gnupg/gpg.conf $(HOME)/.gpg/gpg.conf;
ln -sfn $(CURDIR)/.gnupg/gpg-agent.conf $(HOME)/.gnupg/gpg-agent.conf;
ln -fn $(CURDIR)/gitignore $(HOME)/.gitignore;
git update-index --skip-worktree $(CURDIR)/.gitconfig;
etc:
sudo mkdir -p /etc/docker/secomp
for file in $(shell find $(CURDIR)/etc/ -type f -not -name ".*.swp"); do \
f=$$(echo $$file | sed -e 's|$(CURDIR)||'); \
sudo ln -f $$file $$f; \
done
systemctl --user daemon-reload || true
sudo systemctl daemon-reload
test: shellcheck
# if this session isn't interactive, then we don't want to allocate a
# TTY, which would fail, but if it is interactive, we do want to attach
# so that the user can send e.g. ^C through.
INTERACTIVE := $(shell [ -t 0 ] && echo 1 || echo 0)
ifeq ($(INTERACTIVE), 1)
DOCKER_FLAGS += -t
endif
shellcheck:
docker run --rm -i $(DOCKER_FLAGS) \
--name df-shellcheck \
-v $(CURDIR):/usr/src:ro \
--workdir /usr/src \
r.j3ss.co/shellcheck ./test.sh