pkgsrc/emulators/simulavr/Makefile
mef eab4165c8b (pkgsrc)
Raw simulavr-1.0.0 does not build. Some patches, and SUBST to
  convert MACROS etc., are added reflecting git repository
  (These will be unnecessary at next release, hopefully).

(Upstream)
Bump the version
  simulavr-0.1.2.1 to
  simulavr-1.0.0

(From manual-1.0.pdf)
What features are new:

  - Run multiple AVR devices in one simulation. (only with interpreter
    interfaces or special application linked against simulavr library)
    Multiple cores can run where each has a different clock frequency.

  - Connect multiple AVR core pins to other devices like LCD, LED and
    others. (environment)

  - Connect multiple AVR cores to multiple avr-gdb instances. (each on
    its own socket/port number, but see first point for running multiple
    avr cores)

  - Write simulation scripts in Tcl/Tk or Python, other languages could
    be added by simply adding swig scripts!

  - Tracing the execution of the program, these traces support all
    debugging information directly from the ELF-file.

  - The traces run step by step for each device so you see all actions
    in the multiple devices in time-correct order.

  - Every interrupt call is visible.

  - Interrupt statistics with latency, longest and shortest execution
    time and some more.

  - There is a simple text based UI interface to add LCD, switches, LEDs
    or other components and can modify it during simulation, so there is
    no longer a need to enter a pin value during execution. (Tcl/Tk
    based)

  - Execution timing should be nearly accurate, different access times
    for internal RAM / external RAM / EEPROM and other hardware
    components are simulated.

  - A pseudo core hardware component is introduced to do "printf"
    debugging. This "device" is connected to a normal named UNIX socket
    so you do not have to waste a UART or other hardware in your test
    environment. (How?)

  - ELF-file loading is supported, no objcopy needed anymore.

  - Execution speed is tuned a lot, most hardware simulations are now
    only done if needed.

  - External IO pins which are not ports are also available. (E.g. ADC7
    and ADC8 on ATmega8 in TQFP package.)

  - External I/O and some internal states of hardware units (link
    prescaler counter and interrupt states) can be dumped ot into a VCD
    trace to analyse I/O behaviour and timing. Or you can use it for
    tests.
2013-09-12 06:20:35 +00:00

91 lines
3.3 KiB
Makefile

# $NetBSD: Makefile,v 1.19 2013/09/12 06:20:35 mef Exp $
#
DISTNAME= simulavr-1.0.0
CATEGORIES= emulators
MASTER_SITES= http://download.savannah.gnu.org/releases/simulavr/
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.nongnu.org/simulavr/
COMMENT= Simulator for Atmel AVR microcontrollers
LICENSE= gnu-gpl-v2
BUILD_DEPENDS+= doxygen-[0-9]*:../../devel/doxygen
BUILD_DEPENDS+= avr-libc-[0-9]*:../../cross/avr-libc
CONFIGURE_ARGS+= --disable-tests
CONFIGURE_ARGS+= --enable-python=python${PYVERSSUFFIX}
CONFIGURE_ARGS+= --with-bfd=${PREFIX}/avr
# Following line does not work yet (examples/python directory)
#CONFIGURE_ENV+= az_python_use=true
#MAKE_ENV+= az_python_use=true
USE_TOOLS+= makeinfo gmake
USE_LIBTOOL= yes
USE_LANGUAGES+= c c++
USE_PKGLOCALEDIR= yes
GNU_CONFIGURE= yes
INFO_FILES= yes
# Interim fix
SUBST_CLASSES+= prefix
SUBST_STAGE.prefix= post-patch
SUBST_MESSAGE.prefix= Fix include path finding Python.h
SUBST_FILES.prefix= src/Makefile.in
SUBST_VARS.prefix= PREFIX
# Following SUBST_CLASSES are from diff against git version (as of 2013-08-08)
# See also
# http://savannah.nongnu.org/bugs/?35737
SUBST_CLASSES+= compare2
SUBST_STAGE.compare2= post-patch
SUBST_MESSAGE.compare2= Convert poisoned SIG_OUTPUT_COMPARE2 to TIMER2_COMP_vect
SUBST_FILES.compare2= examples/atmega128_timer/main.c
SUBST_FILES.compare2+= examples/python/example.c
SUBST_FILES.compare2+= examples/python/example_io.c
SUBST_FILES.compare2+= examples/python/ex_pinout.c
SUBST_FILES.compare2+= regress/timertest/timer_8bit_ctc.c
SUBST_SED.compare2= -e 's/SIG_OUTPUT_COMPARE2/TIMER2_COMP_vect/g'
# StdDefs.h:66:33: error: attempt to use poisoned "SIG_UART0_RECV"
# StdDefs.h:67:39: error: attempt to use poisoned "SIG_UART0_DATA"
# kb.c:39:8: error: attempt to use poisoned "SIG_INTERRUPT0"
SUBST_CLASSES+= uart0
SUBST_STAGE.uart0= post-patch
SUBST_MESSAGE.uart0= Convert poisoned SIG_UART0_RECV to USART0_RX_vect
SUBST_FILES.uart0= examples/atmel_key/StdDefs.h
SUBST_SED.uart0= -e 's/SIG_UART0_RECV/USART0_RX_vect/g'
SUBST_SED.uart0+= -e 's/SIG_UART0_DATA/USART0_UDRE_vect/g'
SUBST_CLASSES+= intrpt0
SUBST_STAGE.intrpt0= post-patch
SUBST_MESSAGE.intrpt0= Convert poisoned SIG_INTERRUPT0 to INT0_vect
SUBST_FILES.intrpt0= examples/atmel_key/kb.c
SUBST_FILES.intrpt0+= examples/python/multicore.c
SUBST_FILES.intrpt0+= regress/extinttest/ext_int0.c
SUBST_SED.intrpt0= -e 's/SIG_INTERRUPT0/INT0_vect/g'
# Following case, see patches
# regress/timertest/timer_16bit.c:ISR(SIG_OUTPUT_COMPARE3B) {
SUBST_CLASSES+= makeinfo
SUBST_STAGE.makeinfo= post-configure
SUBST_MESSAGE.makeinfo= set MAKEINFO path (to avoid work-directory references included)
SUBST_FILES.makeinfo= examples/anacomp/Makefile.in
SUBST_FILES.makeinfo+= examples/python/Makefile.in
SUBST_SED.makeinfo= -e 's,@MAKEINFO@,${PREFIX}/bin/makeinfo,g'
# gcc 2.95 gives warnings that it cannot inline all functions.
BUILDLINK_TRANSFORM+= rm:-Werror
.include "../../cross/avr-binutils/buildlink3.mk"
.include "../../cross/avr-gcc/buildlink3.mk"
#.include "../../cross/avr-libc/buildlink3.mk"
.include "../../devel/swig/buildlink3.mk"
.include "../../mk/curses.buildlink3.mk"
.include "../../lang/python/pyversion.mk"
.include "../../lang/${PYPACKAGE}/buildlink3.mk"
.include "../../lang/tcl-itcl/buildlink3.mk"
.include "../../lang/tcl/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"