-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (43 loc) · 2.21 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
# my-dotfiles | Copyright (C) 2021 eth-p
# Repository: https://github.com/eth-p/my-dotfiles
REPO_ROOT := "$(dir "$(mkfile_path)")"
.PHONY: all
all: list
# Help
list:
@ echo "Available targets:"; \
printf " - list\n"; \
printf " - requirements\n"; \
printf " - install\n"; \
for f in .install/*.make; do \
printf " - install/%s\n" `basename -- $$f .make`; \
done; \
# -----------------------------------------------------------------------------
# Install:
# -----------------------------------------------------------------------------
install/%: .install/%.make
@cd "${REPO_ROOT}" && make -f "$<" _install
.PHONY: install
install: $(patsubst .install/%.make,install/%,$(filter-out .install/steamos-%,$(wildcard .install/*.make)))
@true
# -----------------------------------------------------------------------------
# Install Requirements:
# -----------------------------------------------------------------------------
requirements/%: .install/%.make
@ cd "${REPO_ROOT}"; \
system=`uname -s`; \
if [ -n "$$TERMUX_APP_PID" ]; then system="termux"; fi; \
case "$$system" in \
Darwin) system='mac';; \
Linux|linux) case "`sh -c '. /etc/os-release && echo "$$ID"'`" in \
arch) system='arch';; \
steamos) system='steamos';; \
esac;; \
esac; \
make -f "$<" _requirements_"$$system"; \
if grep '^_post_requirements:' "$<" &>/dev/null; then \
make -f "$<" _post_requirements; \
fi
.PHONY: requirements
requirements: $(patsubst .install/%.make,requirements/%,$(wildcard .install/*.make))
@true