[Fwd: Re: OpenOCD]

Steve Franks stevefranks at ieee.org
Tue Nov 4 14:34:41 PST 2008


Bruce,

I've been playing with your makefile for openocd.  Awhile back I was
told that the *right* way to do this as a real port was to get the
svn, make a tgz in distfiles, and then build the port from that.
Looks like you did the svn->distfiles part manually in your origonal
makefile, right?

I was given an example of this, but it has some major problems.

(1) I'd think everything should go from scratch (after a make clean &&
make distclean) with just a 'make' for general-purpose use.
Unfortunaetly, the makefile I'm starting from requires a 'make
gen-dist' call before make will work.  I'm a completely incompetent
script programmer and can't get that to go automatically.  Really, the
script in gen-dist should just be part of the dependancies for plain
'make', right?  If the distfile doesn't exist, get it from svn...

(2) The gen-dist script is supposed to do a make makesum on the bz2
file in distfiles, but for reasons beyond me, it doesn't, probably the
filename is mangled incorrectly with the date?

(3) If I manually do a gen-dist, and then make makesum, I still get:

    ===>  Configuring for openocd-20081103
    cd: can't cd to /usr/ports/devel/openocd2/work/openocd-20081103

Which is probably a naming problem too, right?  Is there a -debug
option for ports so I can see what it's trying to do?

Well that little bitty list is all my problems making a 'real' port...

I'm not sure about mailing attatchments to freebsd lists, so the
makefile is just cat'ed to my email after my name, below...

Steve

# New ports collection makefile for:   openocd
# Date created:
# Whom:			franks at rudbek.com
#
# $FreeBSD: ports/devel/openocd/Makefile,v $
#

PORTNAME=	openocd
DISTVERSION= ${SNAPDATE}
PORTVERSION= ${SNAPDATE}
CATEGORIES=	devel
MASTER_SITES=	${MASTER_SITE_LOCAL}
#~ PKGNAMESUFFIX=	-devel

MAINTAINER=	franks at rudbek.com
COMMENT= Open OCD On-chip debugger, flash programmer, and debug tool

FETCH_DEPENDS+=	svn:${PORTSDIR}/devel/subversion
BUILD_DEPENDS+=	${PORTSDIR}/devel/libusb ${PORTSDIR}/devel/libftdi

USE_BZIP2=	yes

SVN_SNAPDATE!=	date -v-1d +%Y-%m-%d
SNAPDATE=	${SVN_SNAPDATE:S/-//g}

USE_GMAKE=	yes
GNU_CONFIGURE=	yes

INFO=		${PORTNAME}

CONFIGURE_ENV+=		CPPFLAGS=-I${LOCALBASE}/include \
			LDFLAGS=-L${LOCALBASE}/lib

CONFIGURE_ARGS+=	--enable-ft2232_libftdi
LIB_DEPENDS+=		usb:${PORTSDIR}/devel/libusb \
			ftdi.10:${PORTSDIR}/devel/libftdi

#~ WRKSRC=		${WRKDIR}/${PORTNAME}

SVNROOT=	svn://svn.berlios.de/openocd/trunk


gen-dist:
	@if [ ! -d ${WRKDIR} ]; then \
		mkdir ${WRKDIR}; \
	fi
	@if [ ! -d ${WRKDIR}/svn ]; then \
		mkdir ${WRKDIR}/svn; \
	fi
	@if [ ! -f ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} ]; then \
		svn co ${SVNROOT} ${WRKDIR}/svn/openocd; \
		${TAR} cfj ${_DISTDIR}${DISTFILES} ${WRKDIR}/svn/openocd; \
		${MAKE} ${__softMAKEFLAGS} makesum; \
	fi

.include <bsd.port.mk>


On Sat, Oct 11, 2008 at 5:46 AM, Bruce M. Simpson <bms at incunabulum.net> wrote:
> Forwarding here as others might also have dongles that work, and debugging
> NSLU2 ARM would cleary need OCD capability to figure out exactly what is
> going wrong here.
>
> thanks
> BMS
>
>
> ---------- Forwarded message ----------
> From: Bruce M Simpson <bms at incunabulum.net>
> To: stevefranks at ieee.org
> Date: Sat, 11 Oct 2008 05:44:23 +0100
> Subject: Re: OpenOCD
> Steve,
>
> Here's a port for OpenOCD.
>
> I haven't been able to test it for real, because I don't have a supported
> JTAG dongle;
> it seems my Altera USBByteBlaster clone is not supported.
>
> You said you had an Olimex, perhaps you can give it a try? Let me know and
> I'll commit, if you want to take the reins as maintainer let me now.
>
> Here are some notes I was gonna put into the commit message (not committing
> it as I really want to see it work "for real" first) :-
>
> %%%
> Add new port of OpenOCD, an open source on-chip debug utility for
> ARM and other processor families.
>
> Note: I haven't actually tested this with a real dongle yet,
> but it looks sane. It builds from a locally hosted source snapshot,
> as OpenOCD doesn't appear to have a release schedule of its own.
> The diff to svn trunk is extremely minimal.
> 'gmake dist-gzip' doesn't work right, so a manual tarball was rolled.
> It appears that the Altera USB ByteBlaster clone I have is not supported.
>
>
> %%%
>
> cheers
> BMS
>
> _______________________________________________
> freebsd-embedded at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-embedded
> To unsubscribe, send any mail to "freebsd-embedded-unsubscribe at freebsd.org"
>
>


More information about the freebsd-ports mailing list