Q=@
CSS_FILES := $(wildcard ils/css/*.css)

all: static.tar.gz static-pilot.tar.gz

static.tar.gz:
	$Qmkdir static
	$Qcp -r ils static/
	$Q$(foreach file,${CSS_FILES},sed -i 's#resources\.rero\.ch/ils#resources\.rero\.ch/ils/test#g' "static/$(file)" &)
	$Qsleep 1
	$Qtar cfz static.tar.gz --directory=static/ils/ css images

static-pilot.tar.gz: logo-global.pilot.png
	$Qmkdir static-pilot
	$Qcp -r ils static-pilot/
	$Q$(foreach file,${CSS_FILES},sed -i 's#resources\.rero\.ch/ils#resources\.rero\.ch/ils/pilot#g' "static-pilot/$(file)" &)
	$Qcp -f logo-global.pilot.png static-pilot/ils/images/logo-global.png
	$Qsleep 1
	$Qtar cfz static-pilot.tar.gz --directory=static-pilot/ils/ css images

o9: static-o9.tar.gz

static-o9.tar.gz:
	$Qmkdir static-o9
	$Qcp -r ils static-o9/
	$Q$(foreach file,${CSS_FILES},sed -i 's#resources\.rero\.ch#o9\.re#g' "static-o9/$(file)" &)
	$Qsleep 1
	$Qtar cfz static-o9.tar.gz --directory=static-o9/ ils

clean:
	$Qrm -rf static/ static-pilot/ static-o9/ *.tar.gz