# Makefile - makefile for xhotkeys
PACKAGE=xhotkeys

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

FILES=index.html howtouse.html

all: web

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

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

clean:
	rm -f $(FILES)


