confOS/Makefile

59 lines
871 B
Makefile
Raw Normal View History

2023-03-19 19:17:26 +01:00
# Version control
VC = git
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:
@$(VC) pull
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:
@mkdir -p $(HOME)/.config/fish/conf.d
@mkdir -p $(HOME)/.config/fish/functions
@echo .config directory synced!
2023-03-19 19:19:14 +01:00
# .emacs.d
2023-03-19 19:05:07 +01:00
sync-emacs:
@echo Emacs config synced!
2023-03-19 19:19:14 +01:00
# .mozilla
2023-03-19 19:05:07 +01:00
sync-mozilla:
@echo Firefox config synced!
2023-03-19 19:19:14 +01:00
# .unison
2023-03-19 19:05:07 +01:00
sync-unison:
@echo Unison preferences synced!
# === Specific platforms ==
sync:
2023-03-19 19:15:20 +01:00
ifeq ($(shell grep -c "archlinux" /proc/version), 1)
2023-03-19 19:05:07 +01:00
# Arch
@$(MAKE) sync-dotconfig
2023-03-19 19:19:54 +01:00
@echo coucou
2023-03-19 19:05:07 +01:00
@$(MAKE) sync-emacs
@$(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
@$(MAKE) sync-dotconfig
@$(MAKE) sync-emacs
@$(MAKE) sync-unison
endif