X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=Makefile;h=e576ff79dc25e1b362d5b433b0527124727a09f9;hb=dee031b5392c3b1bcf0e5555c7e65e061751415e;hp=00513639ef8c6142852bc4fd808a88687b007384;hpb=168758816fadac7744a012f7b8f530859151f744;p=khome.git diff --git a/Makefile b/Makefile index 0051363..e576ff7 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,14 @@ MAKEFLAGS := --no-builtin-rules DEPS := $(wildcard deps/*) +ifeq ($(shell uname),Darwin) + SED := gsed + DIFF := $(shell gls -t1 /usr/local/Cellar/diffutils/*/bin/diff | head -1) +else + SED := sed + DIFF := diff +endif + .PHONY: \ default \ clean \ @@ -13,6 +21,7 @@ DEPS := $(wildcard deps/*) mpdconf \ pkgs_brew_cask_install \ pkgs_brew_install \ + pkgs_cargo \ pkgs_deb_install \ pkgs_deb_purge \ pkgs_debian \ @@ -76,6 +85,13 @@ pkgs_ubuntu_debfiles: list pkgs-ubuntu-debfiles.list pkgs_pip: sudo pip3 install $(shell ./list pkgs-pip.list) +# +# Rust (cargo) +# + +pkgs_cargo: list pkgs-cargo.list + cargo install $(shell ./list pkgs-cargo.list) + # # Homebrew/Mac # @@ -129,13 +145,13 @@ $(foreach d,$(DEPS),$(eval $(call GEN_DEP_RULE,$(d)))) diff: find home -type f -print0 \ - | sed -z 's/^home\///g' \ - | xargs -0 -I% sh -c 'echo %; diff --color=always ~/% home/%' + | $(SED) -z 's/^home\///g' \ + | xargs -0 -I% sh -c 'echo %; $(DIFF) --color=always ~/% home/%' pull: find home -type f -print0 \ - | sed -z 's/^home\///g' \ - | xargs -0 -I% sh -c 'diff -q ~/% home/% > /dev/null || cp ~/% home/%' + | $(SED) -z 's/^home\///g' \ + | xargs -0 -I% sh -c '$(DIFF) -q ~/% home/% > /dev/null || cp ~/% home/%' clean: rm -rf ./debfiles