# Default target runs defaults.sh and then brew bundle all: brew-bundle # Target to run brew bundle brew-bundle: brew bundle personal: brew bundle --file Brewfile-personal # Target to run ./defaults.sh defaults: ./defaults.sh # Generate mackup config file and backup existing ones mackup: # Check if ~/.mackup.cfg exists and back it up if it does if [ -f ~/.mackup.cfg ]; then \ mv ~/.mackup.cfg ~/.mackup.cfg.backup.$$(date +%Y-%m-%d); \ fi # Ensure the ~/.mackup directory exists mkdir -p ~/.mackup # Copy the main mackup config file cp mackup/.mackup.cfg ~/.mackup.cfg # Loop through all .cfg files in the mackup directory for file in mackup/*.cfg; do \ if [ -f "$$file" ]; then \ filename=$$(basename $$file); \ cp $$file ~/.mackup/; \ fi; \ done .PHONY: all brew-bundle defaults mackup