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