X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=Makefile;h=563f6f4ac688506a17f6cf378b22e5e6da513eb1;hb=0d2fb06d32113dbc6ddcbeebb6e759453bf47a3c;hp=48a22924fdd47e80f39b712c32b61f0acdc303b5;hpb=ba898a096aa4c8f729ee0e25629a3778d61d1d3b;p=khome.git diff --git a/Makefile b/Makefile index 48a2292..563f6f4 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 \ @@ -9,14 +17,17 @@ DEPS := $(wildcard deps/*) deps \ home \ diff \ + pull \ mpdconf \ pkgs_brew_cask_install \ pkgs_brew_install \ + pkgs_cargo \ pkgs_deb_install \ pkgs_deb_purge \ pkgs_debian \ pkgs_mac \ - pkgs_pip \ + pkgs_pip_install \ + pkgs_pip_upgrade \ pkgs_snap_classic \ pkgs_snap_strict @@ -38,6 +49,7 @@ home: mpdconf compiled @cp home/.Rprofile $(HOME)/ @cp home/.tmux.conf $(HOME)/ @cp home/.xbindkeysrc $(HOME)/ + @cp -Rp home/.Mathematica/ $(HOME)/ mpdconf: @mkdir -p ~/Archives/Audio @@ -72,8 +84,18 @@ pkgs_ubuntu_debfiles: list pkgs-ubuntu-debfiles.list # # PIP # -pkgs_pip: - sudo pip3 install $(shell ./list pkgs-pip.list) +pkgs_pip_install: + pip3 install --user $(shell ./list pkgs-pip.list) + +pkgs_pip_upgrade: + pip3 install --user --upgrade $(shell ./list pkgs-pip.list) + +# +# Rust (cargo) +# + +pkgs_cargo: list pkgs-cargo.list + cargo install $(shell ./list pkgs-cargo.list) # # Homebrew/Mac @@ -128,8 +150,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