#!/bin/bash set -eux build=${EMACS_BUILD:-.} # Retrieve installation directory. Many ways to do this; parsing # 'config.status --config' might be TRT in principle; for simplicity, # just: prefix=$(sed -n s/'^prefix *= *'//p "${build}"/Makefile) cd "${build}" make install [[ ${prefix} =~ ~/apps/(.*) ]] || exit target=${BASH_REMATCH[1]} cd ~/apps ln -fsvT "${target}" emacs