Skip to content

Instantly share code, notes, and snippets.

@attie
attie / Makefile
Created December 9, 2019 00:08
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
#!/bin/bash -eu
if [ $# -gt 0 ]; then
BASE_DIR="$(readlink -e "${1}")"; shift
else
BASE_DIR="$(readlink -e .)";
fi
if [ $# -gt 0 ]; then
(