1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
#
# $Id$
#
#
examplesdir = $(docdir)/examples/verilog
AVR_PROGS = toggle.elf \
loop.elf \
left-unit.elf \
right-unit.elf \
spi.elf \
spi-waveforms.elf \
vst.elf
AVRS = ../../src/verilog/
if USE_AVR_CROSS
if USE_VERILOG_TOOLS
EXAMPLE_TARGETS=$(AVR_PROGS) baretest.run loop.run spc.run spi.run vst.run
endif
endif
EXTRA_DIST = README baretest.sav baretest.v right-unit.s singlepincomm.h \
singlepincomm.s spc.sav spc.v csinglepincomm.c csinglepincomm.h left-unit.c \
loop.c loop.sav loop.v toggle.c spi.c spi.sav spi.v spi-waveforms.c \
spi-waveforms.sav spi-waveforms.v \
vst.sav vst.cpp vst.v
SUFFIXES = .c .s .o .v .vvp .vcd
examples_DATA = $(EXTRA_DIST) $(AVR_PROGS) Makefile
example: $(EXAMPLE_TARGETS)
.c.o:
$(AVR_GCC) -mmcu=attiny2313 -c -Os $^ -o $@
spi.o: spi.c
$(AVR_GCC) -mmcu=atmega8 -c -Os $^ -o $@
spi.elf: spi.o
$(AVR_GCC) -mmcu=atmega8 $^ -o $@
spi-waveforms.o: spi-waveforms.c
$(AVR_GCC) -mmcu=atmega8 -c -Os $^ -o $@
spi-waveforms.elf: spi-waveforms.o
$(AVR_GCC) -mmcu=atmega8 $^ -o $@
vst.elf: vst.cpp
$(AVR_GXX) -mmcu=atmega32 -Os $^ -o $@
.s.o:
$(AVR_GCC) -c -Wa,-gstabs -x assembler-with-cpp -o $@ $<
left-unit.elf: left-unit.o csinglepincomm.o
right-unit.elf: right-unit.o singlepincomm.o
$(AVR_LD) -e _start $^ -o $@
.o.elf:
$(AVR_GCC) -mmcu=attiny2313 $^ -o $@
.v.vvp:
$(IVERILOG) $^ -s test -v -I. $(AVRS)/avr.v $(AVRS)/avr_ATtiny25.v $(AVRS)/avr_ATtiny2313.v $(AVRS)/avr_ATmega8.v $(AVRS)/avr_ATmega32.v -o $@
.vvp.run: $(AVR_PROGS)
$(VVP) -M../../src -mavr $^
# this is suspicious, because dependency to .sav isn't given! Was before:
#%.view: %.vcd %.sav
.vcd.view:
if USE_GTKWAVE
$(GTKWAVE) -a $*.sav $*.vcd &
else
@echo "gtkwave isn't found. Can't do that!"
endif
clean-local:
rm -f *.vvp *~ *.o $(AVR_PROGS) *.vcd avr.vpi *.trace
#
# trace VPI with:
# $ export VPI_TRACE=log.txt
#
|