dotfiles

config files for my linux setup
git clone git://edryd.org/dotfiles
Log | Files | Refs | README

Makefile (1571B)


      1 CURDIR ?= $(.CURDIR)
      2 TARGET = ~
      3 TARGETSL = ~/code/dl/sl
      4 
      5 symlinks = bash_profile \
      6            bashrc \
      7            config/clipit \
      8            config/htop \
      9            config/openbox \
     10            config/tint2 \
     11            config/sxhkd \
     12            conkyrc \
     13            ctags \
     14            dircolors \
     15            emacs \
     16            gdbinit \
     17            gitconfig \
     18            nvimrc \
     19            pylintrc \
     20            terminfo \
     21            themes \
     22            tmux \
     23            tmux.conf \
     24            vim \
     25            vimrc \
     26            vimrc.bundles \
     27            xinitrc \
     28            zshrc
     29 
     30 sllinks = dmenu \
     31           dwm \
     32           dvtm \
     33           slock \
     34           slstatus \
     35           st \
     36           surf \
     37           tabbed
     38 
     39 all:
     40 	@echo to install dotfiles to $(TARGET) run \'make install\'
     41 
     42 install-dotfiles: $(symlinks)
     43 
     44 install-sl: $(sllinks)
     45 
     46 install: $(symlinks) $(sllinks)
     47 	ln -fsn $(CURDIR)/bin $(TARGET)/bin
     48 
     49 # create symbolic link in home to dotfile
     50 # remove link if one already exists or save file as a backup
     51 $(symlinks):
     52 	@if [ -e $(TARGET)/.$@ ]; then \
     53 		if [ -L $(TARGET)/.$@ ]; then \
     54 			rm -f $(TARGET)/.$@; \
     55 		else \
     56 			echo mv $(TARGET)/.$@ $(TARGET)/$@-old; \
     57 			mv $(TARGET)/.$@ $(TARGET)/$@-old; \
     58 		fi \
     59 	fi
     60 	ln -sn $(CURDIR)/$@ $(TARGET)/.$@
     61 
     62 # if suckless project is downloaded, link config header there
     63 $(sllinks):
     64 	@if [ -e $(TARGETSL)/$@ ]; then \
     65 		echo ln -fsn $(CURDIR)/sl/$@.h $(TARGETSL)/$@/config.h; \
     66 		ln -fsn $(CURDIR)/sl/$@.h $(TARGETSL)/$@/config.h; \
     67 	fi
     68 
     69 .PHONY: all install-dotfiles install-sl install $(symlinks) $(sllinks)