# Makefile for blink example
#
# 2011, Martin Strubel <hackfin@section5.ch>
#
#

DUTIES = blinky blinky2

work-obj93.cf: blink.vhdl blink2.vhdl
	# Import our above example into the current 'work' cache 
	ghdl -i blink.vhdl
	ghdl -i blink2.vhdl

blinky: work-obj93.cf
	# Analyze, elaborate and build an exe from the top level entity 'blink' 
	ghdl -m blinky

blinky2: work-obj93.cf
	ghdl -m blinky2

test.ghw: blinky
	./blinky --wave=test.ghw # Run the simulation and output a wave file

test2.ghw: blinky2
	./blinky2 --wave=test2.ghw

all: $(DUTIES) test.ghw test2.ghw

.PHONY: clean all

clean:
	rm -f work-obj93.cf
	rm -f *.o $(DUTIES)
	rm -f *.ghw
