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