# Makefile - makefile for xhotkeys webpage
PACKAGE=xhotkeys

# Useful variables
DEBIANDIR=../../debian
DEBIANVERSION=$(shell cat $(DEBIANDIR)/changelog | head -n1 | awk '{print $$2}' | tr -d '()')
VERSION=$(shell echo $(DEBIANVERSION) | sed "s/-/./")
TARBALL=$(PACKAGE)-$(VERSION).tar.gz
ARCH=$(shell cat $(DEBIANDIR)/control | grep ^Architecture | head -n1 | awk '{print $$2}')
DEBPACKAGE=$(PACKAGE)_$(DEBIANVERSION)_$(ARCH).deb

PAGES=index.html howtouse.html contact.html

all: web

upload: all
	cvs ci -m "automatic commit" .
	
web: $(PAGES)

%.html: %-template.html
	cat $< | sed "s/@DEBIANPACKAGE@/$(DEBPACKAGE)/" | \
		 sed "s/@TARBALL@/$(TARBALL)/" | \
		 sed "s/@DATE@/$(shell LC_ALL=C date)/" | \
		 sed "s/@VERSION@/$(VERSION)/" > $@

clean:
	rm -f $(PAGES)

