CXX = g++-4.7
CXXFLAGS = -std=c++11
LDLIBS = -lchdl

dump.vcd : vgacont-vl
	./vgacont-vl

vgacont-vl : vgacont.v textgen.v testbench.v
	iverilog -o vgacont-vl testbench.v vgacont.v textgen.v

vgacont.v : vgacont font.hex
	./vgacont

textgen.v : textgen text.hex
	./textgen

font.hex : FONT font2hex
	./font2hex FONT font.hex

text.hex : TEXT
	hexdump -v -e '1/1 "%02x" "\n"' $< > $@

font2hex : font2hex.cpp
vgacont : vgacont.cpp
textgen : textgen.cpp

clean :
	rm -f vgacont-vl vgacont vgacont.nand vgacont.vcd font.hex font2hex \
              dump.vcd text.hex vgacont.v textgen.v textgen
