
PNG2RLE = ../../../utils/gr-utils/png2rle
PNG2GR = ../../../utils/gr-utils/png2gr
PNG2HGR = ../../../utils/hgr-utils/png2hgr
LZSA = ~/research/lzsa/lzsa/lzsa
B2D = ../../../utils/bmp2dhr/b2d

all:	graphics_intro.inc \
	graphics_peasant1.inc \
	graphics_peasant2.inc \
	graphics_peasant3.inc \
	graphics_peasant4.inc \
	priority_peasant1.inc \
	priority_intro.inc \
	priority_peasant2.inc \
	priority_peasant3.inc \
	priority_peasant4.inc


###

graphics_intro.inc:	\
	cottage.lzsa \
	lake_e.lzsa \
	lake_w.lzsa \
	river.lzsa \
	knight.lzsa
	echo "cottage_lzsa: .incbin \"cottage.lzsa\"" > graphics_intro.inc
	echo "lake_w_lzsa: .incbin \"lake_w.lzsa\"" >> graphics_intro.inc
	echo "lake_e_lzsa: .incbin \"lake_e.lzsa\"" >> graphics_intro.inc
	echo "river_lzsa: .incbin \"river.lzsa\"" >> graphics_intro.inc
	echo "knight_lzsa: .incbin \"knight.lzsa\"" >> graphics_intro.inc

###

graphics_peasant1.inc:	\
	gary.lzsa \
	top_prints.lzsa \
	wishing_well.lzsa \
	leaning_tree.lzsa \
	waterfall.lzsa
	echo "gary_lzsa: .incbin \"gary.lzsa\"" > graphics_peasant1.inc
	echo "top_prints_lzsa: .incbin \"top_prints.lzsa\"" >> graphics_peasant1.inc
	echo "wishing_well_lzsa: .incbin \"wishing_well.lzsa\"" >> graphics_peasant1.inc
	echo "leaning_tree_lzsa: .incbin \"leaning_tree.lzsa\"" >> graphics_peasant1.inc
	echo "waterfall_lzsa: .incbin \"waterfall.lzsa\"" >> graphics_peasant1.inc

###

graphics_peasant2.inc:	\
	haystack.lzsa \
	puddle.lzsa \
	archery.lzsa \
	river.lzsa \
	knight.lzsa
	echo "haystack_lzsa: .incbin \"haystack.lzsa\"" > graphics_peasant2.inc
	echo "puddle_lzsa: .incbin \"puddle.lzsa\"" >> graphics_peasant2.inc
	echo "archery_lzsa: .incbin \"archery.lzsa\"" >> graphics_peasant2.inc
	echo "river_lzsa: .incbin \"river.lzsa\"" >> graphics_peasant2.inc
	echo "knight_lzsa: .incbin \"knight.lzsa\"" >> graphics_peasant2.inc

###

graphics_peasant3.inc:	\
	jhonka.lzsa \
	cottage.lzsa \
	lake_e.lzsa \
	lake_e_boat.lzsa \
	lake_w.lzsa \
	inn.lzsa
	echo "jhonka_lzsa: .incbin \"jhonka.lzsa\"" > graphics_peasant3.inc
	echo "cottage_lzsa: .incbin \"cottage.lzsa\"" >> graphics_peasant3.inc
	echo "lake_w_lzsa: .incbin \"lake_w.lzsa\"" >> graphics_peasant3.inc
#	echo "lake_e_lzsa: .incbin \"lake_e.lzsa\"" >> graphics_peasant3.inc
	echo "lake_e_lzsa: .incbin \"lake_e_boat.lzsa\"" >> graphics_peasant3.inc
#	echo "lake_e_boat_lzsa: .incbin \"lake_e_boat.lzsa\"" >> graphics_peasant3.inc
	echo "inn_lzsa: .incbin \"inn.lzsa\"" >> graphics_peasant3.inc

###

graphics_peasant4.inc:	\
	empty_hut.lzsa \
	ned.lzsa \
	bottom_prints.lzsa \
	lady_cottage.lzsa \
	crooked_tree.lzsa
	echo "empty_hut_lzsa: .incbin \"empty_hut.lzsa\"" > graphics_peasant4.inc
	echo "ned_lzsa: .incbin \"ned.lzsa\"" >> graphics_peasant4.inc
	echo "bottom_prints_lzsa: .incbin \"bottom_prints.lzsa\"" >> graphics_peasant4.inc
	echo "lady_cottage_lzsa: .incbin \"lady_cottage.lzsa\"" >> graphics_peasant4.inc
	echo "crooked_tree_lzsa: .incbin \"crooked_tree.lzsa\"" >> graphics_peasant4.inc

###########

priority_intro.inc:	\
	cottage_priority.lzsa \
	lake_w_priority.lzsa lake_e_priority.lzsa \
	river_priority.lzsa knight_priority.lzsa
	echo "cottage_priority_lzsa: .incbin \"cottage_priority.lzsa\"" > priority_intro.inc
	echo "lake_w_priority_lzsa: .incbin \"lake_w_priority.lzsa\"" >> priority_intro.inc
	echo "lake_e_priority_lzsa: .incbin \"lake_e_priority.lzsa\"" >> priority_intro.inc
	echo "river_priority_lzsa: .incbin \"river_priority.lzsa\"" >> priority_intro.inc
	echo "knight_priority_lzsa: .incbin \"knight_priority.lzsa\"" >> priority_intro.inc

priority_peasant1.inc:	\
	gary_priority.lzsa top_prints_priority.lzsa \
	wishing_well_priority.lzsa leaning_tree_priority.lzsa \
	waterfall_priority.lzsa
	echo "gary_priority_lzsa: .incbin \"gary_priority.lzsa\"" > priority_peasant1.inc
	echo "top_prints_priority_lzsa: .incbin \"top_prints_priority.lzsa\"" >> priority_peasant1.inc
	echo "wishing_well_priority_lzsa: .incbin \"wishing_well_priority.lzsa\"" >> priority_peasant1.inc
	echo "leaning_tree_priority_lzsa: .incbin \"leaning_tree_priority.lzsa\"" >> priority_peasant1.inc
	echo "waterfall_priority_lzsa: .incbin \"waterfall_priority.lzsa\"" >> priority_peasant1.inc


###

priority_peasant2.inc:	\
	haystack_priority.lzsa puddle_priority.lzsa \
	archery_priority.lzsa \
	river_priority.lzsa knight_priority.lzsa
	echo "haystack_priority_lzsa: .incbin \"haystack_priority.lzsa\"" > priority_peasant2.inc
	echo "puddle_priority_lzsa: .incbin \"puddle_priority.lzsa\"" >> priority_peasant2.inc
	echo "archery_priority_lzsa: .incbin \"archery_priority.lzsa\"" >> priority_peasant2.inc
	echo "river_priority_lzsa: .incbin \"river_priority.lzsa\"" >> priority_peasant2.inc
	echo "knight_priority_lzsa: .incbin \"knight_priority.lzsa\"" >> priority_peasant2.inc

###

priority_peasant3.inc:	\
	jhonka_priority.lzsa \
	cottage_priority.lzsa \
	lake_w_priority.lzsa lake_e_priority.lzsa inn_priority.lzsa
	echo "jhonka_priority_lzsa: .incbin \"jhonka_priority.lzsa\"" > priority_peasant3.inc
	echo "cottage_priority_lzsa: .incbin \"cottage_priority.lzsa\"" >> priority_peasant3.inc
	echo "lake_w_priority_lzsa: .incbin \"lake_w_priority.lzsa\"" >> priority_peasant3.inc
	echo "lake_e_priority_lzsa: .incbin \"lake_e_priority.lzsa\"" >> priority_peasant3.inc
	echo "inn_priority_lzsa: .incbin \"inn_priority.lzsa\"" >> priority_peasant3.inc

###

priority_peasant4.inc:	\
	empty_hut_priority.lzsa \
	ned_priority.lzsa \
	bottom_prints_priority.lzsa \
	lady_cottage_priority.lzsa \
	crooked_tree_priority.lzsa
	echo "empty_hut_priority_lzsa: .incbin \"empty_hut_priority.lzsa\"" > priority_peasant4.inc
	echo "ned_priority_lzsa: .incbin \"ned_priority.lzsa\"" >> priority_peasant4.inc
	echo "bottom_prints_priority_lzsa: .incbin \"bottom_prints_priority.lzsa\"" >> priority_peasant4.inc
	echo "lady_cottage_priority_lzsa: .incbin \"lady_cottage_priority.lzsa\"" >> priority_peasant4.inc
	echo "crooked_tree_priority_lzsa: .incbin \"crooked_tree_priority.lzsa\"" >> priority_peasant4.inc


###

archery.lzsa:	archery.hgr
	$(LZSA) -r -f2 archery.hgr archery.lzsa

archery.hgr:	archery.png
	$(PNG2HGR) archery.png > archery.hgr

###

bottom_prints.lzsa:	bottom_prints.hgr
	$(LZSA) -r -f2 bottom_prints.hgr bottom_prints.lzsa

bottom_prints.hgr:	bottom_prints.png
	$(PNG2HGR) bottom_prints.png > bottom_prints.hgr

###

cottage.lzsa:	cottage.hgr
	$(LZSA) -r -f2 cottage.hgr cottage.lzsa

cottage.hgr:	cottage.png
	$(PNG2HGR) cottage.png > cottage.hgr

###

crooked_tree.lzsa:	crooked_tree.hgr
	$(LZSA) -r -f2 crooked_tree.hgr crooked_tree.lzsa

crooked_tree.hgr:	crooked_tree.png
	$(PNG2HGR) crooked_tree.png > crooked_tree.hgr

###

empty_hut.lzsa:	empty_hut.hgr
	$(LZSA) -r -f2 empty_hut.hgr empty_hut.lzsa

empty_hut.hgr:	empty_hut.png
	$(PNG2HGR) empty_hut.png > empty_hut.hgr


###

gary.lzsa:	gary.hgr
	$(LZSA) -r -f2 gary.hgr gary.lzsa

gary.hgr:	gary.png
	$(PNG2HGR) gary.png > gary.hgr

###

haystack.lzsa:	haystack.hgr
	$(LZSA) -r -f2 haystack.hgr haystack.lzsa

haystack.hgr:	haystack.png
	$(PNG2HGR) haystack.png > haystack.hgr

###

jhonka.lzsa:	jhonka.hgr
	$(LZSA) -r -f2 jhonka.hgr jhonka.lzsa

jhonka.hgr:	jhonka.png
	$(PNG2HGR) jhonka.png > jhonka.hgr

###

knight.lzsa:	knight.hgr
	$(LZSA) -r -f2 knight.hgr knight.lzsa

knight.hgr:	knight.png
	$(PNG2HGR) knight.png > knight.hgr


###

lady_cottage.lzsa:	lady_cottage.hgr
	$(LZSA) -r -f2 lady_cottage.hgr lady_cottage.lzsa

lady_cottage.hgr:	lady_cottage.png
	$(PNG2HGR) lady_cottage.png > lady_cottage.hgr


###

lake_e.lzsa:	lake_e.hgr
	$(LZSA) -r -f2 lake_e.hgr lake_e.lzsa

lake_e.hgr:	lake_e.png
	$(PNG2HGR) lake_e.png > lake_e.hgr


###

lake_e_boat.lzsa:	lake_e_boat.hgr
	$(LZSA) -r -f2 lake_e_boat.hgr lake_e_boat.lzsa

lake_e_boat.hgr:	lake_e_boat.png
	$(PNG2HGR) lake_e_boat.png > lake_e_boat.hgr


###

lake_w.lzsa:	lake_w.hgr
	$(LZSA) -r -f2 lake_w.hgr lake_w.lzsa

lake_w.hgr:	lake_w.png
	$(PNG2HGR) lake_w.png > lake_w.hgr


###

leaning_tree.lzsa:	leaning_tree.hgr
	$(LZSA) -r -f2 leaning_tree.hgr leaning_tree.lzsa

leaning_tree.hgr:	leaning_tree.png
	$(PNG2HGR) leaning_tree.png > leaning_tree.hgr

###

ned.lzsa:	ned.hgr
	$(LZSA) -r -f2 ned.hgr ned.lzsa

ned.hgr:	ned.png
	$(PNG2HGR) ned.png > ned.hgr

###

puddle.lzsa:	puddle.hgr
	$(LZSA) -r -f2 puddle.hgr puddle.lzsa

puddle.hgr:	puddle.png
	$(PNG2HGR) puddle.png > puddle.hgr

###

river.lzsa:	river.hgr
	$(LZSA) -r -f2 river.hgr river.lzsa

river.hgr:	river.png
	$(PNG2HGR) river.png > river.hgr

###

top_prints.lzsa:	top_prints.hgr
	$(LZSA) -r -f2 top_prints.hgr top_prints.lzsa

top_prints.hgr:	top_prints.png
	$(PNG2HGR) top_prints.png > top_prints.hgr


###

waterfall.lzsa:	waterfall.hgr
	$(LZSA) -r -f2 waterfall.hgr waterfall.lzsa

waterfall.hgr:	waterfall.png
	$(PNG2HGR) waterfall.png > waterfall.hgr

###

wishing_well.lzsa:	wishing_well.hgr
	$(LZSA) -r -f2 wishing_well.hgr wishing_well.lzsa

wishing_well.hgr:	wishing_well.png
	$(PNG2HGR) wishing_well.png > wishing_well.hgr

###

inn.lzsa:	inn.hgr
	$(LZSA) -r -f2 inn.hgr inn.lzsa

inn.hgr:	inn.png
	$(PNG2HGR) inn.png > inn.hgr

###

todo.lzsa:	todo.hgr
	$(LZSA) -r -f2 todo.hgr todo.lzsa

todo.hgr:	todo.png
	$(PNG2HGR) todo.png > todo.hgr


###########################################
###########################################

###

archery_priority.lzsa:	archery_priority.hgr
	$(LZSA) -r -f2 archery_priority.hgr archery_priority.lzsa

archery_priority.hgr:	archery_priority.png
	$(PNG2GR) archery_priority.png archery_priority.hgr

###

bottom_prints_priority.lzsa:	bottom_prints_priority.hgr
	$(LZSA) -r -f2 bottom_prints_priority.hgr bottom_prints_priority.lzsa

bottom_prints_priority.hgr:	bottom_prints_priority.png
	$(PNG2GR) bottom_prints_priority.png bottom_prints_priority.hgr

###

cottage_priority.lzsa:	cottage_priority.hgr
	$(LZSA) -r -f2 cottage_priority.hgr cottage_priority.lzsa

cottage_priority.hgr:	cottage_priority.png
	$(PNG2GR) cottage_priority.png cottage_priority.hgr

###

crooked_tree_priority.lzsa:	crooked_tree_priority.hgr
	$(LZSA) -r -f2 crooked_tree_priority.hgr crooked_tree_priority.lzsa

crooked_tree_priority.hgr:	crooked_tree_priority.png
	$(PNG2GR) crooked_tree_priority.png crooked_tree_priority.hgr

###

empty_hut_priority.lzsa:	empty_hut_priority.hgr
	$(LZSA) -r -f2 empty_hut_priority.hgr empty_hut_priority.lzsa

empty_hut_priority.hgr:	empty_hut_priority.png
	$(PNG2GR) empty_hut_priority.png empty_hut_priority.hgr

###

gary_priority.lzsa:	gary_priority.hgr
	$(LZSA) -r -f2 gary_priority.hgr gary_priority.lzsa

gary_priority.hgr:	gary_priority.png
	$(PNG2GR) gary_priority.png gary_priority.hgr

###

haystack_priority.lzsa:	haystack_priority.hgr
	$(LZSA) -r -f2 haystack_priority.hgr haystack_priority.lzsa

haystack_priority.hgr:	haystack_priority.png
	$(PNG2GR) haystack_priority.png haystack_priority.hgr

###

inn_priority.lzsa:	inn_priority.hgr
	$(LZSA) -r -f2 inn_priority.hgr inn_priority.lzsa

inn_priority.hgr:	inn_priority.png
	$(PNG2GR) inn_priority.png inn_priority.hgr

###

jhonka_priority.lzsa:	jhonka_priority.hgr
	$(LZSA) -r -f2 jhonka_priority.hgr jhonka_priority.lzsa

jhonka_priority.hgr:	jhonka_priority.png
	$(PNG2GR) jhonka_priority.png jhonka_priority.hgr

###

lady_cottage_priority.lzsa:	lady_cottage_priority.hgr
	$(LZSA) -r -f2 lady_cottage_priority.hgr lady_cottage_priority.lzsa

lady_cottage_priority.hgr:	lady_cottage_priority.png
	$(PNG2GR) lady_cottage_priority.png lady_cottage_priority.hgr

###

leaning_tree_priority.lzsa:	leaning_tree_priority.hgr
	$(LZSA) -r -f2 leaning_tree_priority.hgr leaning_tree_priority.lzsa

leaning_tree_priority.hgr:	leaning_tree_priority.png
	$(PNG2GR) leaning_tree_priority.png leaning_tree_priority.hgr

###

ned_priority.lzsa:	ned_priority.hgr
	$(LZSA) -r -f2 ned_priority.hgr ned_priority.lzsa

ned_priority.hgr:	ned_priority.png
	$(PNG2GR) ned_priority.png ned_priority.hgr

###

puddle_priority.lzsa:	puddle_priority.hgr
	$(LZSA) -r -f2 puddle_priority.hgr puddle_priority.lzsa

puddle_priority.hgr:	puddle_priority.png
	$(PNG2GR) puddle_priority.png puddle_priority.hgr

###

river_priority.lzsa:	river_priority.hgr
	$(LZSA) -r -f2 river_priority.hgr river_priority.lzsa

river_priority.hgr:	river_priority.png
	$(PNG2GR) river_priority.png river_priority.hgr

###

knight_priority.lzsa:	knight_priority.hgr
	$(LZSA) -r -f2 knight_priority.hgr knight_priority.lzsa

knight_priority.hgr:	knight_priority.png
	$(PNG2GR) knight_priority.png knight_priority.hgr

###

lake_e_priority.lzsa:	lake_e_priority.hgr
	$(LZSA) -r -f2 lake_e_priority.hgr lake_e_priority.lzsa

lake_e_priority.hgr:	lake_e_priority.png
	$(PNG2GR) lake_e_priority.png lake_e_priority.hgr

###

lake_w_priority.lzsa:	lake_w_priority.hgr
	$(LZSA) -r -f2 lake_w_priority.hgr lake_w_priority.lzsa

lake_w_priority.hgr:	lake_w_priority.png
	$(PNG2GR) lake_w_priority.png lake_w_priority.hgr


####

todo_priority.lzsa:	todo_priority.gr
	$(LZSA) -r -f2 todo_priority.gr todo_priority.lzsa

todo_priority.gr:	todo_priority.png
	$(PNG2GR) todo_priority.png todo_priority.gr

###

top_prints_priority.lzsa:	top_prints_priority.hgr
	$(LZSA) -r -f2 top_prints_priority.hgr top_prints_priority.lzsa

top_prints_priority.hgr:	top_prints_priority.png
	$(PNG2GR) top_prints_priority.png top_prints_priority.hgr

####

waterfall_priority.lzsa:	waterfall_priority.gr
	$(LZSA) -r -f2 waterfall_priority.gr waterfall_priority.lzsa

waterfall_priority.gr:	waterfall_priority.png
	$(PNG2GR) waterfall_priority.png waterfall_priority.gr

####

wishing_well_priority.lzsa:	wishing_well_priority.hgr
	$(LZSA) -r -f2 wishing_well_priority.hgr wishing_well_priority.lzsa

wishing_well_priority.hgr:	wishing_well_priority.png
	$(PNG2GR) wishing_well_priority.png wishing_well_priority.hgr

###


clean:	
	rm -f *~ graphics_intro.inc \
		graphics_peasant1.inc graphics_peasant2.inc \
		graphics_peasant3.inc graphics_peasant4.inc \
		priority_intro.inc \
		priority_peasant1.inc priority_peasant2.inc \
		priority_peasant3.inc priority_peasant4.inc \
		*.lzsa *.gr *.hgr

