all: avcache avcache-postfix

avcache: avcache.c
	/opt/diet/bin/diet -Os gcc -s -Wall -W -o $@ $^ -lowfat

avcache-postfix: avcache.c
	/opt/diet/bin/diet -Os gcc -s -Wall -W -o $@ $^ -lowfat -DPOSTFIX

clean:
	rm -f avcache avcache-postfix

CURNAME=$(notdir $(shell pwd))
VERSION=avcache-$(shell head -n 1 CHANGES|sed 's/://')

tar: rename
	cd .. && tar cvvf $(VERSION).tar.bz2 $(VERSION) --use=bzip2 --exclude CVS --exclude .cvsignore

rename:
	if test $(CURNAME) != $(VERSION); then cd .. && mv $(CURNAME) $(VERSION); fi
