

# this works on Linux1
# PATH=/usr/local/bin:/usr/local/pgsql/bin/
PSQL=/usr/local/pgsql/bin/psql

# html *.t.html.{en,it,ru}
templates:=$(wildcard *.t)

products:=$(subst .t,, $(templates))


all:  $(SEDFILE) $(products)
	ls -l $(products)


SEDFILE=ricerche.sed

$(SEDFILE): FORCE
	$(PSQL) -h linux10 -d maruska -A -t -q -f ricerche.sql > $@
	chgrp html $@
	chmod 660  $@

FORCE:



$(products):%: %.t $(SEDFILE)
	sed -f $(SEDFILE)  $< > products/$@
	if [ -f $@ ]; then mv -fv $@ static/;fi
	install -g html -m 664  products/$@  .
	rm products/$@




# .PHONY:	ricerche.sql
#force









