summary refs log tree commit diff
path: root/Makefile
blob: dd498cedfd0da6e054b105d8f5fbd6cd5acd9e40 (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
INTO      = $(HOME)


INSTALL = \
	agignore \
	aspell.en.pws \
	ctags \
  config/i3 \
	emacs.d \
	gitconfig \
	gitignore \
	tmux.conf \
	Xresources \
	xsession \
	zshenv \
	zshrc

INSTALLED = $(patsubst %,$(INTO)/.%,$(INSTALL))
LN        = @ln -sf

$(INTO)/.% : %
	@[ ! -e $@ ] || [ -h $@ ] || mv -f $@ $@.bak
	$(LN) $(PWD)/$< $@

$(HOME)/.ssh/authorized_keys:
	@curl https://github.com/fcuny.keys -o $(HOME)/.ssh/authorized_keys

$(HOME)/workspace:
	@mkdir -p $(HOME)/workspace/

$(HOME)/Documents/screenshots:
	@mkdir -p $(HOME)/Documents/screenshots

.PHONE: osx
osx:
	@./scripts/osx.sh

.PHONY: go-setup
go-setup:
	@go get -u github.com/kisielk/errcheck
	@go get -u github.com/rogpeppe/godef
	@go get -u github.com/zmb3/gogetdoc
	@go get -u golang.org/x/tools/cmd/goimports
	@go get -u golang.org/x/tools/cmd/guru

.PHONY: git
git:
	@git config --local user.email "franck@fcuny.net"
	@git config --local user.name "Franck Cuny"

.PHONY: check-dead
check-dead:
	@find ~ -maxdepth 1 -name '.*' -type l -exec test ! -e {} \; -print

.PHONY: clean-dead
clean-dead:
	@find ~ -maxdepth 1 -name '.*' -type l -exec test ! -e {} \; -delete

.PHONY: install
install: $(INSTALLED) $(HOME)/workspace $(HOME)/.ssh/authorized_keys $(HOME)/Documents/screenshots osx