Fix diff missing from .PHONY targets
[khome.git] / Makefile
... / ...
CommitLineData
1MAKEFLAGS := --no-builtin-rules
2
3DEPS := $(wildcard deps/*)
4
5.PHONY: \
6 default \
7 clean \
8 $(DEPS) \
9 deps \
10 home \
11 diff \
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
23default:
24 @echo '================================================================================'
25 @echo '| Default target disabled. Specify a concrete one.'
26 @echo '================================================================================'
27 @exit 1
28
29home: 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
42mpdconf:
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
49compiled:
50 mkdir -p bin
51 cd src && make
52 mv src/clockloop bin/
53
54font_cache:
55 @fc-cache -fv
56
57#
58# Golang
59#
60pkgs_golang: list pkgs-golang.list
61 go get $(shell ./list pkgs-golang.list)
62
63#
64# Ubuntu
65#
66pkgs_ubuntu: list pkgs-ubuntu.list
67 sudo apt install $(shell ./list pkgs-ubuntu.list)
68
69pkgs_ubuntu_debfiles: list pkgs-ubuntu-debfiles.list
70 ./install-debfiles pkgs-ubuntu-debfiles.list
71
72#
73# PIP
74#
75pkgs_pip:
76 sudo pip3 install $(shell ./list pkgs-pip.list)
77
78#
79# Homebrew/Mac
80#
81
82pkgs_mac:
83 $(MAKE) pkgs_brew_install
84 $(MAKE) pkgs_brew_cask_install
85
86# TODO: Test pkgs_brew_tap when list contains multiple items
87pkgs_brew_tap: list pkgs-brew-tap.list
88 brew tap $(shell ./list pkgs-brew-tap.list)
89
90pkgs_brew_install: list pkgs-brew-install.list
91 brew install $(shell ./list pkgs-brew-install.list)
92
93pkgs_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#
99pkgs_deb_install: list pkgs-deb-install.list
100 sudo apt install $(shell ./list pkgs-deb-install.list)
101
102pkgs_deb_purge: list pkgs-deb-purge.list
103 sudo apt purge $(shell ./list pkgs-deb-purge.list)
104
105#
106# Snap
107#
108pkgs_snap_classic: list pkgs-snap-classic.list
109 @$(MAKE) $(foreach p,$(shell ./list pkgs-snap-classic.list),pkg_snap_classic_$(p))
110
111pkgs_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
115pkg_snap_classic_%:
116 sudo snap install --classic $*
117pkg_snap_strict_%:
118 sudo snap install $*
119
120deps: $(DEPS)
121
122define GEN_DEP_RULE
123$(1):
124 cd $1 && make
125endef
126
127$(foreach d,$(DEPS),$(eval $(call GEN_DEP_RULE,$(d))))
128
129diff:
130 find home -type f -print0 \
131 | sed -z 's/^home\///g' \
132 | xargs -0 -I% sh -c 'echo %; diff --color=always ~/% home/%'
133
134clean:
135 rm -rf ./debfiles
136 cd src && make clean
This page took 0.022514 seconds and 4 git commands to generate.