SHELL := /bin/bash date := $(shell date -R) prevtag := $(shell git describe --tags|cut -d- -f1) release: #dangerous: this will execute backticks-enclosed commands found in the commit logs # sed -i "1s#^#$(VERSION) ($(date))\n$(shell git log HEAD...$(prevtag) '--pretty=format:\\t* %s\\n'|tr -d '\n')\n#1" Changelog #no problem with this version: the return from the shell command is not evaluated again sed -i "1s#^#$(VERSION) ($(date))\n`git log HEAD...$(prevtag) '--pretty=format:\\t* %s\\n'|tr -d '\n'`\n#1" Changelog