SUMMARY="Cross platform flash program for the STM32 bootloader"
DESCRIPTION="Open source flash program for the STM32 ARM processors using \
ST serial bootloader.

* device identification
* write to flash/ram
* read from flash/ram
* auto-detect Intel HEX or raw binary input format with option to force binary
* flash from binary file
* save flash to binary file
* verify & retry up to N times on failed writes
* start execution at specified address
* software reset the device when finished if -g not specified
* resume already initialized connection (for when reset fails)
"
HOMEPAGE="http://code.google.com/p/stm32flash/"
REVISION="1"
ARCHITECTURES=""
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"
COPYRIGHT="
	Geoffrey McRae
	2012-2014 Tormod Volden
	"
LICENSE="GNU GPL v2"

SOURCE_URI="https://releases.stm32flash.googlecode.com/git/stm32flash-0.3.tar.gz"
CHECKSUM_SHA256="8c9da430c6aca2cb711c90a1bd6e38d7169f73f9baf6cbf11234f1f8c444f47f"
SOURCE_DIR="stm32flash"

PROVIDES="
	stm32flash$secondaryArchSuffix = $portVersion
	cmd:stm32flash$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:gcc$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	make $jobArgs
}

INSTALL()
{
	mkdir -p $binDir
	cp stm32flash $binDir
	mkdir -p $manDir/man1
	cp stm32flash.1 $manDir/man1
}
