confOS/Makefile

96 lines
2.4 KiB
Makefile
Raw Normal View History

2023-03-19 19:17:26 +01:00
# Version control
2023-03-19 19:45:57 +01:00
VC = git
# Downloaders
WGET = wget -q --show-progress
CURL = curl -s
2023-03-19 19:17:26 +01:00
2023-03-19 19:05:07 +01:00
# Hide some verbose messages from Make
MAKEFLAGS += --no-print-directory
2023-03-19 19:18:19 +01:00
all: full-sync
2023-03-19 19:05:07 +01:00
2023-03-19 19:19:14 +01:00
# Pull latest changes
2023-03-19 19:17:26 +01:00
refresh:
2023-03-19 19:45:57 +01:00
@echo Pull latest changes from repository...
2023-03-19 19:17:26 +01:00
@$(VC) pull
2023-03-19 19:45:57 +01:00
@echo
2023-03-19 19:17:26 +01:00
2023-03-19 19:19:14 +01:00
# Pull and sync
2023-03-19 19:18:19 +01:00
full-sync:
@$(MAKE) refresh
@$(MAKE) sync
2023-03-19 19:05:07 +01:00
# === All platforms ==
2023-03-19 19:19:14 +01:00
# .config
2023-03-19 19:05:07 +01:00
sync-dotconfig:
2023-03-19 19:45:57 +01:00
# Fish
2023-03-19 19:05:07 +01:00
@mkdir -p $(HOME)/.config/fish/conf.d
@mkdir -p $(HOME)/.config/fish/functions
2023-03-19 19:45:57 +01:00
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/functions/fish_prompt.fish -O $(HOME)/.config/fish/functions/fish_prompt.fish
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/conf.d/promp_color.fish -O $(HOME)/.config/fish/conf.d/promp_color.fish
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/conf.d/abbr.fish -O $(HOME)/.config/fish/conf.d/abbr.fish
# Micro
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/micro/settings.json -O $(HOME)/.config/micro/settings.json
# END
2023-03-19 19:05:07 +01:00
@echo .config directory synced!
2023-03-19 19:45:57 +01:00
@echo
2023-03-19 19:05:07 +01:00
2023-03-19 19:19:14 +01:00
# .emacs.d
2023-03-19 19:05:07 +01:00
sync-emacs:
2023-03-19 19:45:57 +01:00
@mkdir -p $(HOME)/.emacs.d
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.emacs.d/init.el -O $(HOME)/.emacs.d/init.el
# END
2023-03-19 19:05:07 +01:00
@echo Emacs config synced!
2023-03-19 19:45:57 +01:00
@echo
2023-03-19 19:05:07 +01:00
2023-03-19 19:19:14 +01:00
# .mozilla
2023-03-19 19:05:07 +01:00
sync-mozilla:
2023-03-19 19:45:57 +01:00
# END
2023-03-19 19:05:07 +01:00
@echo Firefox config synced!
2023-03-19 19:45:57 +01:00
@echo
# .dotfiles
sync-dotfiles:
# .gitconfig
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/dotfiles/.gitconfig -O $(HOME)/.gitconfig
2023-03-19 19:05:07 +01:00
2023-03-19 19:45:57 +01:00
# .ocamlformat
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/dotfiles/.ocamlformat -O $(HOME)/.ocamlformat
2023-03-19 19:05:07 +01:00
2023-03-19 19:45:57 +01:00
# .clang-format
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/dotfiles/.clang-format -O $(HOME)/.clang-format
# End
@echo dotfiles synced!
@echo
2023-03-19 19:05:07 +01:00
# === Specific platforms ==
sync:
@$(MAKE) sync-dotconfig
2023-03-19 19:45:57 +01:00
@$(MAKE) sync-dotfiles
2023-03-19 19:05:07 +01:00
@$(MAKE) sync-emacs
2023-03-19 19:45:57 +01:00
ifeq ($(shell grep -c "archlinux" /proc/version), 1)
# Arch
2023-03-19 19:05:07 +01:00
@$(MAKE) sync-mozilla
2023-03-19 19:15:20 +01:00
else ifeq ($(shell grep -c "WSL" /proc/version), 1)
2023-03-19 19:05:07 +01:00
# WSL
2023-03-19 19:45:57 +01:00
@mkdir -p $(HOME)/.unison
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.unison/default.prf -O $(HOME)/.unison/default.prf
2023-03-19 19:05:07 +01:00
2023-03-19 19:45:57 +01:00
# Specific
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/config_wsl.fish -O $(HOME)/.config/fish/config.fish_prompt
@$(CURL) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/conf.d/abbr_wsl.fish >> $(HOME)/.config/fish/conf.d/abbr.fish
2023-03-19 19:05:07 +01:00
endif
2023-03-19 19:45:57 +01:00
# END
@echo 🎉 Sync complete!