Skip to content

Commit

Permalink
refactors Makefile, removes singles and keeps configurations separately.
Browse files Browse the repository at this point in the history
  • Loading branch information
gzagatti committed Oct 19, 2022
1 parent f178261 commit b1746eb
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 113 deletions.
165 changes: 64 additions & 101 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,121 +3,84 @@ workspace := $(HOME)

.PHONY: all

# SHELLS
inputrc:
ln -fs $(dotfiles)/shells/inputrc $(workspace)/.inputrc

bash: inputrc
ln -fs $(dotfiles)/shells/bash_profile $(workspace)/.bash_profile
ln -fs $(dotfiles)/shells/bashrc $(workspace)/.bashrc

zsh: inputrc
ln -fs $(dotfiles)/shells/zshrc $(workspace)/.zshrc

tmux:
ln -fs $(dotfiles)/shells/tmux.conf $(workspace)/.tmux.conf

shells: bash zsh tmux

# NIX
nixfiles := $(shell find nix -type f -printf "$(workspace)/.config/%P\n")

nix: $(nixfiles)

$(nixfiles): $(workspace)/.config/%: nix/%
mkdir -p $(dir $@)
ln -fs $(dotfiles)/$^ $@

# NVIM
nvimfiles := $(shell find nvim -type f -printf "$(workspace)/.config/%p\n")

nvim: $(nvimfiles)

$(nvimfiles): $(workspace)/.config/%: %
mkdir -p $(dir $@)
ln -fs $(dotfiles)/$^ $@

# EMACS
emacsfiles := $(shell find emacs -type f -printf "$(workspace)/.emacs.d/%p\n")

emacs: $(emacsfiles)

$(emacsfiles): $(workspace)/.emacs.d/%: %
mkdir -p $(dir $@)
ln -fs $(dotfiles)/$^ $@

# KITTY
kittyfiles := $(shell find kitty -type f -printf "$(workspace)/.config/%p\n")

kitty: $(kittyfiles)
# SYMLINK CREATION
bin/%:
mkdir -p $(workspace)/.local/$(@D)
ln -fs $(dotfiles)/$@ $(workspace)/.local/$@

$(kittyfiles): $(workspace)/.config/%: %
mkdir -p $(dir $@)
ln -fs $(dotfiles)/$^ $@
emacs/%:
mkdir -p $(workspace)/.emacs.d
ln -fs $(dotfiles)/$@ $(workspace)/.emacs.d/$(@F)

# ROFI
rofifiles := $(shell find rofi -type f -printf "$(workspace)/.config/%p\n")

rofi: $(rofifiles)

$(rofifiles): $(workspace)/.config/%: %
mkdir -p $(dir $@)
ln -fs $(dotfiles)/$^ $@

# NNN
nnnfiles := $(shell find nnn -type f -printf "$(workspace)/.config/%p\n")
gtk/%:
mkdir -p $(workspace)/.config/gtk-3.0
mkdir -p $(workspace)/.config/gtk-4.0
ln -fs $(dotfiles)/$@ $(workspace)/.config/gtk-3.0/$(@F)
ln -fs $(dotfiles)/$@ $(workspace)/.config/gtk-4.0/$(@F)

nnn: $(nnnfiles)
julia/%:
mkdir -p $(workspace)/.julia/config
ln -fs $(dotfiles)/$@ $(workspace)/.julia/config/$(@F)

$(nnnfiles): $(workspace)/.config/%: %
mkdir -p $(dir $@)
ln -fs $(dotfiles)/$^ $@
jupyter/%:
mkdir -p $(workspace)/.jupyter
ln -fs $(dotfiles)/$@ $(workspace)/.jupyter/$(@F)

# BINARIES
binfiles := $(shell find bin -type f -printf "$(workspace)/.local/%p\n")
nix/%:
mkdir -p $(workspace)/$(@D:nix/%=%)
ln -fs $(dotfiles)/$@ $(workspace)/.config/$(@:nix/%=%)

bin: $(binfiles)
texlive/%:
mkdir -p $(workspace)/.config/latexmk
ln -fs $(dotfiles)/$@ $(workspace)/.config/latexmk/$(@F)

$(binfiles): $(workspace)/.local/%: %
mkdir -p $(dir $@)
ln -fs $(dotfiles)/$^ $@
ctags/% \
git/% \
r/% \
shells/% \
vim/% \
:
ln -fs $(dotfiles)/$@ $(workspace)/.$(@F)

alacritty/% \
kitty/% \
nnn/% \
nvim/% \
rofi/% \
zathura/% \
:
mkdir -p $(workspace)/.config/$(@D)
ln -fs $(dotfiles)/$@ $(workspace)/.config/$@

# SINGLE FILE CONFIGS
alacritty:
mkdir -p $(workspace)/.config/alacritty/
ln -fs $(dotfiles)/singles/alacritty.yml $(workspace)/.config/alacritty/alacritty.yml
# CONFIGS
inputrc: shells/inputrc

ctags:
ln -fs $(dotfiles)/singles/ctags $(workspace)/.ctags
bash: inputrc $(wildcard shells/bash*)

git:
ln -fs $(dotfiles)/singles/gitconfig $(workspace)/.gitconfig
zsh: inputrc $(wildcard shells/zsh*)

julia:
mkdir -p $(workspace)/.julia/config/
ln -fs $(dotfiles)/singles/startup.jl $(workspace)/.julia/config
tmux: inputrc $(wildcard shells/tmux*)

jupyter:
jupyter: $(wildcard jupyter/*)
mkdir -p $(workspace)/.local/share/jupyter/kernels
ln -fs $(dotfiles)/singles/jupyter_console_config.py $(workspace)/.jupyter/jupyter_console_config.py

r:
ln -fs $(dotfiles)/singles/Rprofile $(workspace)/.Rprofile

texlive:
mkdir -p $(workspace)/.config/latexmk
ln -fs $(dotfiles)/singles/latexmkrc $(workspace)/.config/latexmk/latexmkrc

vim:
ln -fs $(dotfiles)/singles/vimrc $(workspace)/.vimrc

zathura:
mkdir -p $(workspace)/.config/zathura
ln -fs $(dotfiles)/singles/zathurarc $(workspace)/.config/zathura/zathurarc

gtk:
mkdir -p $(workspace)/.config/gtk-3.0
mkdir -p $(workspace)/.config/gtk-4.0
ln -fs $(dotfiles)/singles/gtk.css $(workspace)/.config/gtk-3.0/gtk.css
ln -fs $(dotfiles)/singles/gtk.css $(workspace)/.config/gtk-4.0/gtk.css
.SECONDEXPANSION:
alacritty \
bin \
ctags \
emacs \
git \
gtk \
julia \
kitty \
nix \
nnn \
nvim \
r \
rofi \
texlive \
vim \
zathura \
: %: $$(shell find % -type f)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 0 additions & 12 deletions patches/conda_activate.patch

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b1746eb

Please sign in to comment.