summaryrefslogblamecommitdiff
path: root/Makefile
blob: 9fc2c0bfac8e65a272ff30c52eff53135b5b0b73 (plain) (tree)
1
2
3
4
5
6
7
8
9


                 
                  
                         
                   
                     
                   
 
    
                                                             




                                                  
                                                                              





                                                    
                                                                                






                            








                                                                                
INTO    = $(HOME)

INSTALL = \
	  bashrc \
	  aspell.en.pws \
	  emacs.d \
	  gitconfig \
	  gitignore

git:
	git config --local user.email "franck.cuny@gmail.com"
	git config --local user.name "Franck Cuny"

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

install: $(INSTALLED) $(HOME)/bin $(HOME)/src $(HOME)/.ssh/authorized_keys git

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

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

$(HOME)/bin:
	mkdir -p $(HOME)/bin

$(HOME)/src:
	mkdir -p $(HOME)/src

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

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

.PHONY: install check-dead clean-dead git