|
1 | 1 | # Makefile |
2 | | - |
3 | | -SHELL := /bin/bash |
4 | | -.DEFAULT_GOAL := dotfiles |
5 | | - |
6 | | -.PHONY: minimal |
7 | | -minimal: init ohmybash end |
| 2 | +.PHONY: all SHELL |
| 3 | +all: backup-dir dotfiles |
| 4 | + |
| 5 | +.DEFAULT_GOAL := help |
| 6 | +.EXPORT_ALL_VARIABLES: |
| 7 | +MAKEFLAGS += "-j$(NUM_CORES) -l$(NUM_CORES)" |
| 8 | +SHELL:= /bin/bash |
| 9 | +.SHELLFLAGS = -eu -o pipefail -c |
| 10 | + |
| 11 | +# Makefile colors config |
| 12 | +bold := $(shell tput bold) |
| 13 | +normal := $(shell tput sgr0) |
| 14 | +errorTitle := $(shell tput setab 1 && tput bold && echo '\n') |
| 15 | +recommendation := $(shell tput setab 4) |
| 16 | +underline := $(shell tput smul) |
| 17 | +reset := $(shell tput -Txterm sgr0) |
| 18 | +black := $(shell tput setaf 0) |
| 19 | +red := $(shell tput setaf 1) |
| 20 | +green := $(shell tput setaf 2) |
| 21 | +yellow := $(shell tput setaf 3) |
| 22 | +blue := $(shell tput setaf 4) |
| 23 | +magenta := $(shell tput setaf 5) |
| 24 | +cyan := $(shell tput setaf 6) |
| 25 | +white := $(shell tput setaf 7) |
| 26 | + |
| 27 | +define HEADER |
| 28 | +How to use me: |
| 29 | + # To install and configure all targets |
| 30 | + ${bold}make all${reset} |
| 31 | + |
| 32 | + # To install and configure one target |
| 33 | + ${bold}make ${cyan}<target>${reset} |
| 34 | + |
| 35 | +endef |
| 36 | +export HEADER |
| 37 | + |
| 38 | +-include $(addsuffix /*.mak, $(shell find .config/make -type d)) |
| 39 | + |
| 40 | +DOTFILES_DIR_PATH := ${PWD}/home |
8 | 41 |
|
9 | 42 | .PHONY: dotfiles |
10 | | -dotfiles: init ohmybash vim git tmux gtk end |
11 | | - |
12 | | -.PHONY: all |
13 | | -all: dotfiles vscode |
14 | | - |
15 | | -.PHONY: init |
16 | | -init: |
17 | | - @mkdir -p ~/.bak |
18 | | - @echo "Created ~/.bak directory" |
19 | | - |
20 | | -OH_MY_BASH_THEMES_DIR := .oh-my-bash/custom/themes |
21 | | -OH_MY_BASH_COMPLETIONS_DIR := .oh-my-bash/custom/completions |
22 | | - |
23 | | -.PHONY: ohmybash |
24 | | -ohmybash: |
25 | | - bash <(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh) |
26 | | - |
27 | | - @cp -r ~/${OH_MY_BASH_THEMES_DIR} ~/.bak/ &> /dev/null | true |
28 | | - @rm -rf ~/${OH_MY_BASH_THEMES_DIR} &> /dev/null | true |
29 | | - ln -s ${PWD}/${OH_MY_BASH_THEMES_DIR} ~/${OH_MY_BASH_THEMES_DIR} |
30 | | - |
31 | | - @cp -r ~/${OH_MY_BASH_COMPLETIONS_DIR} ~/.bak/ &> /dev/null | true |
32 | | - @rm -rf ~/${OH_MY_BASH_COMPLETIONS_DIR} &> /dev/null | true |
33 | | - ln -s ${PWD}/${OH_MY_BASH_COMPLETIONS_DIR} ~/${OH_MY_BASH_COMPLETIONS_DIR} |
34 | | - |
35 | | - @cp ~/.bashrc ~/.bak/ &> /dev/null | true |
36 | | - @rm ~/.bashrc &> /dev/null | true |
37 | | - ln -s ${PWD}/.bashrc ~/.bashrc |
38 | | - |
39 | | -.PHONY: gtk |
40 | | -gtk: |
41 | | - @cp -r ~/.config/gtk-3.0 ~/.bak/ &> /dev/null | true |
42 | | - @rm -rf ~/.config/gtk-3.0 &> /dev/null | true |
43 | | - ln -s ${PWD}/.config/gtk-3.0 ~/.config/gtk-3.0 |
44 | | - |
45 | | - @cp -r ~/.config/gtk-4.0 ~/.bak/ &> /dev/null | true |
46 | | - @rm -rf ~/.config/gtk-4.0 &> /dev/null | true |
47 | | - ln -s ${PWD}/.config/gtk-4.0 ~/.config/gtk-4.0 |
48 | | - |
49 | | - |
50 | | -.PHONY: git |
51 | | -git: |
52 | | - @cp ~/.gitconfig ~/.bak/ &> /dev/null | true |
53 | | - @rm ~/.gitconfig &> /dev/null | true |
54 | | - ln -s ${PWD}/.gitconfig ~/.gitconfig |
55 | | - |
56 | | -.PHONY: tmux |
57 | | -tmux: |
58 | | - @cp ~/.tmux.conf ~/.bak/ &> /dev/null | true |
59 | | - @rm ~/.tmux.conf &> /dev/null | true |
60 | | - ln -s ${PWD}/.tmux.conf ~/.tmux.conf |
61 | | - |
62 | | -.PHONY: vim |
63 | | -vim: |
64 | | - @cp ~/.vimrc ~/.bak/ &> /dev/null | true |
65 | | - @rm ~/.vimrc &> /dev/null | true |
66 | | - ln -s ${PWD}/.vimrc ~/.vimrc |
67 | | - |
68 | | - @mkdir -p ~/.vim |
69 | | - |
70 | | - @cp -r ~/.vim/colors ~/.bak/ &> /dev/null | true |
71 | | - @rm -r ~/.vim/colors &> /dev/null | true |
72 | | - ln -s ${PWD}/.vim/colors ~/.vim/colors |
73 | | - |
74 | | - @cp -r ~/.vim/autoload ~/.bak/ &> /dev/null | true |
75 | | - @rm -r ~/.vim/autoload &> /dev/null | true |
76 | | - ln -s ${PWD}/.vim/autoload ~/.vim/autoload |
77 | | - |
78 | | - ln -sf ${PWD}/.vim/shell_header.temp ~/.vim/shell_header.temp |
79 | | - |
80 | | - @rm -rf ~/.vim/bundle/Vundle.vim | true |
81 | | - git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim |
82 | | - vim +PluginInstall +qall |
83 | | - |
84 | | - curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |
85 | | - vim +PlugInstall +qall |
86 | | - |
| 43 | +dotfiles: oh-my-bash \ |
| 44 | + gnome-gtk git-config \ |
| 45 | + tmux vim \ |
| 46 | + vscode-configs end \ |
87 | 47 |
|
88 | 48 |
|
89 | 49 | .PHONY: end |
90 | 50 | end: |
91 | | - @echo "A copy of the previous dotfiles are available in the '~/.bak' folder." |
| 51 | + @echo "A copy of the previous dotfiles are available in the '~/.dotfiles.backup ' directory." |
0 commit comments