11SHELL := /bin/bash
2+ MAKE_DIR: =$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST ) ) ) )
23OS := $(shell uname -s)
34
45# #@ dotfiles
56
67.PHONY : bootstrap
78bootstrap : # # Initialize the project by running the bootstrap script.
8- $(SHELL ) . /bootstrap/bootstrap.sh
9+ $(SHELL ) $( MAKE_DIR ) /bootstrap/bootstrap.sh
910
1011.PHONY : deps
1112deps : # # Install dependencies for the project based on the OS.
1213ifeq ($(OS ) ,Linux)
13- $(SHELL) ./bin/aptfile ./linux/Aptfile
14+ @echo "Installing packages from Aptfile 📦"
15+ $(SHELL) $(MAKE_DIR)/bin/aptfile $(MAKE_DIR)/linux/Aptfile
1416else ifeq ($(OS),Darwin)
15- brew bundle --file=./macos/Brewfile
17+ . ~/.shell_functions
18+ @echo "Installing packages from Brewfile 📦"
19+ brew bundle --file=$(MAKE_DIR)/macos/Brewfile
1620else
17- $(error Unsupported operating system - $(OS))
21+ @echo "Unsupported OS: $(OS)"
22+ exit 1
1823endif
24+ @echo "Dependencies installed successfully 🎉"
1925
2026.PHONY : sync
2127sync : # # Update the project and its submodules.
28+ @echo " Updating dotfiles and its submodules 🔄"
2229 git pull --recurse-submodules --jobs=4
23-
24- # #@ development
25-
26- .PHONY : fmt
27- fmt : # # Run pre-commit hooks on all files.
28- pre-commit run --all-files
29-
30- .PHONY : docs
31- docs : # # Serve the documentation locally.
32- hatch run docs:serve --livereload
30+ @echo " Dotfiles synced successfully 🎉"
3331
3432# #@ general
3533
@@ -39,6 +37,20 @@ version: ## Show the version of the project.
3937 @git fetch --tags 2> /dev/null || true
4038 @echo " dotfiles $$ (git describe --tags --abbrev=0)"
4139
40+ # #################################################
41+ # dotfiles development - do not autodocument these
42+ # #################################################
43+
44+ # Lint with pre-commit
45+ .PHONY : fmt
46+ fmt :
47+ pre-commit run --all-files
48+
49+ # Build the documentation
50+ .PHONY : docs
51+ docs :
52+ hatch run docs:serve --livereload
53+
4254.DEFAULT_GOAL := help
4355.PHONY : help
4456help : # # Show this help message and exit.
@@ -47,4 +59,4 @@ help: ## Show this help message and exit.
4759# - "##@" denotes a target category
4860# - "##" denotes a specific target description
4961# ##############################################
50- @awk 'BEGIN {FS = ":.*# #"; printf "\nUsage :\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
62+ @awk 'BEGIN {FS = ":.*# #"; printf "Usage :\n dotfiles \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
0 commit comments