include ../../../../../Makefile.inc

PNG2GR = ../../../../../utils/gr-utils/png2gr
LZSA = ~/research/lzsa/lzsa/lzsa

all:	ootw_c15_bath.inc ootw_c15_walk.inc ootw_c15_final.inc \
	ootw_c15_walkway.inc ootw_c15_bridge.inc ootw_c15_fall.inc

#####

ootw_c15_bath.inc:	\
	bath_00.lzsa bath_01.lzsa bath_02.lzsa bath_03.lzsa bath_04.lzsa \
	bath_05.lzsa bath_06.lzsa bath_07.lzsa bath_08.lzsa bath_09.lzsa \
	bath_10.lzsa bath_11.lzsa bath_12.lzsa bath_13.lzsa bath_14.lzsa \
	bath_15.lzsa bath_16.lzsa bath_17.lzsa bath_18.lzsa bath_19.lzsa \
	bath_20.lzsa bath_21.lzsa bath_22.lzsa bath_23.lzsa bath_24.lzsa \
	bath_25.lzsa bath_26.lzsa bath_27.lzsa bath_28.lzsa bath_29.lzsa \
	bath_30.lzsa bath_31.lzsa bath_32.lzsa bath_33.lzsa bath_34.lzsa \
	bath_35.lzsa bath_end.lzsa
	echo "bath_00_lzsa: .incbin \"bath_00.lzsa\"" > ootw_c15_bath.inc
	echo "bath_01_lzsa: .incbin \"bath_01.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_02_lzsa: .incbin \"bath_02.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_03_lzsa: .incbin \"bath_03.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_04_lzsa: .incbin \"bath_04.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_05_lzsa: .incbin \"bath_05.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_06_lzsa: .incbin \"bath_06.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_07_lzsa: .incbin \"bath_07.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_08_lzsa: .incbin \"bath_08.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_09_lzsa: .incbin \"bath_09.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_10_lzsa: .incbin \"bath_10.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_11_lzsa: .incbin \"bath_11.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_12_lzsa: .incbin \"bath_12.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_13_lzsa: .incbin \"bath_13.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_14_lzsa: .incbin \"bath_14.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_15_lzsa: .incbin \"bath_15.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_16_lzsa: .incbin \"bath_16.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_17_lzsa: .incbin \"bath_17.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_18_lzsa: .incbin \"bath_18.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_19_lzsa: .incbin \"bath_19.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_20_lzsa: .incbin \"bath_20.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_21_lzsa: .incbin \"bath_21.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_22_lzsa: .incbin \"bath_22.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_23_lzsa: .incbin \"bath_23.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_24_lzsa: .incbin \"bath_24.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_25_lzsa: .incbin \"bath_25.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_26_lzsa: .incbin \"bath_26.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_27_lzsa: .incbin \"bath_27.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_28_lzsa: .incbin \"bath_28.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_29_lzsa: .incbin \"bath_29.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_30_lzsa: .incbin \"bath_30.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_31_lzsa: .incbin \"bath_31.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_32_lzsa: .incbin \"bath_32.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_33_lzsa: .incbin \"bath_33.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_34_lzsa: .incbin \"bath_34.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_35_lzsa: .incbin \"bath_35.lzsa\"" >> ootw_c15_bath.inc
	echo "bath_end_lzsa: .incbin \"bath_end.lzsa\"" >> ootw_c15_bath.inc

ootw_c15_walk.inc:	\
	walk_00.lzsa walk_01.lzsa walk_02.lzsa walk_03.lzsa walk_04.lzsa \
	walk_05.lzsa walk_06.lzsa walk_07.lzsa walk_08.lzsa walk_09.lzsa \
	walk_10.lzsa bigshot_01.lzsa bigshot_02.lzsa bigshot_03.lzsa bigshot_04.lzsa
	echo "walk00_lzsa: .incbin \"walk_00.lzsa\"" > ootw_c15_walk.inc
	echo "walk01_lzsa: .incbin \"walk_01.lzsa\"" >> ootw_c15_walk.inc
	echo "walk02_lzsa: .incbin \"walk_02.lzsa\"" >> ootw_c15_walk.inc
	echo "walk03_lzsa: .incbin \"walk_03.lzsa\"" >> ootw_c15_walk.inc
	echo "walk04_lzsa: .incbin \"walk_04.lzsa\"" >> ootw_c15_walk.inc
	echo "walk05_lzsa: .incbin \"walk_05.lzsa\"" >> ootw_c15_walk.inc
	echo "walk06_lzsa: .incbin \"walk_06.lzsa\"" >> ootw_c15_walk.inc
	echo "walk07_lzsa: .incbin \"walk_07.lzsa\"" >> ootw_c15_walk.inc
	echo "walk08_lzsa: .incbin \"walk_08.lzsa\"" >> ootw_c15_walk.inc
	echo "walk09_lzsa: .incbin \"walk_09.lzsa\"" >> ootw_c15_walk.inc
	echo "walk10_lzsa: .incbin \"walk_10.lzsa\"" >> ootw_c15_walk.inc
	echo "bigshot01_lzsa: .incbin \"bigshot_01.lzsa\"" >> ootw_c15_walk.inc
	echo "bigshot02_lzsa: .incbin \"bigshot_02.lzsa\"" >> ootw_c15_walk.inc
	echo "bigshot03_lzsa: .incbin \"bigshot_03.lzsa\"" >> ootw_c15_walk.inc
	echo "bigshot04_lzsa: .incbin \"bigshot_04.lzsa\"" >> ootw_c15_walk.inc

ootw_c15_final.inc:	\
	walkway1.lzsa above_pit.lzsa final.lzsa
	echo "walkway1_lzsa: .incbin \"walkway1.lzsa\"" > ootw_c15_final.inc
	echo "above_pit_lzsa: .incbin \"above_pit.lzsa\"" >> ootw_c15_final.inc
	echo "final_lzsa: .incbin \"final.lzsa\"" >> ootw_c15_final.inc

ootw_c15_walkway.inc:	\
	walkway2.lzsa walkway2_after.lzsa crash1.lzsa \
	crash2.lzsa crash3.lzsa crash4.lzsa crash5.lzsa crash6.lzsa crash7.lzsa
	echo "walkway2_lzsa: .incbin \"walkway2.lzsa\"" > ootw_c15_walkway.inc
	echo "walkway2_after_lzsa: .incbin \"walkway2_after.lzsa\"" >> ootw_c15_walkway.inc
	echo "crash1_lzsa: .incbin \"crash1.lzsa\"" >> ootw_c15_walkway.inc
	echo "crash2_lzsa: .incbin \"crash2.lzsa\"" >> ootw_c15_walkway.inc
	echo "crash3_lzsa: .incbin \"crash3.lzsa\"" >> ootw_c15_walkway.inc
	echo "crash4_lzsa: .incbin \"crash4.lzsa\"" >> ootw_c15_walkway.inc
	echo "crash5_lzsa: .incbin \"crash5.lzsa\"" >> ootw_c15_walkway.inc
	echo "crash6_lzsa: .incbin \"crash6.lzsa\"" >> ootw_c15_walkway.inc
	echo "crash7_lzsa: .incbin \"crash7.lzsa\"" >> ootw_c15_walkway.inc

ootw_c15_bridge.inc:	\
	walkway3.lzsa \
	lshot1.lzsa lshot2.lzsa lshot3.lzsa lshot4.lzsa lshot5.lzsa lshot6.lzsa
	echo "walkway3_lzsa: .incbin \"walkway3.lzsa\"" > ootw_c15_bridge.inc
	echo "lshot1_lzsa: .incbin \"lshot1.lzsa\"" >> ootw_c15_bridge.inc
	echo "lshot2_lzsa: .incbin \"lshot2.lzsa\"" >> ootw_c15_bridge.inc
	echo "lshot3_lzsa: .incbin \"lshot3.lzsa\"" >> ootw_c15_bridge.inc
	echo "lshot4_lzsa: .incbin \"lshot4.lzsa\"" >> ootw_c15_bridge.inc
	echo "lshot5_lzsa: .incbin \"lshot5.lzsa\"" >> ootw_c15_bridge.inc
	echo "lshot6_lzsa: .incbin \"lshot6.lzsa\"" >> ootw_c15_bridge.inc

ootw_c15_fall.inc:	\
	fall_bg.lzsa \
	fall01.lzsa fall02.lzsa fall03.lzsa fall04.lzsa fall05.lzsa \
	fall06.lzsa fall07.lzsa fall08.lzsa fall09.lzsa fall10.lzsa \
	fall11.lzsa fall12.lzsa fall13.lzsa fall14.lzsa fall15.lzsa \
	fall16.lzsa fall17.lzsa fall18.lzsa fall19.lzsa fall20.lzsa \
	fall21.lzsa fall22.lzsa fall23.lzsa
	echo "fall_bg_lzsa: .incbin \"fall_bg.lzsa\"" > ootw_c15_fall.inc
	echo "fall01_lzsa: .incbin \"fall01.lzsa\"" >> ootw_c15_fall.inc
	echo "fall02_lzsa: .incbin \"fall02.lzsa\"" >> ootw_c15_fall.inc
	echo "fall03_lzsa: .incbin \"fall03.lzsa\"" >> ootw_c15_fall.inc
	echo "fall04_lzsa: .incbin \"fall04.lzsa\"" >> ootw_c15_fall.inc
	echo "fall05_lzsa: .incbin \"fall05.lzsa\"" >> ootw_c15_fall.inc
	echo "fall06_lzsa: .incbin \"fall06.lzsa\"" >> ootw_c15_fall.inc
	echo "fall07_lzsa: .incbin \"fall07.lzsa\"" >> ootw_c15_fall.inc
	echo "fall08_lzsa: .incbin \"fall08.lzsa\"" >> ootw_c15_fall.inc
	echo "fall09_lzsa: .incbin \"fall09.lzsa\"" >> ootw_c15_fall.inc
	echo "fall10_lzsa: .incbin \"fall10.lzsa\"" >> ootw_c15_fall.inc
	echo "fall11_lzsa: .incbin \"fall11.lzsa\"" >> ootw_c15_fall.inc
	echo "fall12_lzsa: .incbin \"fall12.lzsa\"" >> ootw_c15_fall.inc
	echo "fall13_lzsa: .incbin \"fall13.lzsa\"" >> ootw_c15_fall.inc
	echo "fall14_lzsa: .incbin \"fall14.lzsa\"" >> ootw_c15_fall.inc
	echo "fall15_lzsa: .incbin \"fall15.lzsa\"" >> ootw_c15_fall.inc
	echo "fall16_lzsa: .incbin \"fall16.lzsa\"" >> ootw_c15_fall.inc
	echo "fall17_lzsa: .incbin \"fall17.lzsa\"" >> ootw_c15_fall.inc
	echo "fall18_lzsa: .incbin \"fall18.lzsa\"" >> ootw_c15_fall.inc
	echo "fall19_lzsa: .incbin \"fall19.lzsa\"" >> ootw_c15_fall.inc
	echo "fall20_lzsa: .incbin \"fall20.lzsa\"" >> ootw_c15_fall.inc
	echo "fall21_lzsa: .incbin \"fall21.lzsa\"" >> ootw_c15_fall.inc
	echo "fall22_lzsa: .incbin \"fall22.lzsa\"" >> ootw_c15_fall.inc
	echo "fall23_lzsa: .incbin \"fall23.lzsa\"" >> ootw_c15_fall.inc

#####

%.gr:	%.png
	$(PNG2GR) $< $@

%.lzsa:	%.gr
	$(LZSA) -r -f2 $< $@

#####

clean:		
	rm -f *~ *.o *.lst *.lzsa *.inc

