Commit | Line | Data |
---|---|---|
80cc9199 SK |
1 | MAKEFLAGS := --no-builtin-rules |
2 | ||
f908f2dc SK |
3 | DEPS := $(wildcard deps/*) |
4 | ||
0b63d662 SK |
5 | ifeq ($(shell uname),Darwin) |
6 | SED := gsed | |
7 | DIFF := $(shell gls -t1 /usr/local/Cellar/diffutils/*/bin/diff | head -1) | |
8 | else | |
9 | SED := sed | |
10 | DIFF := diff | |
11 | endif | |
12 | ||
2b497be2 | 13 | .PHONY: \ |
d03ce0c0 SK |
14 | default \ |
15 | clean \ | |
2b497be2 SK |
16 | $(DEPS) \ |
17 | deps \ | |
18 | home \ | |
ba898a09 | 19 | diff \ |
8132c0e4 | 20 | pull \ |
2b497be2 SK |
21 | mpdconf \ |
22 | pkgs_brew_cask_install \ | |
23 | pkgs_brew_install \ | |
dee031b5 | 24 | pkgs_cargo \ |
2b497be2 SK |
25 | pkgs_deb_install \ |
26 | pkgs_deb_purge \ | |
27 | pkgs_debian \ | |
28 | pkgs_mac \ | |
32cd449e SK |
29 | pkgs_pip_install \ |
30 | pkgs_pip_upgrade \ | |
2b497be2 SK |
31 | pkgs_snap_classic \ |
32 | pkgs_snap_strict | |
80cc9199 | 33 | |
75b7a956 SK |
34 | default: |
35 | @echo '================================================================================' | |
36 | @echo '| Default target disabled. Specify a concrete one.' | |
37 | @echo '================================================================================' | |
38 | @exit 1 | |
39 | ||
de7ac8e9 SK |
40 | home: mpdconf compiled |
41 | @cp -Rp bin $(HOME)/ | |
9e667c0c SK |
42 | @cp -Rp home/bin $(HOME)/ |
43 | @cp -Rp home/lib $(HOME)/ | |
57667523 | 44 | @cp home/.compton.conf $(HOME)/ |
9e667c0c | 45 | @cp -Rp home/.config/ $(HOME)/ |
f1950371 | 46 | @cp -Rp home/.newsboat/ $(HOME)/ |
9e667c0c SK |
47 | @cp home/.profile $(HOME)/ |
48 | @cp home/.fonts.conf $(HOME)/ | |
9e667c0c | 49 | @cp home/.Rprofile $(HOME)/ |
9e667c0c SK |
50 | @cp home/.tmux.conf $(HOME)/ |
51 | @cp home/.xbindkeysrc $(HOME)/ | |
e63982b9 | 52 | @cp -Rp home/.Mathematica/ $(HOME)/ |
b2efbb10 | 53 | |
9d953881 SK |
54 | mpdconf: |
55 | @mkdir -p ~/Archives/Audio | |
56 | @mkdir -p ~/var/lib/mpd/playlists | |
57 | @mkdir -p ~/var/log/mpd | |
58 | @mkdir -p ~/var/run/mpd | |
59 | @cp home/.mpdconf $(HOME)/ | |
60 | ||
de7ac8e9 SK |
61 | compiled: |
62 | mkdir -p bin | |
63 | cd src && make | |
64 | mv src/clockloop bin/ | |
65 | ||
bf20a98b SK |
66 | font_cache: |
67 | @fc-cache -fv | |
68 | ||
5bf7b45d SK |
69 | # |
70 | # Golang | |
71 | # | |
f30c615c SK |
72 | pkgs_golang: list pkgs-golang.list |
73 | go get $(shell ./list pkgs-golang.list) | |
74 | ||
5bf7b45d SK |
75 | # |
76 | # Ubuntu | |
77 | # | |
31b0313b SK |
78 | pkgs_ubuntu: list pkgs-ubuntu.list |
79 | sudo apt install $(shell ./list pkgs-ubuntu.list) | |
80 | ||
d03ce0c0 SK |
81 | pkgs_ubuntu_debfiles: list pkgs-ubuntu-debfiles.list |
82 | ./install-debfiles pkgs-ubuntu-debfiles.list | |
83 | ||
5bf7b45d SK |
84 | # |
85 | # PIP | |
86 | # | |
32cd449e SK |
87 | pkgs_pip_install: |
88 | pip3 install --user $(shell ./list pkgs-pip.list) | |
89 | ||
90 | pkgs_pip_upgrade: | |
91 | pip3 install --user --upgrade $(shell ./list pkgs-pip.list) | |
5bf7b45d | 92 | |
dee031b5 SK |
93 | # |
94 | # Rust (cargo) | |
95 | # | |
96 | ||
97 | pkgs_cargo: list pkgs-cargo.list | |
98 | cargo install $(shell ./list pkgs-cargo.list) | |
99 | ||
5bf7b45d SK |
100 | # |
101 | # Homebrew/Mac | |
102 | # | |
103 | ||
70300ea4 SK |
104 | pkgs_mac: |
105 | $(MAKE) pkgs_brew_install | |
106 | $(MAKE) pkgs_brew_cask_install | |
107 | ||
cfe722ba SK |
108 | # TODO: Test pkgs_brew_tap when list contains multiple items |
109 | pkgs_brew_tap: list pkgs-brew-tap.list | |
110 | brew tap $(shell ./list pkgs-brew-tap.list) | |
111 | ||
70300ea4 SK |
112 | pkgs_brew_install: list pkgs-brew-install.list |
113 | brew install $(shell ./list pkgs-brew-install.list) | |
114 | ||
115 | pkgs_brew_cask_install: list pkgs-brew-cask-install.list | |
116 | brew cask install $(shell ./list pkgs-brew-cask-install.list) | |
117 | ||
5bf7b45d SK |
118 | # |
119 | # Debian | |
120 | # | |
649af0dd SK |
121 | pkgs_deb_install: list pkgs-deb-install.list |
122 | sudo apt install $(shell ./list pkgs-deb-install.list) | |
600d3b0b | 123 | |
649af0dd SK |
124 | pkgs_deb_purge: list pkgs-deb-purge.list |
125 | sudo apt purge $(shell ./list pkgs-deb-purge.list) | |
b59a4c3b | 126 | |
5bf7b45d SK |
127 | # |
128 | # Snap | |
129 | # | |
649af0dd SK |
130 | pkgs_snap_classic: list pkgs-snap-classic.list |
131 | @$(MAKE) $(foreach p,$(shell ./list pkgs-snap-classic.list),pkg_snap_classic_$(p)) | |
6ce65841 | 132 | |
7ae05795 SK |
133 | pkgs_snap_strict: list pkgs-snap-strict.list |
134 | @$(MAKE) $(foreach p,$(shell ./list pkgs-snap-strict.list),pkg_snap_strict_$(p)) | |
135 | ||
136 | # 'snap' command comes from 'snapd' deb pkg | |
6ce65841 SK |
137 | pkg_snap_classic_%: |
138 | sudo snap install --classic $* | |
7ae05795 SK |
139 | pkg_snap_strict_%: |
140 | sudo snap install $* | |
6ce65841 | 141 | |
f908f2dc SK |
142 | deps: $(DEPS) |
143 | ||
144 | define GEN_DEP_RULE | |
145 | $(1): | |
146 | cd $1 && make | |
147 | endef | |
148 | ||
149 | $(foreach d,$(DEPS),$(eval $(call GEN_DEP_RULE,$(d)))) | |
ab64e543 SK |
150 | |
151 | diff: | |
cca3111e | 152 | find home -type f -print0 \ |
0b63d662 SK |
153 | | $(SED) -z 's/^home\///g' \ |
154 | | xargs -0 -I% sh -c 'echo %; $(DIFF) --color=always ~/% home/%' | |
d03ce0c0 | 155 | |
8132c0e4 SK |
156 | pull: |
157 | find home -type f -print0 \ | |
0b63d662 SK |
158 | | $(SED) -z 's/^home\///g' \ |
159 | | xargs -0 -I% sh -c '$(DIFF) -q ~/% home/% > /dev/null || cp ~/% home/%' | |
8132c0e4 | 160 | |
d03ce0c0 SK |
161 | clean: |
162 | rm -rf ./debfiles | |
163 | cd src && make clean |