X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=Makefile;h=d54f46b4a13c55708c6285b1804f1172c380a576;hb=de42da55b82227c91808d64848c759cb8277133a;hp=02522ba5f37d149633b43e4854925913336dae51;hpb=cca3111ee83093100193ccfacfc102f6c407066f;p=khome.git diff --git a/Makefile b/Makefile index 02522ba..d54f46b 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,22 @@ 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 \ $(DEPS) \ deps \ home \ + diff \ + pull \ mpdconf \ pkgs_brew_cask_install \ pkgs_brew_install \ @@ -127,8 +137,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/%' clean: rm -rf ./debfiles