Skip to content

Instantly share code, notes, and snippets.

@roundand
Last active December 19, 2017 07:37
Show Gist options
  • Save roundand/90aad70ace7f3db7068ea74412855e1b to your computer and use it in GitHub Desktop.
Save roundand/90aad70ace7f3db7068ea74412855e1b to your computer and use it in GitHub Desktop.
Generating ad-hoc GOPATH and relative working directory from current working directory
xyz = $(shell expr '/home/fn/go/fred' : '\(.*go/\)')
default:
XGP=$$(expr '/home/fn/go/fred' : '\(.*go/\)'); \
echo XGP $$XGP; \
export XWD=$$(expr '/home/fn/go/fred' : '.*/go/\(.*\)'); \
echo XWD $$XWD; \
echo xyz $(xyz)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment