Arrange package target in sections
[khome.git] / Makefile
1 MAKEFLAGS := --no-builtin-rules
2
3 DEPS := $(wildcard deps/*)
4
5 .PHONY: \
6 default \
7 $(DEPS) \
8 deps \
9 home \
10 mpdconf \
11 pkgs_brew_cask_install \
12 pkgs_brew_install \
13 pkgs_deb_install \
14 pkgs_deb_purge \
15 pkgs_debian \
16 pkgs_mac \
17 pkgs_pip \
18 pkgs_snap_classic \
19 pkgs_snap_strict
20
21 default:
22 @echo '================================================================================'
23 @echo '| Default target disabled. Specify a concrete one.'
24 @echo '================================================================================'
25 @exit 1
26
27 home: mpdconf
28 @cp -Rp home/bin $(HOME)/
29 @cp -Rp home/lib $(HOME)/
30 @cp home/.compton.conf $(HOME)/
31 @cp -Rp home/.config/ $(HOME)/
32 @cp -Rp home/.newsboat/ $(HOME)/
33 @cp home/.profile $(HOME)/
34 @cp home/.fonts.conf $(HOME)/
35 @fc-cache -fv
36 @cp home/.Rprofile $(HOME)/
37 @cp home/.tmux.conf $(HOME)/
38 @cp home/.xbindkeysrc $(HOME)/
39
40 mpdconf:
41 @mkdir -p ~/Archives/Audio
42 @mkdir -p ~/var/lib/mpd/playlists
43 @mkdir -p ~/var/log/mpd
44 @mkdir -p ~/var/run/mpd
45 @cp home/.mpdconf $(HOME)/
46
47 #
48 # Golang
49 #
50 pkgs_golang: list pkgs-golang.list
51 go get $(shell ./list pkgs-golang.list)
52
53 #
54 # Ubuntu
55 #
56 pkgs_ubuntu: list pkgs-ubuntu.list
57 sudo apt install $(shell ./list pkgs-ubuntu.list)
58
59 #
60 # PIP
61 #
62 pkgs_pip:
63 sudo pip3 install $(shell ./list pkgs-pip.list)
64
65 #
66 # Homebrew/Mac
67 #
68
69 pkgs_mac:
70 $(MAKE) pkgs_brew_install
71 $(MAKE) pkgs_brew_cask_install
72
73 # TODO: Test pkgs_brew_tap when list contains multiple items
74 pkgs_brew_tap: list pkgs-brew-tap.list
75 brew tap $(shell ./list pkgs-brew-tap.list)
76
77 pkgs_brew_install: list pkgs-brew-install.list
78 brew install $(shell ./list pkgs-brew-install.list)
79
80 pkgs_brew_cask_install: list pkgs-brew-cask-install.list
81 brew cask install $(shell ./list pkgs-brew-cask-install.list)
82
83 #
84 # Debian
85 #
86 pkgs_deb_install: list pkgs-deb-install.list
87 sudo apt install $(shell ./list pkgs-deb-install.list)
88
89 pkgs_deb_purge: list pkgs-deb-purge.list
90 sudo apt purge $(shell ./list pkgs-deb-purge.list)
91
92 #
93 # Snap
94 #
95 pkgs_snap_classic: list pkgs-snap-classic.list
96 @$(MAKE) $(foreach p,$(shell ./list pkgs-snap-classic.list),pkg_snap_classic_$(p))
97
98 pkgs_snap_strict: list pkgs-snap-strict.list
99 @$(MAKE) $(foreach p,$(shell ./list pkgs-snap-strict.list),pkg_snap_strict_$(p))
100
101 # 'snap' command comes from 'snapd' deb pkg
102 pkg_snap_classic_%:
103 sudo snap install --classic $*
104 pkg_snap_strict_%:
105 sudo snap install $*
106
107 deps: $(DEPS)
108
109 define GEN_DEP_RULE
110 $(1):
111 cd $1 && make
112 endef
113
114 $(foreach d,$(DEPS),$(eval $(call GEN_DEP_RULE,$(d))))
115
116 diff:
117 diff $(HOME)/.Rprofile home/.Rprofile || true
118 diff $(HOME)/.compton.conf home/.compton.conf || true
119 diff $(HOME)/.config/dunst/dunstrc home/.config/dunst/dunstrc || true
120 diff $(HOME)/.config/mimeapps.list home/.config/mimeapps.list || true
121 diff $(HOME)/.config/neofetch/config.conf home/.config/neofetch/config.conf || true
122 diff $(HOME)/.config/ranger/rc.conf home/.config/ranger/rc.conf || true
123 diff $(HOME)/.config/screengrab/screengrab.conf home/.config/screengrab/screengrab.conf || true
124 diff $(HOME)/.fonts.conf home/.fonts.conf || true
125 diff $(HOME)/.mpdconf home/.mpdconf || true
126 diff $(HOME)/.newsboat/config home/.newsboat/config || true
127 diff $(HOME)/.profile home/.profile || true
128 diff $(HOME)/.tmux.conf home/.tmux.conf || true
129 diff $(HOME)/.xbindkeysrc home/.xbindkeysrc || true
130 diff $(HOME)/lib/login_aliases.sh home/lib/login_aliases.sh || true
131 diff $(HOME)/lib/login_functions.sh home/lib/login_functions.sh || true
132 diff $(HOME)/lib/login_variables.sh home/lib/login_variables.sh || true
133 diff $(HOME)/lib/login_variables_dpi_high.sh home/lib/login_variables_dpi_high.sh || true
134 diff $(HOME)/lib/login_variables_dpi_norm.sh home/lib/login_variables_dpi_norm.sh || true
This page took 0.052465 seconds and 4 git commands to generate.