aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 745243386260e1e993fda686ddb29b2e50335f37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
.POSIX:

.PHONY: all \
	clean \
	distclean \
	install \
	install-abook \
	install-bash \
	install-bin \
	install-bin-man \
	install-curl \
	install-dunst \
	install-ex \
	install-finger \
	install-games \
	install-games-man \
	install-git \
	install-gnupg \
	install-gtk \
	install-i3 \
	install-ksh \
	install-less \
	install-login-shell \
	install-man \
	install-mpd \
	install-mutt \
	install-mysql \
	install-ncmcpp \
	install-newsboat \
	install-perlcritic \
	install-perltidy \
	install-psql \
	install-readline \
	install-sh \
	install-subversion \
	install-terminfo \
	install-tidy \
	install-tmux \
	install-urxvt \
	install-vim \
	install-vim-after \
	install-vim-after-ftplugin \
	install-vim-after-indent \
	install-vim-after-plugin \
	install-vim-after-syntax \
	install-vim-bundle \
	install-vim-compiler \
	install-vim-config \
	install-vim-filetype \
	install-vim-ftplugin \
	install-vim-gui \
	install-vim-gui-config \
	install-vim-indent \
	install-vim-plugin \
	install-vint \
	install-wget \
	install-x \
	install-zsh \
	check \
	check-bash \
	check-bin \
	check-games \
	check-ksh \
	check-login-shell \
	check-man \
	check-sh \
	check-urxvt \
	check-xinit \
	check-zsh \
	lint \
	lint-bash \
	lint-bin \
	lint-games \
	lint-ksh \
	lint-sh \
	lint-urxvt \
	lint-vim \
	lint-xinit

.SUFFIXES:
.SUFFIXES: .awk .bash .m4 .mi5 .pl .sed .sh

NAME = 'Tom Ryder'
EMAIL = tom@sanctum.geek.nz
KEY = FA09C06E1B670CD0B2F5DE60C14286EA77BB8872
SENDMAIL = msmtp

BINS = bin/ap \
	bin/apf \
	bin/ax \
	bin/bcq \
	bin/bel \
	bin/bl \
	bin/bp \
	bin/br \
	bin/brnl \
	bin/ca \
	bin/cf \
	bin/cfr \
	bin/chc \
	bin/chn \
	bin/clog \
	bin/clrd \
	bin/clwr \
	bin/csmw \
	bin/dam \
	bin/d2u \
	bin/ddup \
	bin/dfv \
	bin/dmp \
	bin/dub \
	bin/edda \
	bin/eds \
	bin/exm \
	bin/fgscr \
	bin/finc \
	bin/fnl \
	bin/fnp \
	bin/gms \
	bin/grc \
	bin/grec \
	bin/gred \
	bin/gscr \
	bin/gwp \
	bin/han \
	bin/hms \
	bin/htdec \
	bin/htenc \
	bin/htref \
	bin/hurl \
	bin/igex \
	bin/isgr \
	bin/ix \
	bin/jfc \
	bin/jfcd \
	bin/jfp \
	bin/loc \
	bin/mi5 \
	bin/max \
	bin/maybe \
	bin/mean \
	bin/med \
	bin/mex \
	bin/mftl \
	bin/mim \
	bin/min \
	bin/mkcp \
	bin/mkmv \
	bin/mktd \
	bin/mode \
	bin/motd \
	bin/murl \
	bin/mw \
	bin/nlbr \
	bin/oii \
	bin/onl \
	bin/osc \
	bin/pa \
	bin/paz \
	bin/ped \
	bin/pit \
	bin/plmu \
	bin/p \
	bin/pp \
	bin/pph \
	bin/pst \
	bin/pvi \
	bin/pwg \
	bin/quo \
	bin/rep \
	bin/rfcf \
	bin/rfcr \
	bin/rfct \
	bin/rgl \
	bin/rnda \
	bin/rndf \
	bin/rndi \
	bin/rndl \
	bin/rnds \
	bin/sd2u \
	bin/sec \
	bin/shb \
	bin/slow \
	bin/sls \
	bin/slsf \
	bin/sqs \
	bin/sra \
	bin/sshi \
	bin/sta \
	bin/stbl \
	bin/stex \
	bin/stws \
	bin/su2d \
	bin/sue \
	bin/supp \
	bin/swr \
	bin/td \
	bin/tl \
	bin/tlcs \
	bin/tm \
	bin/tot \
	bin/trs \
	bin/try \
	bin/u2d \
	bin/umake \
	bin/unf \
	bin/urlc \
	bin/urlh \
	bin/urlmt \
	bin/uts \
	bin/vest \
	bin/vex \
	bin/wro \
	bin/xgo \
	bin/xgoc \
	bin/xrbg \
	bin/xrq

BINS_M4 = bin/chn.m4 \
	bin/dfv.m4 \
	bin/edda.m4 \
	bin/mim.m4 \
	bin/oii.m4 \
	bin/pst.m4 \
	bin/swr.m4 \
	bin/tlcs.m4 \
	bin/try.m4 \
	bin/urlc.m4

BINS_SH = bin/chn.sh \
	bin/dfv.sh \
	bin/edda.sh \
	bin/mim.sh \
	bin/oii.sh \
	bin/pst.sh \
	bin/swr.sh \
	bin/tlcs.sh \
	bin/try.sh \
	bin/urlc.sh

GAMES = games/aaf \
	games/acq \
	games/aesth \
	games/chkl \
	games/dr \
	games/drakon \
	games/kvlt \
	games/philsay \
	games/pks \
	games/rndn \
	games/rot13 \
	games/squ \
	games/strik \
	games/xyzzy \
	games/zs

all: $(BINS) git/gitconfig gnupg/gpg.conf

clean distclean:
	rm -f -- \
		$(BINS) \
		$(BINS_M4) \
		$(BINS_SH) \
		$(GAMES) \
		git/gitconfig \
		git/gitconfig.m4 \
		gnupg/gpg.conf \
		gnupg/gpg.conf.m4 \
		include/mktd.m4 \
		man/man8/dotfiles.7df \
		urxvt/ext/select \
		vim/dist/*

.awk:
	sh bin/shb.sh awk -f < $< > $@
	chmod +x ./$@

.bash:
	sh bin/shb.sh bash < $< > $@
	chmod +x ./$@

.pl:
	sh bin/shb.sh perl < $< > $@
	chmod +x ./$@

.sed:
	sh bin/shb.sh sed -f < $< > $@
	chmod +x ./$@

.sh:
	sh bin/shb.sh sh < $< > $@
	chmod +x ./$@

.mi5.m4:
	awk -f bin/mi5.awk < $< > $@

.m4.sh:
	m4 < $< > $@

bin/chn.sh: bin/chn.m4 include/mktd.m4
bin/dfv.sh: bin/dfv.m4 include/mktd.m4
bin/edda.sh: bin/edda.m4 include/mktd.m4
bin/mim.sh: bin/mim.m4 include/mktd.m4
bin/oii.sh: bin/oii.m4 include/mktd.m4
bin/pst.sh: bin/pst.m4 include/mktd.m4
bin/swr.sh: bin/swr.m4 include/mktd.m4
bin/tlcs.sh: bin/tlcs.m4 include/mktd.m4
bin/try.sh: bin/try.m4 include/mktd.m4
bin/urlc.sh: bin/urlc.m4 include/mktd.m4

git/gitconfig: git/gitconfig.m4
	m4 \
		-D NAME=$(NAME) \
		-D EMAIL=$(EMAIL) \
		-D KEY=$(KEY) \
		-D SENDMAIL=$(SENDMAIL) \
		git/gitconfig.m4 > $@

KEYSERVER = hkps://hkps.pool.sks-keyservers.net
KEYID_FORMAT = none

gnupg/gpg.conf: gnupg/gpg.conf.m4
	m4 \
		-D KEYSERVER=$(KEYSERVER) \
		-D KEYID_FORMAT=$(KEYID_FORMAT) \
		gnupg/gpg.conf.m4 > $@

MAILDIR = $(HOME)/Mail

install: install-bin \
	install-curl \
	install-ex \
	install-git \
	install-gnupg \
	install-less \
	install-man \
	install-login-shell \
	install-readline \
	install-vim

install-conf:
	sh install/install-conf.sh

install-abook:
	mkdir -p -- $(HOME)/.abook
	cp -p -- abook/abookrc $(HOME)/.abook

install-bash: check-bash install-sh
	mkdir -p -- $(HOME)/.bashrc.d $(HOME)/.bash_completion.d $(HOME)/.config
	cp -p -- bash/bashrc $(HOME)/.bashrc
	cp -p -- bash/bashrc.d/* $(HOME)/.bashrc.d
	cp -p -- bash/bash_profile $(HOME)/.bash_profile
	cp -p -- bash/bash_logout $(HOME)/.bash_logout
	cp -p -- bash/bash_completion $(HOME)/.config
	cp -p -- bash/bash_completion.d/* $(HOME)/.bash_completion.d

install-bin: $(BINS) install-bin-man
	mkdir -p -- $(HOME)/.local/bin
	find bin -type f -perm -u=x \
		-exec cp -p -- {} $(HOME)/.local/bin \;

install-bin-man:
	mkdir -p -- $(HOME)/.local/share/man/man1 $(HOME)/.local/share/man/man8
	cp -p -- man/man1/*.1df $(HOME)/.local/share/man/man1
	cp -p -- man/man8/*.8df $(HOME)/.local/share/man/man8

install-curl:
	cp -p -- curl/curlrc $(HOME)/.curlrc

install-dunst: install-x
	mkdir -p -- $(HOME)/.config/dunst
	cp -p -- dunst/dunstrc $(HOME)/.config/dunst

install-ex:
	cp -p -- ex/exrc $(HOME)/.exrc

install-finger:
	cp -p -- finger/plan $(HOME)/.plan
	cp -p -- finger/project $(HOME)/.project
	cp -p -- finger/pgpkey $(HOME)/.pgpkey

install-games: $(GAMES) install-games-man
	mkdir -p -- $(HOME)/.local/games
	find games -type f -perm -u=x \
		-exec cp -p -- {} $(HOME)/.local/games \;

install-games-man:
	mkdir -p -- $(HOME)/.local/share/man/man6
	cp -p -- man/man6/*.6df $(HOME)/.local/share/man/man6

install-git: git/gitconfig
	cp -p -- git/gitconfig $(HOME)/.gitconfig

install-gnupg: gnupg/gpg.conf
	mkdir -m 0700 -p -- $(HOME)/.gnupg
	cp -p -- gnupg/*.conf $(HOME)/.gnupg

install-gtk:
	mkdir -p -- $(HOME)/.config/gtk-3.0
	cp -p -- gtk/gtkrc-2.0 $(HOME)/.gtkrc-2.0
	cp -p -- gtk/gtk-3.0/settings.ini $(HOME)/.config/gtk-3.0

install-i3: install-x
	mkdir -p -- $(HOME)/.i3
	cp -p -- i3/* $(HOME)/.i3

install-keychain: install-sh
	cp -p -- keychain/profile.d/* $(HOME)/.profile.d
	cp -p -- keychain/shrc.d/* $(HOME)/.shrc.d

install-less:
	cp -p -- less/lesskey $(HOME)/.lesskey
	lesskey

install-man:
	mkdir -p -- $(HOME)/.local/share/man/man7
	cp -p -- man/man7/dotfiles.7df $(HOME)/.local/share/man/man7

install-mpd: install-sh
	mkdir -p -- $(HOME)/.mpd/playlists
	cp -p -- mpd/profile.d/* $(HOME)/.profile.d
	cp -p -- mpd/mpdconf $(HOME)/.mpdconf

install-mutt:
	mkdir -p -- $(HOME)/.muttrc.d $(HOME)/.cache/mutt
	cp -p -- mutt/muttrc $(HOME)/.muttrc
	cp -p -- mutt/muttrc.d/src $(HOME)/.muttrc.d

install-ncmcpp: install-mpd
	mkdir -p -- $(HOME)/.ncmpcpp
	cp -p -- ncmpcpp/config $(HOME)/.ncmpcpp

install-newsboat:
	mkdir -p -- $(HOME)/.config/newsboat $(HOME)/.local/share/newsboat
	cp -p -- newsboat/config $(HOME)/.config/newsboat

install-mysql:
	cp -p -- mysql/my.cnf $(HOME)/.my.cnf

install-ksh: check-ksh install-sh
	mkdir -p -- $(HOME)/.kshrc.d
	cp -p -- ksh/shrc.d/* $(HOME)/.shrc.d
	cp -p -- ksh/kshrc $(HOME)/.kshrc
	cp -p -- ksh/kshrc.d/* $(HOME)/.kshrc.d

install-login-shell: check-login-shell
	sh install/install-login-shell.sh

install-perlcritic:
	cp -p -- perlcritic/perlcriticrc $(HOME)/.perlcriticrc

install-perltidy:
	cp -p -- perltidy/perltidyrc $(HOME)/.perltidyrc

install-plenv: install-sh
	cp -p -- plenv/profile.d/* $(HOME)/.profile.d
	cp -p -- plenv/shrc.d/* $(HOME)/.shrc.d

install-psql:
	cp -p -- psql/psqlrc $(HOME)/.psqlrc

install-readline:
	cp -p -- readline/inputrc $(HOME)/.inputrc

install-sh: check-sh
	mkdir -p -- $(HOME)/.profile.d $(HOME)/.shrc.d
	cp -p -- sh/profile $(HOME)/.profile
	cp -p -- sh/profile.d/* $(HOME)/.profile.d
	cp -p -- sh/shinit $(HOME)/.shinit
	cp -p -- sh/shrc $(HOME)/.shrc
	cp -p -- sh/shrc.d/* $(HOME)/.shrc.d

install-subversion:
	mkdir -p -- $(HOME)/.subversion
	cp -p -- subversion/config $(HOME)/.subversion

install-terminfo:
	find terminfo -type f -name '*.ti' \
		-exec tic -- {} \;

install-tidy: install-sh
	cp -p -- tidy/profile.d/* $(HOME)/.profile.d
	cp -p -- tidy/tidyrc $(HOME)/.tidyrc

install-tmux: tmux/tmux.conf install-terminfo
	cp -p -- tmux/tmux.conf $(HOME)/.tmux.conf

install-urxvt: urxvt/ext/select
	mkdir -p -- $(HOME)/.urxvt/ext
	find urxvt/ext -type f ! -name '*.pl' \
		-exec cp -p -- {} $(HOME)/.urxvt/ext \;

# Change these at invocation to install for NeoVim; see README.md
VIMDIR = $(HOME)/.vim
VIMRC = $(HOME)/.vimrc

install-vim: install-vim-after \
	install-vim-autoload \
	install-vim-bundle \
	install-vim-compiler \
	install-vim-config \
	install-vim-filetype \
	install-vim-ftplugin \
	install-vim-indent

install-vim-after: install-vim-after-ftplugin \
	install-vim-after-indent \
	install-vim-after-plugin \
	install-vim-after-syntax

install-vim-after-ftplugin:
	mkdir -p $(VIMDIR)/after/ftplugin
	for type in vim/after/ftplugin/* ; do \
		mkdir -p -- $(VIMDIR)/after/ftplugin/"$${type##*/}" ; \
		cp -p -- "$$type"/* $(VIMDIR)/after/ftplugin/"$${type##*/}" ; \
		done

install-vim-after-indent:
	mkdir -p $(VIMDIR)/after/indent
	cp -p -- vim/after/indent/*.vim $(VIMDIR)/after/indent

install-vim-after-plugin:
	mkdir -p $(VIMDIR)/after/plugin
	cp -p -- vim/after/plugin/*.vim $(VIMDIR)/after/plugin

install-vim-after-syntax:
	mkdir -p $(VIMDIR)/after/syntax
	cp -p -- vim/after/syntax/*.vim $(VIMDIR)/after/syntax

install-vim-autoload:
	mkdir -p -- $(VIMDIR)/autoload
	cp -p -- vim/autoload/*.vim $(VIMDIR)/autoload

install-vim-bundle: install-vim-config
	find vim/bundle/*/* \
		-type d -exec sh -c \
		'mkdir -p -- $(VIMDIR)/"$${1#vim/bundle/*/}"' _ {} \;
	find vim/bundle/*/*/* \
		-type f -exec sh -c \
		'cp -p -- "$$1" $(VIMDIR)/"$${1#vim/bundle/*/}"' _ {} \;
	vim -e --cmd 'helptags $(VIMDIR)/doc' --cmd quit

install-vim-compiler:
	mkdir -p -- $(VIMDIR)/compiler
	cp -p -- vim/compiler/*.vim $(VIMDIR)/compiler

install-vim-config:
	cp -p -- vim/vimrc $(VIMRC)

install-vim-filetype:
	cp -p -- vim/filetype.vim $(VIMDIR)
	cp -p -- vim/scripts.vim $(VIMDIR)

install-vim-ftplugin:
	mkdir -p -- $(VIMDIR)/ftplugin
	cp -p -- vim/ftplugin/*.vim $(VIMDIR)/ftplugin

install-vim-indent:
	mkdir -p -- $(VIMDIR)/indent
	cp -p -- vim/indent/*.vim $(VIMDIR)/indent

install-vim-gui: install-vim \
	install-vim-gui-config

install-vim-gui-config:
	cp -p -- vim/gvimrc $(HOME)/.gvimrc

install-vim-plugin:
	mkdir -p -- $(VIMDIR)/plugin
	cp -p -- vim/plugin/*.vim $(VIMDIR)/plugin

install-vint:
	cp -p -- vint/vintrc.yaml $(HOME)/.vintrc.yaml

install-wget:
	cp -p -- wget/wgetrc $(HOME)/.wgetrc

install-x: check-xinit
	mkdir -p -- \
		$(HOME)/.config \
		$(HOME)/.config/sxhkdrc \
		$(HOME)/.xinitrc.d \
		$(HOME)/.Xresources.d
	cp -p -- X/redshift.conf $(HOME)/.config
	cp -p -- X/sxhkdrc $(HOME)/.config/sxhkd
	cp -p -- X/xinitrc $(HOME)/.xinitrc
	cp -p -- X/xinitrc.d/* $(HOME)/.xinitrc.d
	cp -p -- X/Xresources $(HOME)/.Xresources
	cp -p -- X/Xresources.d/* $(HOME)/.Xresources.d

install-zsh: check-zsh install-sh
	mkdir -p -- $(HOME)/.profile.d $(HOME)/.zshrc.d
	cp -p -- zsh/profile.d/* $(HOME)/.profile.d
	cp -p -- zsh/zprofile $(HOME)/.zprofile
	cp -p -- zsh/zshrc $(HOME)/.zshrc
	cp -p -- zsh/zshrc.d/* $(HOME)/.zshrc.d

check: check-bin \
	check-login-shell \
	check-man \
	check-sh

check-bash:
	sh check/bash.sh

check-bin: $(BINS)
	sh check/bin.sh

check-games: $(GAMES)
	sh check/games.sh

check-man:
	sh check/man.sh

check-ksh:
	sh check/ksh.sh

check-login-shell:
	sh check/login-shell.sh

check-sh:
	sh check/sh.sh

check-urxvt: urxvt/ext/select
	sh check/urxvt.sh

check-xinit:
	sh check/xinit.sh

check-zsh:
	sh check/zsh.sh

lint: lint-bash \
	lint-bin \
	lint-games \
	lint-ksh \
	lint-sh \
	lint-urxvt \
	lint-vim \
	lint-xinit

lint-bash: check-bash
	sh lint/bash.sh

lint-bin: check-bin
	sh lint/bin.sh

lint-games: check-games
	sh lint/games.sh

lint-ksh: check-ksh
	sh lint/ksh.sh

lint-sh: check-sh
	sh lint/sh.sh

lint-urxvt: check-urxvt
	sh lint/urxvt.sh

lint-vim:
	sh lint/vim.sh

lint-xinit: check-xinit
	sh lint/xinit.sh