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

                       
               

                   
                   
                 
 



                                               




                                                    
                                                                                
 
            

                             



                                                              
 
                  



                                                                               
                  



                                                                                
               
                                                                  
INTO      = $(HOME)


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


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

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

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

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

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

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

.PHONY: clean-dead
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
install: $(INSTALLED) $(HOME)/src $(HOME)/.ssh/authorized_keys git