## Makefile to be run on a Unix box with zic

VERSION = 2015e
TZDIR = zoneinfo
TZTMP = tz
TARFILE = tzdata$(VERSION).tar.gz

## or ZIC = /usr/sbin/zic
ZIC = zic

all:
	rm -rf $(TZTMP)
	mkdir $(TZTMP)
	tar -C $(TZTMP) -zxf $(TARFILE)
	rm -rf $(TZDIR)
	mkdir $(TZDIR)
	(cd $(TZTMP); make -f ../Make.zi install)
	echo $(VERSION) > $(TZDIR)/VERSION
	rm -f zoneinfo.zip
	zip -qr9X zoneinfo.zip $(TZDIR)
	rm -rf $(TZTMP) $(TZDIR)

## omit Factory: meaningless.
YDATA =	africa antarctica asia australasia europe northamerica southamerica \
  pacificnew etcetera backward
TABDATA = iso3166.tab zone.tab


install: $(YDATA) $(TABDATA) yearistype.sh
	$(ZIC) -y ./yearistype -d ../$(TZDIR) -L /dev/null $(YDATA)
	cp $(TABDATA) ../$(TZDIR)
