topsrc = @top_srcdir@
tooldir = $(topsrc)/tools

INSTALL = @INSTALL@
gnome_prefix = @gnome_prefix@

VPATH = $(topsrc)/gui2/omf-install

docdir = $(gnome_prefix)/share/gnome/help/gretl/C
omfdir = $(gnome_prefix)/share/omf/gretl

gretl-C.omf: gretl-C.omf.in
	  scrollkeeper-preinstall $(docdir)/`awk 'BEGIN {RS = ">" } \
	  /identifier/ {print $$0}' $< | awk 'BEGIN {FS="\""} /url/ \
	  {print $$2}'` $< $@; 

install: gretl-C.omf
	$(tooldir)/mkinstalldirs $(omfdir)
	$(INSTALL) -m 644 $< $(omfdir)
	scrollkeeper-update -p $(gnome_prefix)/var/scrollkeeper
