Skip to content

Instantly share code, notes, and snippets.

@attie
Created December 9, 2019 00:08
Show Gist options
  • Save attie/6bd965913c2f1494d0ce6d95b0206e21 to your computer and use it in GitHub Desktop.
Save attie/6bd965913c2f1494d0ce6d95b0206e21 to your computer and use it in GitHub Desktop.
Make release, for microcontroller projects
VERSION_SHORT:=$(shell git describe --dirty=+ 2>/dev/null || echo "unknown")
release: main.hex
tar -caf $(PROJECT_NAME)_binary_$(VERSION_SHORT).tgz --xform 's!^!$(PROJECT_NAME)_$(VERSION_SHORT)/!' main.elf main.hex main.map
git archive HEAD --format tar.gz --prefix $(PROJECT_NAME)_$(VERSION_SHORT)/ > $(PROJECT_NAME)_$(VERSION_SHORT).tgz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment