SUMMARY="Tools to enable multi-platform development on TI Stellaris Launchpads"
DESCRIPTION="Some tools which enable multi-platform development on the TI \
Stellaris Launchpad boards. The Stellaris Launchpad is a low cost development \
board created by Texas Instruments that comes with an ARM Cortex-M4F processor."
HOMEPAGE="https://github.com/utzig/lm4tools"
LICENSE="GNU GPL v2"
REVISION="1"

ARCHITECTURES="x86 x86_64"
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"

SOURCE_URI="git+https://github.com/utzig/lm4tools.git#1cfd813779b9eb717b15b0a1814bde8338899ff9"
COPYRIGHT="
	2012 Fabio Utzig
	2012 Peter Stuge
	"

PROVIDES="
	lm4tools = $portVersion
	cmd:lm4flash$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libusb_1.0$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libusb_1.0$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	cd lm4flash
	make $jobArgs
}

INSTALL()
{
	cd lm4flash
	mkdir -p $binDir
	cp lm4flash $binDir
}
