include ../../Make.helper

../data/%.z.info:
	$(eval TC:=../data/$*)
	@echo "Get xz-compression ratio for $(TC)"
	$(eval TC_XZ:=$(TC).xz)
	$(shell xz -9 -z -k -c $(TC) > $(TC_XZ))
	$(eval XZ_SIZE:=$(call file_size,$(TC_XZ)))
	$(shell rm $(TC_XZ)) 
	@echo "Get gzip-compression ratio for $(TC)"
	$(eval TC_GZ:=$(TC).gz) 
	$(shell gzip -9 -c $(TC) > $(TC_GZ))
	$(eval GZ_SIZE:=$(call file_size,$(TC_GZ)))
	$(shell rm $(TC_GZ))
	$(eval SIZE:=$(call file_size,$(TC)))
	$(eval XZ_RATIO:=$(shell echo "scale=2;100*$(XZ_SIZE)/$(SIZE)" | bc -q))
	$(eval GZ_RATIO:=$(shell echo "scale=2;100*$(GZ_SIZE)/$(SIZE)" | bc -q))
	@echo "xz;$(XZ_RATIO);xz -9\ngzip;$(GZ_RATIO);gzip -9" > $@
