# Author: lego
# Created for hc27 entry.
# This makefile is intended to build and test entry.com in cygwin environment.
# You may need to modify this for your needs to work in different environment.
all: entry.com

entry.com: entry.asm image.chr.asm image.col.asm
	nasm -O9 -f bin -o entry.com entry.asm
	chmod u+x entry.com
	@stat --printf='Size of entry.com: %s bytes.\n' entry.com

clean:
	-rm entry.com

test: entry.com
	cygstart tester2.com

image.chr.bin: split image.bin
	./split image.chr.bin image.col.bin < image.bin

image.col.bin: split image.bin
	./split image.chr.bin image.col.bin < image.bin

image.chr.asm: rle image.chr.bin
	./rle chr 3 image.chr.bin > image.chr.asm

image.col.asm: rle image.col.bin
	./rle col 5 image.col.bin > image.col.asm

# Build the tools
split: split.cpp
	g++ split.cpp -o split

rle: rle.cpp
	g++ rle.cpp -o rle

