b67b8ce371b33b01c9b583e4a619b5228ff4cdc7
[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 pkgs_golang: list pkgs-golang.list
48 go get $(shell ./list pkgs-golang.list)
49
50 pkgs_ubuntu: list pkgs-ubuntu.list
51 sudo apt install $(shell ./list pkgs-ubuntu.list)
52
53 pkgs_mac:
54 $(MAKE) pkgs_brew_install
55 $(MAKE) pkgs_brew_cask_install
56
57 pkgs_pip:
58 sudo pip3 install $(shell ./list pkgs-pip.list)
59
60 # TODO: Test pkgs_brew_tap when list contains multiple items
61 pkgs_brew_tap: list pkgs-brew-tap.list
62 brew tap $(shell ./list pkgs-brew-tap.list)
63
64 pkgs_brew_install: list pkgs-brew-install.list
65 brew install $(shell ./list pkgs-brew-install.list)
66
67 pkgs_brew_cask_install: list pkgs-brew-cask-install.list
68 brew cask install $(shell ./list pkgs-brew-cask-install.list)
69
70 pkgs_deb_install: list pkgs-deb-install.list
71 sudo apt install $(shell ./list pkgs-deb-install.list)
72
73 pkgs_deb_purge: list pkgs-deb-purge.list
74 sudo apt purge $(shell ./list pkgs-deb-purge.list)
75
76 pkgs_snap_classic: list pkgs-snap-classic.list
77 @$(MAKE) $(foreach p,$(shell ./list pkgs-snap-classic.list),pkg_snap_classic_$(p))
78
79 pkgs_snap_strict: list pkgs-snap-strict.list
80 @$(MAKE) $(foreach p,$(shell ./list pkgs-snap-strict.list),pkg_snap_strict_$(p))
81
82 # 'snap' command comes from 'snapd' deb pkg
83 pkg_snap_classic_%:
84 sudo snap install --classic $*
85 pkg_snap_strict_%:
86 sudo snap install $*
87
88 deps: $(DEPS)
89
90 define GEN_DEP_RULE
91 $(1):
92 cd $1 && make
93 endef
94
95 $(foreach d,$(DEPS),$(eval $(call GEN_DEP_RULE,$(d))))
96
97 diff:
98 diff $(HOME)/.Rprofile home/.Rprofile || true
99 diff $(HOME)/.compton.conf home/.compton.conf || true
100 diff $(HOME)/.config/dunst/dunstrc home/.config/dunst/dunstrc || true
101 diff $(HOME)/.config/mimeapps.list home/.config/mimeapps.list || true
102 diff $(HOME)/.config/neofetch/config.conf home/.config/neofetch/config.conf || true
103 diff $(HOME)/.config/ranger/rc.conf home/.config/ranger/rc.conf || true
104 diff $(HOME)/.config/screengrab/screengrab.conf home/.config/screengrab/screengrab.conf || true
105 diff $(HOME)/.fonts.conf home/.fonts.conf || true
106 diff $(HOME)/.mpdconf home/.mpdconf || true
107 diff $(HOME)/.newsboat/config home/.newsboat/config || true
108 diff $(HOME)/.profile home/.profile || true
109 diff $(HOME)/.tmux.conf home/.tmux.conf || true
110 diff $(HOME)/.xbindkeysrc home/.xbindkeysrc || true
111 diff $(HOME)/lib/login_aliases.sh home/lib/login_aliases.sh || true
112 diff $(HOME)/lib/login_functions.sh home/lib/login_functions.sh || true
113 diff $(HOME)/lib/login_variables.sh home/lib/login_variables.sh || true
114 diff $(HOME)/lib/login_variables_dpi_high.sh home/lib/login_variables_dpi_high.sh || true
115 diff $(HOME)/lib/login_variables_dpi_norm.sh home/lib/login_variables_dpi_norm.sh || true
This page took 0.085539 seconds and 3 git commands to generate.