# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 81673 2011-08-04 03:42:36Z snc@macports.org $

PortSystem          1.0

name                lpc21isp
version             1.83
categories          cross devel
license             LGPL
maintainers         snc openmaintainer
description         a NXP MCU programmer
long_description    In-circuit programming (ISP) tool for the NXP (Philips) \
                    LPC2000 series ARM7 microcontrollers
homepage            http://sourceforge.net/projects/lpc21isp/
platforms           darwin
master_sites        sourceforge
distname            ${name}_[string replace ${version} 1 1 ]

checksums           rmd160  24e5216f4b4dd8a5f8754a4377ee2d6a1855a217 \
                    sha256  665a38d72f3fbf0b6b3a4103090957181fa5d013d2ba40a2ef5de5b71542c121

extract.mkdir       yes
worksrcdir          ${name}

patch {
                    reinplace s|gcc|${configure.cc}| ${worksrcpath}/Makefile
}

use_configure       no

pre-build {
                    system "make -C ${worksrcpath} clean"
}
build.post_args     CFLAGS="-mmacosx-version-min=10.5"

destroot {
                    xinstall -m 755 ${worksrcpath}/lpc21isp \
                    ${destroot}${prefix}/bin
}
