dotfiles/brew/makefile

33 lines
918 B
Makefile
Raw Permalink Normal View History

2024-07-12 04:51:15 +00:00
# -*- mode: makefile-gmake; -*-
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SOURCE := $(SRC_DIR)/Brewfile
TARGET := ~/.Brewfile
include ../lib/shared.mk
init:
if [[ $$OSTYPE != darwin* ]] ; then
$(report) debug "This doesn't seem to be a macOS env. Skipping."
return
fi
if (( ! $$+commands[brew] )) ; then
$(report) header "installing brew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" \
; $(report) "Brew installed."
xcode-select --install \
; $(report) "Xcode CLI tools installed."
fi
up: init
if [[ $$OSTYPE != darwin* ]] ; then
$(report) debug "This doesn't seem to be a macOS env. Skipping."
return
fi
$(report) header "Updating BrewFile"
$(mk_link) $(SOURCE) $(TARGET)
brew bundle install --global --cleanup ; $(report) "Brew Updated"
down:
$(report) header "Removing BrewFile"
$(rm_link) $(TARGET)