head	1.48;
access;
symbols
	perseant-exfatfs-base-20250801:1.48
	perseant-exfatfs-base-20240630:1.48
	cjep_sun2x:1.48.0.14
	cjep_sun2x-base:1.48
	cjep_staticlib_x-base1:1.48
	cjep_staticlib_x:1.48.0.12
	cjep_staticlib_x-base:1.48
	phil-wifi-20200421:1.48
	phil-wifi-20200411:1.48
	phil-wifi-20200406:1.48
	pgoyette-compat-merge-20190127:1.48
	pgoyette-compat-20190127:1.48
	pgoyette-compat-20190118:1.48
	pgoyette-compat-1226:1.48
	pgoyette-compat-1126:1.48
	pgoyette-compat-1020:1.48
	pgoyette-compat-0930:1.48
	pgoyette-compat-0906:1.48
	pgoyette-compat-0728:1.48
	pgoyette-compat-0625:1.48
	pgoyette-compat-0521:1.48
	pgoyette-compat-0502:1.48
	pgoyette-compat-0422:1.48
	pgoyette-compat-0415:1.48
	pgoyette-compat-0407:1.48
	pgoyette-compat-0330:1.48
	pgoyette-compat-0322:1.48
	pgoyette-compat-0315:1.48
	pgoyette-compat:1.48.0.10
	pgoyette-compat-base:1.48
	perseant-stdc-iso10646:1.48.0.8
	perseant-stdc-iso10646-base:1.48
	prg-localcount2-base3:1.48
	prg-localcount2-base2:1.48
	prg-localcount2-base1:1.48
	prg-localcount2:1.48.0.6
	prg-localcount2-base:1.48
	pgoyette-localcount-20170426:1.48
	bouyer-socketcan-base1:1.48
	pgoyette-localcount-20170320:1.48
	bouyer-socketcan:1.48.0.4
	bouyer-socketcan-base:1.48
	pgoyette-localcount-20170107:1.48
	pgoyette-localcount-20161104:1.48
	localcount-20160914:1.48
	pgoyette-localcount-20160806:1.48
	pgoyette-localcount-20160726:1.48
	pgoyette-localcount:1.48.0.2
	pgoyette-localcount-base:1.48
	netbsd-5-2-3-RELEASE:1.42.12.2.2.1
	netbsd-5-1-5-RELEASE:1.42.12.1.2.2
	netbsd-6-0-6-RELEASE:1.43.14.1
	netbsd-6-1-5-RELEASE:1.43.18.1
	TZDATA2014F:1.1.1.13
	TZDATA2014E:1.1.1.12
	TZDATA2014C:1.1.1.11
	yamt-pagecache-base9:1.46
	yamt-pagecache-tag8:1.43
	netbsd-6-1-4-RELEASE:1.43
	netbsd-6-0-5-RELEASE:1.43
	tls-earlyentropy:1.46.0.2
	tls-earlyentropy-base:1.47
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.46
	riastradh-drm2-base3:1.46
	netbsd-6-1-3-RELEASE:1.43
	netbsd-6-0-4-RELEASE:1.43
	netbsd-5-2-2-RELEASE:1.42.12.2
	netbsd-5-1-4-RELEASE:1.42.12.1.2.1
	TZDATA2013I:1.1.1.10
	netbsd-6-1-2-RELEASE:1.43
	netbsd-6-0-3-RELEASE:1.43
	netbsd-5-2-1-RELEASE:1.42.12.2
	netbsd-5-1-3-RELEASE:1.42.12.1.2.1
	netbsd-6-1-1-RELEASE:1.43
	riastradh-drm2-base2:1.44
	riastradh-drm2-base1:1.44
	riastradh-drm2:1.44.0.4
	riastradh-drm2-base:1.44
	TZDATA2013D:1.1.1.9
	netbsd-6-1:1.43.0.18
	netbsd-6-0-2-RELEASE:1.43
	netbsd-6-1-RELEASE:1.43
	TZDATA2013C:1.1.1.8
	netbsd-6-1-RC4:1.43
	netbsd-6-1-RC3:1.43
	agc-symver:1.44.0.2
	agc-symver-base:1.44
	netbsd-6-1-RC2:1.43
	TZDATA2013B:1.1.1.7
	TZDATA:1.1.1
	TZDATA2013A:1.1.1.6
	netbsd-6-1-RC1:1.43
	yamt-pagecache-base8:1.43
	netbsd-5-2:1.42.12.2.0.2
	netbsd-6-0-1-RELEASE:1.43
	yamt-pagecache-base7:1.43
	netbsd-5-2-RELEASE:1.42.12.2
	TZDATA2012J:1.1.1.5
	netbsd-5-2-RC1:1.42.12.2
	TZDATA2012I:1.1.1.4
	matt-nb6-plus-nbase:1.43
	yamt-pagecache-base6:1.43
	TZDATA2012H:1.1.1.3
	TZDATA2012G:1.1.1.2
	ADO:1.1.1
	netbsd-6-0:1.43.0.14
	netbsd-6-0-RELEASE:1.43
	netbsd-6-0-RC2:1.43
	tls-maxphys:1.43.0.12
	tls-maxphys-base:1.48
	matt-nb6-plus:1.43.0.10
	matt-nb6-plus-base:1.43
	netbsd-6-0-RC1:1.43
	yamt-pagecache-base5:1.43
	yamt-pagecache-base4:1.43
	netbsd-6:1.43.0.8
	netbsd-6-base:1.43
	netbsd-5-1-2-RELEASE:1.42.12.1.2.1
	netbsd-5-1-1-RELEASE:1.42.12.1.2.1
	yamt-pagecache-base3:1.43
	yamt-pagecache-base2:1.43
	yamt-pagecache:1.43.0.6
	yamt-pagecache-base:1.43
	cherry-xenmp:1.43.0.4
	cherry-xenmp-base:1.43
	bouyer-quota2-nbase:1.43
	bouyer-quota2:1.43.0.2
	bouyer-quota2-base:1.43
	matt-mips64-premerge-20101231:1.43
	matt-nb5-mips64-premerge-20101231:1.42.16.1.2.1
	matt-nb5-pq3:1.42.12.1.0.4
	matt-nb5-pq3-base:1.42.12.1
	netbsd-5-1:1.42.12.1.0.2
	netbsd-5-1-RELEASE:1.42.12.1
	netbsd-5-1-RC4:1.42.12.1
	matt-nb5-mips64-k15:1.42.16.1.2.1
	netbsd-5-1-RC3:1.42.12.1
	netbsd-5-1-RC2:1.42.12.1
	netbsd-5-1-RC1:1.42.12.1
	netbsd-5-0-2-RELEASE:1.42.16.1
	matt-nb5-mips64-premerge-20091211:1.42.16.1
	matt-premerge-20091211:1.43
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.42.16.1
	matt-nb4-mips64-k7-u2a-k9b:1.42.16.1
	matt-nb5-mips64-u1-k1-k5:1.42.16.1
	matt-nb5-mips64:1.42.16.1.0.2
	netbsd-5-0-1-RELEASE:1.42.16.1
	jym-xensuspend-nbase:1.43
	netbsd-5-0:1.42.0.16
	netbsd-5-0-RELEASE:1.42
	netbsd-5-0-RC4:1.42
	netbsd-5-0-RC3:1.42
	netbsd-5-0-RC2:1.42
	jym-xensuspend:1.42.0.14
	jym-xensuspend-base:1.43
	netbsd-5-0-RC1:1.42
	netbsd-5:1.42.0.12
	netbsd-5-base:1.42
	matt-mips64-base2:1.42
	matt-mips64:1.41.0.12
	netbsd-4-0-1-RELEASE:1.41.4.1
	wrstuden-revivesa-base-3:1.42
	wrstuden-revivesa-base-2:1.42
	wrstuden-fixsa-newbase:1.41.4.1
	wrstuden-revivesa-base-1:1.42
	yamt-pf42-base4:1.42
	yamt-pf42-base3:1.42
	hpcarm-cleanup-nbase:1.42
	yamt-pf42-baseX:1.42
	yamt-pf42-base2:1.42
	wrstuden-revivesa:1.42.0.10
	wrstuden-revivesa-base:1.42
	yamt-pf42:1.42.0.8
	yamt-pf42-base:1.42
	mjf-devfs2:1.42.0.6
	mjf-devfs2-base:1.42
	keiichi-mipv6-nbase:1.42
	keiichi-mipv6:1.42.0.4
	keiichi-mipv6-base:1.42
	matt-armv6-nbase:1.42
	matt-armv6-prevmlocking:1.41
	wrstuden-fixsa-base-1:1.41.4.1
	netbsd-4-0:1.41.4.1.0.2
	netbsd-4-0-RELEASE:1.41.4.1
	cube-autoconf:1.42.0.2
	cube-autoconf-base:1.42
	netbsd-4-0-RC5:1.41.4.1
	netbsd-4-0-RC4:1.41
	netbsd-4-0-RC3:1.41
	netbsd-4-0-RC2:1.41
	netbsd-4-0-RC1:1.41
	matt-armv6:1.41.0.10
	matt-armv6-base:1.42
	matt-mips64-base:1.41
	hpcarm-cleanup:1.41.0.8
	hpcarm-cleanup-base:1.42
	netbsd-3-1-1-RELEASE:1.39
	netbsd-3-0-3-RELEASE:1.39
	wrstuden-fixsa:1.41.0.6
	wrstuden-fixsa-base:1.41.4.1
	abandoned-netbsd-4-base:1.41
	abandoned-netbsd-4:1.41.0.2
	netbsd-3-1:1.39.0.6
	netbsd-3-1-RELEASE:1.39
	netbsd-3-0-2-RELEASE:1.39
	netbsd-3-1-RC4:1.39
	netbsd-3-1-RC3:1.39
	netbsd-3-1-RC2:1.39
	netbsd-3-1-RC1:1.39
	netbsd-4:1.41.0.4
	netbsd-4-base:1.41
	netbsd-3-0-1-RELEASE:1.39
	netbsd-3-0:1.39.0.4
	netbsd-3-0-RELEASE:1.39
	netbsd-3-0-RC6:1.39
	netbsd-3-0-RC5:1.39
	netbsd-3-0-RC4:1.39
	netbsd-3-0-RC3:1.39
	netbsd-3-0-RC2:1.39
	netbsd-3-0-RC1:1.39
	netbsd-2-0-3-RELEASE:1.37.2.1
	netbsd-2-1:1.37.2.1.0.4
	netbsd-2-1-RELEASE:1.37.2.1
	netbsd-2-1-RC6:1.37.2.1
	netbsd-2-1-RC5:1.37.2.1
	netbsd-2-1-RC4:1.37.2.1
	netbsd-2-1-RC3:1.37.2.1
	netbsd-2-1-RC2:1.37.2.1
	netbsd-2-1-RC1:1.37.2.1
	netbsd-2-0-2-RELEASE:1.37.2.1
	netbsd-3:1.39.0.2
	netbsd-3-base:1.39
	netbsd-2-0-1-RELEASE:1.37.2.1
	netbsd-2:1.37.2.1.0.2
	netbsd-2-base:1.37.2.1
	netbsd-2-0-RELEASE:1.37.2.1
	netbsd-2-0-RC5:1.37.2.1
	netbsd-2-0-RC4:1.37.2.1
	netbsd-2-0-RC3:1.37.2.1
	netbsd-2-0-RC2:1.37.2.1
	netbsd-2-0-RC1:1.37.2.1
	netbsd-2-0:1.37.0.2
	netbsd-2-0-base:1.37
	netbsd-1-6-PATCH002-RELEASE:1.28.2.1
	netbsd-1-6-PATCH002:1.28.2.1
	netbsd-1-6-PATCH002-RC4:1.28.2.1
	netbsd-1-6-PATCH002-RC3:1.28.2.1
	netbsd-1-6-PATCH002-RC2:1.28.2.1
	netbsd-1-6-PATCH002-RC1:1.28.2.1
	netbsd-1-6-PATCH001:1.28.2.1
	netbsd-1-6-PATCH001-RELEASE:1.28.2.1
	netbsd-1-6-PATCH001-RC3:1.28.2.1
	netbsd-1-6-PATCH001-RC2:1.28.2.1
	netbsd-1-6-PATCH001-RC1:1.28.2.1
	fvdl_fs64_base:1.32
	netbsd-1-6-RELEASE:1.28.2.1
	netbsd-1-6-RC3:1.28.2.1
	netbsd-1-6-RC2:1.28.2.1
	netbsd-1-6-RC1:1.28.2.1
	netbsd-1-6:1.28.0.2
	netbsd-1-6-base:1.28
	netbsd-1-5-PATCH003:1.22
	netbsd-1-5-PATCH002:1.22
	netbsd-1-5-PATCH001:1.22
	netbsd-1-5-RELEASE:1.22
	netbsd-1-5-BETA2:1.22
	netbsd-1-5-BETA:1.22
	netbsd-1-4-PATCH003:1.21
	netbsd-1-5-ALPHA2:1.22
	netbsd-1-5:1.22.0.8
	netbsd-1-5-base:1.22
	minoura-xpg4dl:1.22.0.6
	minoura-xpg4dl-base:1.22
	netbsd-1-4-PATCH002:1.21
	wrstuden-devbsize-19991221:1.22
	wrstuden-devbsize:1.22.0.4
	wrstuden-devbsize-base:1.22
	comdex-fall-1999:1.22.0.2
	comdex-fall-1999-base:1.22
	netbsd-1-4-PATCH001:1.21
	netbsd-1-4-RELEASE:1.21
	netbsd-1-4:1.21.0.2
	netbsd-1-4-base:1.21
	netbsd-1-3-PATCH003:1.19
	netbsd-1-3-PATCH003-CANDIDATE2:1.19
	netbsd-1-3-PATCH003-CANDIDATE1:1.19
	netbsd-1-3-PATCH003-CANDIDATE0:1.19
	netbsd-1-3-PATCH002:1.19
	netbsd-1-3-PATCH001:1.19
	netbsd-1-3-RELEASE:1.19
	netbsd-1-3-BETA:1.19
	netbsd-1-3:1.19.0.2
	netbsd-1-3-base:1.19
	netbsd-1-2-PATCH001:1.14
	netbsd-1-2-RELEASE:1.14
	netbsd-1-2-BETA:1.14
	netbsd-1-2:1.14.0.6
	netbsd-1-2-base:1.14
	netbsd-1-1-PATCH001:1.14
	netbsd-1-1-RELEASE:1.14
	netbsd-1-1:1.14.0.2
	netbsd-1-1-base:1.14
	netbsd-1-0-PATCH06:1.11
	netbsd-1-0-PATCH05:1.11
	netbsd-1-0-PATCH04:1.11
	netbsd-1-0-PATCH03:1.11
	netbsd-1-0-PATCH02:1.11
	netbsd-1-0-PATCH1:1.11
	netbsd-1-0-PATCH0:1.11
	netbsd-1-0-RELEASE:1.11
	netbsd-1-0:1.11.0.2
	netbsd-1-0-base:1.11
	netbsd-0-9-RELEASE:1.6
	netbsd-0-9-BETA:1.6
	netbsd-0-9-ALPHA2:1.6
	netbsd-0-9-ALPHA:1.6
	netbsd-0-9:1.6.0.2
	netbsd-0-9-base:1.6
	netbsd-0-8:1.3
	netbsd-alpha-1:1.3
	patchkit-0-2-2:1.1.1.1
	WFJ-386bsd-01:1.1.1.1
	WFJ-920714:1.1.1;
locks; strict;
comment	@# @;


1.48
date	2014.08.09.15.22.40;	author apb;	state dead;
branches;
next	1.47;
commitid	KpuVSw4LCt7MrHLx;

1.47
date	2014.08.06.19.18.05;	author apb;	state Exp;
branches;
next	1.46;
commitid	JZGAhyYDVEECPkLx;

1.46
date	2013.12.26.20.19.17;	author apb;	state Exp;
branches
	1.46.2.1;
next	1.45;
commitid	drLUZjSrkJoXlGix;

1.45
date	2013.12.26.17.09.39;	author apb;	state Exp;
branches;
next	1.44;
commitid	TxDXnlHD9KwMiFix;

1.44
date	2013.03.06.17.32.51;	author christos;	state Exp;
branches;
next	1.43;

1.43
date	2009.04.10.16.16.12;	author apb;	state Exp;
branches
	1.43.6.1
	1.43.8.1
	1.43.12.1
	1.43.14.1
	1.43.18.1;
next	1.42;

1.42
date	2007.11.08.20.14.07;	author drochner;	state Exp;
branches
	1.42.12.1
	1.42.14.1
	1.42.16.1;
next	1.41;

1.41
date	2006.02.27.09.08.10;	author lukem;	state Exp;
branches
	1.41.4.1
	1.41.6.1
	1.41.10.1;
next	1.40;

1.40
date	2006.02.27.08.08.50;	author lukem;	state Exp;
branches;
next	1.39;

1.39
date	2004.08.31.00.00.31;	author lukem;	state Exp;
branches
	1.39.2.1
	1.39.4.1
	1.39.6.1;
next	1.38;

1.38
date	2004.06.21.18.20.08;	author jmc;	state Exp;
branches;
next	1.37;

1.37
date	2004.01.30.04.30.51;	author lukem;	state Exp;
branches
	1.37.2.1;
next	1.36;

1.36
date	2003.10.21.10.01.20;	author lukem;	state Exp;
branches;
next	1.35;

1.35
date	2003.10.19.14.20.28;	author lukem;	state Exp;
branches;
next	1.34;

1.34
date	2003.07.18.08.26.10;	author lukem;	state Exp;
branches;
next	1.33;

1.33
date	2003.07.10.10.34.39;	author lukem;	state Exp;
branches;
next	1.32;

1.32
date	2002.12.23.06.52.51;	author lukem;	state Exp;
branches;
next	1.31;

1.31
date	2002.12.21.15.54.51;	author lukem;	state Exp;
branches;
next	1.30;

1.30
date	2002.12.19.10.56.39;	author lukem;	state Exp;
branches;
next	1.29;

1.29
date	2002.06.10.18.47.12;	author mason;	state Exp;
branches;
next	1.28;

1.28
date	2002.01.05.07.35.20;	author mrg;	state Exp;
branches
	1.28.2.1;
next	1.27;

1.27
date	2001.12.12.12.24.23;	author lukem;	state Exp;
branches;
next	1.26;

1.26
date	2001.12.12.01.49.33;	author tv;	state Exp;
branches;
next	1.25;

1.25
date	2001.11.26.15.24.20;	author perry;	state Exp;
branches;
next	1.24;

1.24
date	2001.11.24.21.37.23;	author perry;	state Exp;
branches;
next	1.23;

1.23
date	2001.11.19.05.18.53;	author perry;	state Exp;
branches;
next	1.22;

1.22
date	99.08.21.06.30.12;	author simonb;	state Exp;
branches;
next	1.21;

1.21
date	99.02.13.02.54.36;	author lukem;	state Exp;
branches;
next	1.20;

1.20
date	98.09.27.17.22.10;	author lukem;	state Exp;
branches;
next	1.19;

1.19
date	97.06.18.01.56.03;	author jtc;	state Exp;
branches;
next	1.18;

1.18
date	97.06.18.01.27.43;	author jtc;	state Exp;
branches;
next	1.17;

1.17
date	97.05.07.16.12.00;	author mycroft;	state Exp;
branches;
next	1.16;

1.16
date	97.05.07.09.43.32;	author mycroft;	state Exp;
branches;
next	1.15;

1.15
date	97.01.16.21.27.22;	author perry;	state Exp;
branches;
next	1.14;

1.14
date	95.04.22.12.10.17;	author cgd;	state Exp;
branches;
next	1.13;

1.13
date	95.03.11.01.27.43;	author jtc;	state Exp;
branches;
next	1.12;

1.12
date	94.12.22.10.44.49;	author cgd;	state Exp;
branches;
next	1.11;

1.11
date	94.02.10.04.42.42;	author cgd;	state Exp;
branches;
next	1.10;

1.10
date	93.12.28.12.03.24;	author davidb;	state Exp;
branches;
next	1.9;

1.9
date	93.09.17.23.58.57;	author cgd;	state Exp;
branches;
next	1.8;

1.8
date	93.09.02.01.10.03;	author cgd;	state Exp;
branches;
next	1.7;

1.7
date	93.07.31.15.27.06;	author mycroft;	state Exp;
branches;
next	1.6;

1.6
date	93.05.25.09.18.44;	author deraadt;	state Exp;
branches;
next	1.5;

1.5
date	93.04.26.03.55.58;	author mycroft;	state Exp;
branches;
next	1.4;

1.4
date	93.04.26.03.43.48;	author mycroft;	state Exp;
branches;
next	1.3;

1.3
date	93.04.03.00.37.53;	author glass;	state Exp;
branches;
next	1.2;

1.2
date	93.03.30.00.31.52;	author cgd;	state Exp;
branches;
next	1.1;

1.1
date	93.03.21.09.45.37;	author cgd;	state Exp;
branches
	1.1.1.1;
next	;

1.46.2.1
date	2014.08.10.06.53.36;	author tls;	state Exp;
branches;
next	;
commitid	cItJlxDHutXyBMLx;

1.43.6.1
date	2014.05.22.11.37.54;	author yamt;	state Exp;
branches;
next	;
commitid	P3Rlj4go6xHqKwBx;

1.43.8.1
date	2014.05.21.21.25.48;	author bouyer;	state Exp;
branches;
next	1.43.8.2;
commitid	oSSklM4IxqK82sBx;

1.43.8.2
date	2014.08.15.23.34.17;	author riz;	state Exp;
branches;
next	1.43.8.3;
commitid	a4RhXyhwkx0JYvMx;

1.43.8.3
date	2017.08.10.05.59.06;	author snj;	state Exp;
branches;
next	1.43.8.4;
commitid	j7pciwxMEAcz4D2A;

1.43.8.4
date	2018.03.25.18.31.03;	author martin;	state Exp;
branches;
next	1.43.8.5;
commitid	lyWalat8NG40WRvA;

1.43.8.5
date	2018.03.26.12.17.20;	author martin;	state Exp;
branches;
next	;
commitid	4Y2eht4NXBmFPXvA;

1.43.12.1
date	2013.06.23.06.28.55;	author tls;	state Exp;
branches;
next	1.43.12.2;
commitid	OnlO1cBgtQRcIHUw;

1.43.12.2
date	2014.08.20.00.02.38;	author tls;	state dead;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;

1.43.14.1
date	2014.08.15.23.37.04;	author riz;	state Exp;
branches;
next	1.43.14.2;
commitid	5OO05L8FZ6eIZvMx;

1.43.14.2
date	2017.08.10.06.59.38;	author snj;	state Exp;
branches;
next	1.43.14.3;
commitid	mPSFci0raLzbpD2A;

1.43.14.3
date	2018.03.25.18.38.52;	author martin;	state Exp;
branches;
next	1.43.14.4;
commitid	n55h2ah0zRZLYRvA;

1.43.14.4
date	2018.03.26.12.21.13;	author martin;	state Exp;
branches;
next	;
commitid	xmH2OEhL92sjRXvA;

1.43.18.1
date	2014.08.15.23.39.22;	author riz;	state Exp;
branches;
next	1.43.18.2;
commitid	WRZBBgHa5h6B0wMx;

1.43.18.2
date	2017.08.10.06.35.06;	author snj;	state Exp;
branches;
next	1.43.18.3;
commitid	orV7NMOQ6XwngD2A;

1.43.18.3
date	2018.03.25.18.35.29;	author martin;	state Exp;
branches;
next	1.43.18.4;
commitid	swH5T8g4SrnAXRvA;

1.43.18.4
date	2018.03.26.12.19.22;	author martin;	state Exp;
branches;
next	;
commitid	swbqCxq3Zr4GQXvA;

1.42.12.1
date	2009.06.06.22.10.12;	author bouyer;	state Exp;
branches
	1.42.12.1.2.1;
next	1.42.12.2;

1.42.12.2
date	2011.11.02.18.16.03;	author riz;	state Exp;
branches
	1.42.12.2.2.1;
next	1.42.12.3;

1.42.12.3
date	2014.05.21.22.01.08;	author bouyer;	state Exp;
branches;
next	1.42.12.4;
commitid	3oetpApuI0zeesBx;

1.42.12.4
date	2014.08.15.22.54.35;	author riz;	state Exp;
branches;
next	;
commitid	i3iiwKdK3CL1LvMx;

1.42.12.1.2.1
date	2011.11.02.18.16.28;	author riz;	state Exp;
branches;
next	1.42.12.1.2.2;

1.42.12.1.2.2
date	2014.08.15.23.02.40;	author riz;	state Exp;
branches;
next	;
commitid	ZeHO6HnvsF8VNvMx;

1.42.12.2.2.1
date	2014.08.15.23.06.18;	author riz;	state Exp;
branches;
next	;
commitid	IYChcTeLa2kdPvMx;

1.42.14.1
date	2009.05.13.19.19.17;	author jym;	state Exp;
branches;
next	;

1.42.16.1
date	2009.06.06.22.10.49;	author bouyer;	state Exp;
branches
	1.42.16.1.2.1;
next	1.42.16.2;

1.42.16.2
date	2011.11.02.18.16.16;	author riz;	state Exp;
branches;
next	;

1.42.16.1.2.1
date	2010.04.21.05.26.47;	author matt;	state Exp;
branches;
next	;

1.41.4.1
date	2007.11.25.08.57.05;	author xtraeme;	state Exp;
branches;
next	;

1.41.6.1
date	2008.01.06.05.00.47;	author wrstuden;	state Exp;
branches;
next	;

1.41.10.1
date	2008.01.09.01.39.29;	author matt;	state Exp;
branches;
next	;

1.39.2.1
date	2008.10.08.19.14.22;	author bouyer;	state Exp;
branches;
next	;

1.39.4.1
date	2008.11.22.16.58.59;	author bouyer;	state Exp;
branches;
next	;

1.39.6.1
date	2008.11.22.16.50.09;	author bouyer;	state Exp;
branches;
next	;

1.37.2.1
date	2004.06.22.07.56.26;	author tron;	state Exp;
branches;
next	;

1.28.2.1
date	2002.06.11.16.02.11;	author lukem;	state Exp;
branches;
next	;

1.1.1.1
date	93.03.21.09.45.37;	author cgd;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2012.10.18.08.47.23;	author apb;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2012.10.27.16.43.05;	author apb;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2012.11.04.17.53.27;	author apb;	state Exp;
branches;
next	1.1.1.5;

1.1.1.5
date	2012.11.13.10.57.32;	author apb;	state Exp;
branches;
next	1.1.1.6;

1.1.1.6
date	2013.03.03.19.42.29;	author apb;	state Exp;
branches;
next	1.1.1.7;

1.1.1.7
date	2013.03.12.14.50.20;	author apb;	state Exp;
branches;
next	1.1.1.8;

1.1.1.8
date	2013.05.08.08.15.47;	author apb;	state Exp;
branches;
next	1.1.1.9;

1.1.1.9
date	2013.07.07.10.45.27;	author apb;	state Exp;
branches;
next	1.1.1.10;
commitid	klxmn3ko1zLdIwWw;

1.1.1.10
date	2013.12.26.16.40.53;	author apb;	state Exp;
branches;
next	1.1.1.11;
commitid	ETQq7ECQCpT59Fix;

1.1.1.11
date	2014.05.15.15.42.11;	author apb;	state Exp;
branches;
next	1.1.1.12;
commitid	scVyQC0Rylf8kEAx;

1.1.1.12
date	2014.06.13.19.48.55;	author apb;	state Exp;
branches;
next	1.1.1.13;
commitid	80KXNhUENNO7LoEx;

1.1.1.13
date	2014.08.06.18.35.33;	author apb;	state Exp;
branches;
next	;
commitid	FXZ8LmwQCr3lCkLx;


desc
@@


1.48
log
@Delete src/share/zoneinfo.  The files that previously lived here
have moved to src/external/public-domain/tz/{dist,bin/zoneinfo}.
@
text
@#	$NetBSD: Makefile,v 1.47 2014/08/06 19:18:05 apb Exp $

.include <bsd.own.mk>

# If you want something other than Eastern United States time as a template
# for handling POSIX-style time zone environment variables,
# change the line below (after finding the zone you want in the
# time zone files, or adding it to a time zone file).
# (When a POSIX-style environment variable is handled, the rules in the
# template file are used to determine "spring forward" and "fall back" days and
# times; the environment variable itself specifies UT offsets of standard and
# summer time.)
# Alternately, if you discover you've got the wrong time zone, you can just
#	zic -p rightzone
# to correct things.
# Use the command
#	make zonenames
# to get a list of the values you can use for POSIXRULES.
# If you want POSIX compatibility, use "America/New_York".

POSIXRULES=	America/New_York

# "Compiled" time zone information is placed in the "TZDIR" directory
# (and subdirectories).
# Use an absolute path name for TZDIR unless you're just testing the software.
# Note: ${DESTDIR} is prepended to this for the actual copy.

TZDIR=	/usr/share/zoneinfo

# If you always want time values interpreted as "seconds since the epoch
# (not counting leap seconds)", use
#	REDO=		posix_only
# below.  If you always want right time values interpreted as "seconds since
# the epoch" (counting leap seconds)", use
#	REDO=		right_only
# below.  If you want both sets of data available, with leap seconds not
# counted normally, use
#	REDO=		posix_right
# below.  If you want both sets of data available, with leap seconds counted
# normally, use
#	REDO=		right_posix
# below.

REDO=		posix_only

# Since "." may not be in PATH...
YEARISTYPE=	"${HOST_SH} ${.CURDIR}/yearistype.sh"

PRIMARY_YDATA=	africa antarctica asia australasia \
		europe northamerica southamerica
YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
NDATA=		systemv factory
TDATA=		$(YDATA) $(NDATA)
ZONETABLES=	zone1970.tab zone.tab
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
DATA=		$(YDATA) $(NDATA) $(TABDATA) # yearistype.sh

TZBUILDDIR=	${.OBJDIR}/builddir

.PHONY:	posix_only
posix_only: ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${.CURDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L /dev/null ${TDATA}

.PHONY:	right_only
right_only: leapseconds ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${.CURDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L leapseconds ${TDATA}

.PHONY:	other_two
other_two: leapseconds ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${.CURDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/posix -L /dev/null ${TDATA}
	cd ${.CURDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/right -L leapseconds ${TDATA}

.PHONY:	posix_right
posix_right: posix_only other_two

.PHONY:	right_posix
right_posix: right_only other_two

.if ${MKUNPRIVED} == "no"
TOOL_PAX.unpriv=-pe
.else
TOOL_PAX.unpriv=
.endif

.if ${MKSHARE} != "no"
afterinstall: ${DATA} ${REDO} ${TABDATA}
	${_MKMSG_CREATE} ${POSIXRULES}
	mkdir -p ${TZBUILDDIR}
	cd ${.CURDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -p ${POSIXRULES}
	cd ${TZBUILDDIR} && \
	    find . -type f -print | xargs ${TOOL_STAT} -qf '%d,%i %N' | sort \
	| while read devino tzfile; do \
		destfile=${DESTDIR}${TZDIR}/$${tzfile#./}; \
		destdir=$$(dirname $${destfile}); \
		if [ ! -d "$$destdir" ]; then \
			${_MKSHMSG_INSTALL} $$destdir; \
			${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} \
			$$destdir; \
			${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} $$destdir; \
		fi; \
		if [ "$$devino" = "$$lastdevino" ]; then \
			if  ldevino=$$(${TOOL_STAT} -qf '%d %i' $$lastfile) && \
			    tdevino=$$(${TOOL_STAT} -qf '%d %i' $$destfile) && \
			    [ "$$ldevino" = "$$tdevino" ]; then \
				continue; \
			fi; \
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
			${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
		else \
			lastdevino=$$devino; \
			lastfile=$$destfile; \
			cmp -s $$tzfile $$destfile >/dev/null 2>&1 && continue;\
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
			${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
		fi; \
	done
	for f in ${TABDATA}; do \
		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
			${.CURDIR}/$$f ${DESTDIR}${TZDIR}; \
	done
.else	# ${MKSHARE} == "no"
afterinstall:
.endif	# ${MKSHARE} == "no"

clean:
	-rm -rf ${TZBUILDDIR}

.include <bsd.prog.mk>
@


1.47
log
@Merge tzdata2014f.

The following new time zones are added:
    Asia/Chita Asia/Srednekolymsk
The following new file is installed:
    zone1970.tab
The following existing file is now installed, whereas we previously
did not install it:
    leapseconds
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.46 2013/12/26 20:19:17 apb Exp $
@


1.46
log
@Change comments and variables to reduce differences with upstream.
No change in the installed files.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.45 2013/12/26 17:09:39 apb Exp $
d54 3
a56 2
TABDATA=	iso3166.tab zone.tab
DATA=		$(YDATA) $(NDATA) leapseconds # yearistype.sh
@


1.46.2.1
log
@Rebase.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.47 2014/08/06 19:18:05 apb Exp $
d54 2
a55 3
ZONETABLES=	zone1970.tab zone.tab
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
DATA=		$(YDATA) $(NDATA) $(TABDATA) # yearistype.sh
@


1.45
log
@Merge tzdata2013i.  We previously has tzdata2013d plus part of
tzdata2013e.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.44 2013/03/06 17:32:51 christos Exp $
a4 5
# Change the line below for your time zone (after finding the zone you want in
# the time zone files, or adding it to a time zone file).
# Alternately, if you discover you've got the wrong time zone, you can just
#	zic -l rightzone

d15 5
d21 1
a21 1
POSIXRULES=	US/Pacific
d23 2
d32 1
a32 1
# 	REDO=		posix_only
d49 4
a52 4
YDATA=		africa antarctica asia australasia \
		europe northamerica southamerica pacificnew etcetera factory \
		backward
NDATA=		systemv
@


1.44
log
@- create the directories if missing
- use $() instead of ``
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43 2009/04/10 16:16:12 apb Exp $
d14 4
d51 1
a51 2
SDATA=		solar87 solar88 solar89
TDATA=		$(YDATA) $(NDATA) $(SDATA)
d53 1
a53 2
DATA=		$(YDATA) $(NDATA) $(SDATA) leapseconds # yearistype.sh
USNO=		usno1988 usno1989
@


1.43
log
@Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links.  They have no effect except when using a
metalog, in which case the information is added to the metalog.  In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg.  This should fix PR 24457 and PR 41155.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.42 2007/11/08 20:14:07 drochner Exp $
d100 7
d108 2
a109 2
			if  ldevino=`${TOOL_STAT} -qf '%d %i' $$lastfile` && \
			    tdevino=`${TOOL_STAT} -qf '%d %i' $$destfile` && \
@


1.43.18.1
log
@Apply patch (requested by apb in ticket #1107):

distrib/sets/lists/base/mi				patch
doc/3RDPARTY						patch
share/zoneinfo/Makefile					patch
share/zoneinfo/africa					patch
share/zoneinfo/antarctica				patch
share/zoneinfo/asia					patch
share/zoneinfo/australasia				patch
share/zoneinfo/backward					patch
share/zoneinfo/etcetera					patch
share/zoneinfo/europe					patch
share/zoneinfo/factory					patch
share/zoneinfo/iso3166.tab				patch
share/zoneinfo/leap-seconds.list			patch
share/zoneinfo/northamerica				patch
share/zoneinfo/pacificnew				patch
share/zoneinfo/southamerica				patch
share/zoneinfo/systemv					patch
share/zoneinfo/yearistype.sh				patch
share/zoneinfo/zone.tab					patch
share/zoneinfo/zone1970.tab				patch

	Update timezone database from tzdata2014c to tzdata2014f.
	This adds two new timezones (Asia/Chita and Asia/Srednekolymsk),
	updates many other timezones, and adds two new
	data files in the /usr/share/zoneinfo directory (leapseconds
	and zone1970.dat).
	[apb, ticket #1107]
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43 2009/04/10 16:16:12 apb Exp $
d49 2
a50 3
ZONETABLES=	zone1970.tab zone.tab
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
DATA=		$(YDATA) $(NDATA) $(TABDATA) # yearistype.sh
@


1.43.18.2
log
@Apply patch (requested by mrg in ticket #1467):
Update tzdata to 2017b.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43.8.3 2017/08/10 05:59:06 snj Exp $
d5 4
a8 3
TZDISTDIR=${.CURDIR}

.PATH: ${TZDISTDIR}
a13 4
# (When a POSIX-style environment variable is handled, the rules in the
# template file are used to determine "spring forward" and "fall back" days and
# times; the environment variable itself specifies UT offsets of standard and
# summer time.)
a15 5
# to correct things.
# Use the command
#	make zonenames
# to get a list of the values you can use for POSIXRULES.
# If you want POSIX compatibility, use "America/New_York".
d17 1
a17 1
POSIXRULES=	America/New_York
a18 2
# "Compiled" time zone information is placed in the "TZDIR" directory
# (and subdirectories).
d26 1
a26 1
#	REDO=		posix_only
d41 1
a41 1
YEARISTYPE=	"${HOST_SH} ${TZDISTDIR}/yearistype.sh"
d43 6
a48 5
PRIMARY_YDATA=	africa antarctica asia australasia \
		europe northamerica southamerica
YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
NDATA=		systemv factory
TDATA=		$(YDATA) $(NDATA)
d52 1
d60 1
a60 1
	cd ${TZDISTDIR} && \
d67 1
a67 1
	cd ${TZDISTDIR} && \
d74 1
a74 1
	cd ${TZDISTDIR} && \
d76 1
a76 1
	cd ${TZDISTDIR} && \
d95 1
a95 1
	cd ${TZDISTDIR} && \
a100 7
		destdir=$$(dirname $${destfile}); \
		if [ ! -d "$$destdir" ]; then \
			${_MKSHMSG_INSTALL} $$destdir; \
			${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} \
			$$destdir; \
			${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} $$destdir; \
		fi; \
d102 2
a103 2
			if  ldevino=$$(${TOOL_STAT} -qf '%d %i' $$lastfile) && \
			    tdevino=$$(${TOOL_STAT} -qf '%d %i' $$destfile) && \
d125 1
a125 1
			${TZDISTDIR}/$$f ${DESTDIR}${TZDIR}; \
a126 2
	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
		${TZDISTDIR}/TZDATA_VERSION ${DESTDIR}${TZDIR}/TZDATA_VERSION
@


1.43.18.3
log
@Pull up the following revisions, requested by kre in tickt #1539:

	external/public-domain/tz/dist/CONTRIBUTING	up to 1.1.1.5
	external/public-domain/tz/dist/Makefile 	up to 1.1.1.20
	external/public-domain/tz/dist/NEWS		up to 1.1.1.21
	external/public-domain/tz/dist/README		up to 1.1.1.6
	external/public-domain/tz/dist/TZDATA_VERSION	up to 1.11
	external/public-domain/tz/dist/africa		up to 1.1.1.14
	external/public-domain/tz/dist/antarctica	up to 1.1.1.10
	external/public-domain/tz/dist/asia		up to 1.1.1.19
	external/public-domain/tz/dist/australasia	up to 1.1.1.14
	external/public-domain/tz/dist/backzone 	up to 1.1.1.14
	external/public-domain/tz/dist/calendars	up to 1.1.1.1
	external/public-domain/tz/dist/checktab.awk	up to 1.1.1.9
	external/public-domain/tz/dist/europe		up to 1.1.1.20
	external/public-domain/tz/dist/leap-seconds.list up to 1.1.1.9
	external/public-domain/tz/dist/leapseconds	up to 1.1.1.10
	external/public-domain/tz/dist/northamerica	up to 1.1.1.19
	external/public-domain/tz/dist/southamerica	up to 1.1.1.14
	external/public-domain/tz/dist/theory.html	up to 1.1.1.3
	external/public-domain/tz/dist/version		up to 1.1.1.8
	external/public-domain/tz/dist/ziguard.awk	up to 1.1.1.1
	external/public-domain/tz/dist/zishrink.awk	up to 1.1.1.3
	external/public-domain/tz/dist/zone.tab 	up to 1.1.1.14
	external/public-domain/tz/dist/zone1970.tab	up to 1.1.1.16
		(with external/public-domain/tz/dist/ -> share/zoneinfo/)
	share/zoneinfo/Theory				delete
	doc/3RDPARTY					(patch)
	distrib/sets/lists/base/mi			1.1164


Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv18468

Log Message:
Import tzdata2018d from ftp://ftp.iana.org/tz/releases/tzdata2018d.tar.gz

Summary of changes in tzdata2018d (2018-03-22 07:05:46 -0700):

	In 2018, Palestine starts DST on March 24 (today!), not March 31

	Casey Station in Antarctica changed from +11 to +08 on 2018-03-11
	at 04:00.

	Various adjustments to some historical conversions (several for
	Uruguay (1920 .. 1990), one fpr Enderbury and Kiritimati (1994/5),
	one for Portugal and colonies (1912) and Jamaica and Turks & Caicos
	(pre 1913)).

Summary of changes in tzdata2017c:

	Northern Cyprus switches from +03 to +02/+03 on 2017-10-29.
	Fiji ends DST 2018-01-14, not 2018-01-21.
	Namibia switches from +01/+02 to +02 on 2018-04-01.
	Sudan switches from +03 to +02 on 2017-11-01.
	Tonga likely switches from +13/+14 to +13 on 2017-11-05.
	Turks & Caicos switches from -04 to -05/-04 on 2018-11-04.
	Some corrections to (mostly ancient) historical data.

Summary of changes in tzdata2018c (2018-01-22 23:00:44 -0800):
Summary of changes in tzdata2018b (2018-01-17 23:24:48 -0800):
Summary of changes in tzdata2018a (2018-01-12 22:29:21 -0800):

	2018a and 2018b were (kind of) released, but never announced.
	Some "issues" were found with them that caused the relatively
	quick updates...

	The updates are from the previous version (2017c) to the
	current one (2018c) - that 2018a & 2018b intervened is best
	forgotten... (changes in 2018a that were corrected (2018b) or
	reverted (2018c) are not mentioned).

	Briefly:

	     Sao Tome and Principe (An island nation off west coast of
	     Equatorial Africa) switched from +00 to +01.

	     Brazil's DST will now start on November's first Sunday.


	     Use Debian-style installation locations, instead of 4.3BSD-style.
		(this does not affect NetBSD, we do not use the tzdata Makefile)

	Changes to past and future time stamps

	    Sao Tome and Principe switched from +00 to +01 on 2018-01-01 at
	    01:00.  (Thanks to Steffen Thorsen and Michael Deckers.)

	  Changes to future time stamps

	    Starting in 2018 southern Brazil will begin DST on November's
	    first Sunday instead of October's third Sunday.  (Thanks to
	    Steffen Thorsen.)

	Changes to past time stamps

	    Japanese DST transitions (1948-1951) were Sundays at 00:00, not
	    Saturdays or Sundays at 02:00.  (Thanks to Takayuki Nikai.)

	    A discrepancy of 4 s in timestamps before 1931 in South Sudan has
	    been corrected.  The 'backzone' and 'zone.tab' files did not agree
	    with the 'africa' and 'zone1970.tab' files.  (Problem reported by
	    Michael Deckers.)

	    The abbreviation invented for Bolivia Summer Time (1931-2) is now
	    BST instead of BOST, to be more consistent with the convention
	    used for Latvian Summer Time (1918-9) and for British Summer Time.
@
text
@d1 1
a1 2
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
d3 1
a3 2
# Package name for the code distribution.
PACKAGE=	tzcode
d5 1
a5 2
# Version number for the distribution, overridden in the 'tarballs' rule below.
VERSION=	unknown
d7 1
a7 22
# Email address for bug reports.
BUGEMAIL=	tz@@iana.org

# Choose source data features.  To get new features right away, use:
#	DATAFORM=	vanguard
# To wait a while before using new features, to give downstream users
# time to upgrade zic (the default), use:
#	DATAFORM=	main
# To wait even longer for new features, use:
#	DATAFORM=	rearguard
DATAFORM=		main

# Change the line below for your time zone (after finding the zone you want in
# the time zone files, or adding it to a time zone file).
# Alternately, if you discover you've got the wrong time zone, you can just
#	zic -l rightzone
# to correct things.
# Use the command
#	make zonenames
# to get a list of the values you can use for LOCALTIME.

LOCALTIME=	GMT
d13 1
a13 1
# When a POSIX-style environment variable is handled, the rules in the
d16 1
a16 1
# daylight saving time.
a26 36
# Also see TZDEFRULESTRING below, which takes effect only
# if the time zone files cannot be accessed.


# Installation locations.
#
# The defaults are suitable for Debian, except that if REDO is
# posix_right or right_posix then files that Debian puts under
# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead
# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps,
# respectively.  Problems with the Debian approach are discussed in
# the commentary for the right_posix rule (below).

# Destination directory, which can be used for staging.
# 'make DESTDIR=/stage install' installs under /stage (e.g., to
# /stage/etc/localtime instead of to /etc/localtime).  Files under
# /stage are not intended to work as-is, but can be copied by hand to
# the root directory later.  If DESTDIR is empty, 'make install' does
# not stage, but installs directly into production locations.
DESTDIR =

# Everything is installed into subdirectories of TOPDIR, and used there.
# TOPDIR should be empty (meaning the root directory),
# or a directory name that does not end in "/".
# TOPDIR should be empty or an absolute name unless you're just testing.
TOPDIR =

# The default local time zone is taken from the file TZDEFAULT.
TZDEFAULT = $(TOPDIR)/etc/localtime

# The subdirectory containing installed program and data files, and
# likewise for installed files that can be shared among architectures.
# These should be relative file names.
USRDIR = usr
USRSHAREDIR = $(USRDIR)/share

d29 2
a30 12
# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
TZDIR_BASENAME=	zoneinfo
TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME)

# The "tzselect" and (if you do "make INSTALL") "date" commands go in:
BINDIR = $(TOPDIR)/$(USRDIR)/bin

# The "zdump" command goes in:
ZDUMPDIR = $(BINDIR)

# The "zic" command goes in:
ZICDIR = $(TOPDIR)/$(USRDIR)/sbin
d32 1
a32 2
# Manual pages go in subdirectories of. . .
MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man
d34 2
a35 9
# Library functions are put in an archive in LIBDIR.
LIBDIR = $(TOPDIR)/$(USRDIR)/lib


# Types to try, as an alternative to time_t.  int64_t should be first.
TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t

# If you want only POSIX time, with time values interpreted as
# seconds since the epoch (not counting leap seconds), use
d37 2
a38 2
# below.  If you want only "right" time, with values interpreted
# as seconds since the epoch (counting leap seconds), use
d46 1
a46 33
# below.  POSIX mandates that leap seconds not be counted; for compatibility
# with it, use "posix_only" or "posix_right".  Use POSIX time on systems with
# leap smearing; this can work better than unsmeared "right" time with
# applications that are not leap second aware, and is closer to unsmeared
# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error).

REDO=		posix_right

# To install data in text form that has all the information of the binary data,
# (optionally incorporating leap second information), use
#	TZDATA_TEXT=	tzdata.zi leapseconds
# To install text data without leap second information (e.g., because
# REDO='posix_only'), use
#	TZDATA_TEXT=	tzdata.zi
# To avoid installing text data, use
#	TZDATA_TEXT=

TZDATA_TEXT=	leapseconds tzdata.zi

# For backward-compatibility links for old zone names, use
#	BACKWARD=	backward
# If you also want the link US/Pacific-New, even though it is confusing
# and is planned to be removed from the database eventually, use
#	BACKWARD=	backward pacificnew
# To omit these links, use
#	BACKWARD=

BACKWARD=	backward

# If you want out-of-scope and often-wrong data from the file 'backzone', use
#	PACKRATDATA=	backzone
# To omit this data, use
#	PACKRATDATA=
d48 1
a48 6
PACKRATDATA=

# The name of a locale using the UTF-8 encoding, used during self-tests.
# The tests are skipped if the name does not appear to work on this system.

UTF8_LOCALE=	en_US.utf8
d51 1
a52 309
YEARISTYPE=	./yearistype

# Non-default libraries needed to link.
LDLIBS=

# Add the following to the end of the "CFLAGS=" line as needed to override
# defaults specified in the source code.  "-DFOO" is equivalent to "-DFOO=1".
#  -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
#  -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime
#	formats that generate only the last two digits of year numbers
#  -DEPOCH_LOCAL if the 'time' function returns local time not UT
#  -DEPOCH_OFFSET=N if the 'time' function returns a value N greater
#	than what POSIX specifies, assuming local time is UT.
#	For example, N is 252460800 on AmigaOS.
#  -DHAVE_DECL_ASCTIME_R=0 if <time.h> does not declare asctime_r
#  -DHAVE_DECL_ENVIRON if <unistd.h> declares 'environ'
#  -DHAVE_DIRECT_H if mkdir needs <direct.h> (MS-Windows)
#  -DHAVE_GENERIC=0 if _Generic does not work
#  -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)
#  -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares
#	ctime_r and asctime_r incompatibly with the POSIX standard
#	(Solaris when _POSIX_PTHREAD_SEMANTICS is not defined).
#  -DHAVE_INTTYPES_H if you have a non-C99 compiler with <inttypes.h>
#  -DHAVE_LINK=0 if your system lacks a link function
#  -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
#  -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
#	localtime_rz can make zdump significantly faster, but is nonstandard.
#  -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
#	functions like 'link' or variables like 'tzname' required by POSIX
#  -DHAVE_SNPRINTF=0 if your system lacks the snprintf function
#  -DHAVE_STDBOOL_H if you have a non-C99 compiler with <stdbool.h>
#  -DHAVE_STDINT_H if you have a non-C99 compiler with <stdint.h>
#  -DHAVE_STRFTIME_L if <time.h> declares locale_t and strftime_l
#  -DHAVE_STRDUP=0 if your system lacks the strdup function
#  -DHAVE_STRTOLL=0 if your system lacks the strtoll function
#  -DHAVE_SYMLINK=0 if your system lacks the symlink function
#  -DHAVE_SYS_STAT_H=0 if your compiler lacks a <sys/stat.h>
#  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a <sys/wait.h>
#  -DHAVE_TZSET=0 if your system lacks a tzset function
#  -DHAVE_UNISTD_H=0 if your compiler lacks a <unistd.h>
#  -Dlocale_t=XXX if your system uses XXX instead of locale_t
#  -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers
#	with external linkage, e.g., applications cannot define 'localtime'.
#  -Dssize_t=long on hosts like MS-Windows that lack ssize_t
#  -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has
#	security implications and is not recommended for general use
#  -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires;
#	not needed by the main-program tz code, which is single-threaded.
#	Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
#  -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
#	This is intended for internal use only; it mangles external names.
#  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
#  -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
#	the default is system-supplied, typically "/usr/lib/locale"
#  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
#	DST transitions if the time zone files cannot be accessed
#  -DUNINIT_TRAP if reading uninitialized storage can cause problems
#	other than simply getting garbage data
#  -DUSE_LTZ=0 to build zdump with the system time zone library
#	Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
#  -DZIC_MAX_ABBR_LEN_WO_WARN=3
#	(or some other number) to set the maximum time zone abbreviation length
#	that zic will accept without a warning (the default is 6)
#  $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking
# Select instrumentation via "make GCC_INSTRUMENT='whatever'".
GCC_INSTRUMENT = \
  -fsanitize=undefined -fsanitize-address-use-after-scope \
  -fsanitize-undefined-trap-on-error -fstack-protector
GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
  $(GCC_INSTRUMENT) \
  -Wall -Wextra \
  -Walloc-size-larger-than=100000 -Warray-bounds=2 \
  -Wbad-function-cast -Wcast-align -Wdate-time \
  -Wdeclaration-after-statement -Wdouble-promotion \
  -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \
  -Winit-self -Wjump-misses-init -Wlogical-op \
  -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
  -Wold-style-definition -Woverlength-strings -Wpointer-arith \
  -Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=5 \
  -Wsuggest-attribute=const -Wsuggest-attribute=format \
  -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
  -Wtrampolines -Wundef -Wuninitialized -Wunused \
  -Wvariadic-macros -Wvla -Wwrite-strings \
  -Wno-address -Wno-format-nonliteral -Wno-sign-compare \
  -Wno-type-limits -Wno-unused-parameter
#
# If your system has a "GMT offset" field in its "struct tm"s
# (or if you decide to add such a field in your system's "time.h" file),
# add the name to a define such as
#	-DTM_GMTOFF=tm_gmtoff
# to the end of the "CFLAGS=" line.  If not defined, the code attempts to
# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this.
# Similarly, if your system has a "zone abbreviation" field, define
#	-DTM_ZONE=tm_zone
# and define NO_TM_ZONE to suppress any guessing.  These two fields are not
# required by POSIX, but are widely available on GNU/Linux and BSD systems.
#
# The next batch of options control support for external variables
# exported by tzcode.  In practice these variables are less useful
# than TM_GMTOFF and TM_ZONE.  However, most of them are standardized.
# #
# # To omit or support the external variable "tzname", add one of:
# #	-DHAVE_TZNAME=0
# #	-DHAVE_TZNAME=1
# # to the "CFLAGS=" line.  "tzname" is required by POSIX 1988 and later.
# # If not defined, the code attempts to guess HAVE_TZNAME from other macros.
# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause
# # crashes when combined with some platforms' standard libraries,
# # presumably due to memory allocation issues.
# #
# # To omit or support the external variables "timezone" and "daylight", add
# #	-DUSG_COMPAT=0
# #	-DUSG_COMPAT=1
# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by
# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later.
# # If not defined, the code attempts to guess USG_COMPAT from other macros.
# #
# # To support the external variable "altzone", add
# #	-DALTZONE
# # to the end of the "CFLAGS=" line; although "altzone" appeared in
# # System V Release 3.1 it has not been standardized.
#
# If you want functions that were inspired by early versions of X3J11's work,
# add
#	-DSTD_INSPIRED
# to the end of the "CFLAGS=" line.  This arranges for the functions
# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
# "posix2time", and "time2posix" to be added to the time conversion library.
# "tzsetwall" is like "tzset" except that it arranges for local wall clock
# time (rather than the time specified in the TZ environment variable)
# to be used.
# "offtime" is like "gmtime" except that it accepts a second (long) argument
# that gives an offset to add to the time_t when converting it.
# "timelocal" is equivalent to "mktime".
# "timegm" is like "timelocal" except that it turns a struct tm into
# a time_t using UT (rather than local time as "timelocal" does).
# "timeoff" is like "timegm" except that it accepts a second (long) argument
# that gives an offset to use when converting to a time_t.
# "posix2time" and "time2posix" are described in an included manual page.
# X3J11's work does not describe any of these functions.
# Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0.
# These functions may well disappear in future releases of the time
# conversion package.
#
# If you don't want functions that were inspired by NetBSD, add
#	-DNETBSD_INSPIRED=0
# to the end of the "CFLAGS=" line.  Otherwise, the functions
# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the
# time library, and if STD_INSPIRED is also defined the functions
# "posix2time_z" and "time2posix_z" are added as well.
# The functions ending in "_z" (or "_rz") are like their unsuffixed
# (or suffixed-by-"_r") counterparts, except with an extra first
# argument of opaque type timezone_t that specifies the time zone.
# "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
#
# If you want to allocate state structures in localtime, add
#	-DALL_STATE
# to the end of the "CFLAGS=" line.  Storage is obtained by calling malloc.
#
# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
# out by the National Institute of Standards and Technology
# which claims to test C and Posix conformance.  If you want to pass PCTS, add
#	-DPCTS
# to the end of the "CFLAGS=" line.
#
# If you want strict compliance with XPG4 as of 1994-04-09, add
#	-DXPG4_1994_04_09
# to the end of the "CFLAGS=" line.  This causes "strftime" to always return
# 53 as a week number (rather than 52 or 53) for January days before
# January's first Monday when a "%V" format is used and January 1
# falls on a Friday, Saturday, or Sunday.

CFLAGS=

# Linker flags.  Default to $(LFLAGS) for backwards compatibility
# to release 2012h and earlier.

LDFLAGS=	$(LFLAGS)

# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in
# submake command lines.  The default is no leap seconds.

LEAPSECONDS=

# The zic command and its arguments.

zic=		./zic
ZIC=		$(zic) $(ZFLAGS)

ZFLAGS=

# How to use zic to install tz binary files.

ZIC_INSTALL=	$(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)

# The name of a Posix-compliant 'awk' on your system.
AWK=		awk

# The full path name of a Posix-compliant shell, preferably one that supports
# the Korn shell's 'select' statement as an extension.
# These days, Bash is the most popular.
# It should be OK to set this to /bin/sh, on platforms where /bin/sh
# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
# is typically nicer if it works.
KSHELL=		/bin/bash

# The path where SGML DTDs are kept and the catalog file(s) to use when
# validating.  The default should work on both Debian and Red Hat.
SGML_TOPDIR= /usr
SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
SGML_CATALOG_FILES= \
  $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat

# The name, arguments and environment of a program to validate your web pages.
# See <http://openjade.sourceforge.net/doc/> for a validator, and
# <https://validator.w3.org/source/> for a validation library.
# Set VALIDATE=':' if you do not have such a program.
VALIDATE = nsgmls
VALIDATE_FLAGS = -s -B -wall -wno-unused-param
VALIDATE_ENV = \
  SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \
  SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \
  SP_CHARSET_FIXED=YES \
  SP_ENCODING=UTF-8

# This expensive test requires USE_LTZ.
# To suppress it, define this macro to be empty.
CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives

# SAFE_CHAR is a regular expression that matches a safe character.
# Some parts of this distribution are limited to safe characters;
# others can use any UTF-8 character.
# For now, the safe characters are a safe subset of ASCII.
# The caller must set the shell variable 'sharp' to the character '#',
# since Makefile macros cannot contain '#'.
# TAB_CHAR is a single tab character, in single quotes.
TAB_CHAR=	'	'
SAFE_CHARSET1=	$(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@@'
SAFE_CHARSET2=	'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
SAFE_CHARSET3=	'abcdefghijklmnopqrstuvwxyz{|}~'
SAFE_CHARSET=	$(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
SAFE_CHAR=	'[]'$(SAFE_CHARSET)'-]'

# Non-ASCII non-letters that OK_CHAR allows, as these characters are
# useful in commentary.  XEmacs 21.5.34 displays them correctly,
# presumably because they are Latin-1.
UNUSUAL_OK_CHARSET= °±½¾×

# OK_CHAR matches any character allowed in the distributed files.
# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
# multibyte letters are also allowed so that commentary can contain a
# few safe symbols and people's names and can quote non-English sources.
# Other non-letters are limited to ASCII renderings for the
# convenience of maintainers using XEmacs 21.5.34, which by default
# mishandles Unicode characters U+0100 and greater.
OK_CHAR=	'[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]'

# SAFE_LINE matches a line of safe characters.
# SAFE_SHARP_LINE is similar, except any OK character can follow '#';
# this is so that comments can contain non-ASCII characters.
# OK_LINE matches a line of OK characters.
SAFE_LINE=	'^'$(SAFE_CHAR)'*$$'
SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$'
OK_LINE=	'^'$(OK_CHAR)'*$$'

# Flags to give 'tar' when making a distribution.
# Try to use flags appropriate for GNU tar.
GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name
TARFLAGS=	`if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
		 then echo $(GNUTARFLAGS); \
		 else :; \
		 fi`

# Flags to give 'gzip' when making a distribution.
GZIPFLAGS=	-9n

###############################################################################

#MAKE=		make

cc=		cc
CC=		$(cc) -DTZDIR='"$(TZDIR)"'

AR=		ar

# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib.
RANLIB=		:

TZCOBJS=	zic.o
TZDOBJS=	zdump.o localtime.o asctime.o strftime.o
DATEOBJS=	date.o localtime.o strftime.o asctime.o
LIBSRCS=	localtime.c asctime.c difftime.c
LIBOBJS=	localtime.o asctime.o difftime.o
HEADERS=	tzfile.h private.h
NONLIBSRCS=	zic.c zdump.c
NEWUCBSRCS=	date.c strftime.c
SOURCES=	$(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \
			tzselect.ksh workman.sh
MANS=		newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
			tzfile.5 tzselect.8 zic.8 zdump.8
MANTXTS=	newctime.3.txt newstrftime.3.txt newtzset.3.txt \
			time2posix.3.txt \
			tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
			date.1.txt
COMMON=		calendars CONTRIBUTING LICENSE Makefile \
			NEWS README theory.html version
WEB_PAGES=	tz-art.html tz-how-to.html tz-link.html
DOCS=		$(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
d55 1
a55 1
YDATA=		$(PRIMARY_YDATA) etcetera
d57 1
a57 2
TDATA_TO_CHECK=	$(YDATA) $(NDATA) backward pacificnew
TDATA=		$(YDATA) $(NDATA) $(BACKWARD)
d59 68
a126 385
TABDATA=	iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
LEAP_DEPS=	leapseconds.awk leap-seconds.list
TZDATA_ZI_DEPS=	ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA)
DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA)
DATA=		$(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
			leapseconds yearistype.sh $(ZONETABLES)
AWK_SCRIPTS=	checklinks.awk checktab.awk leapseconds.awk \
			ziguard.awk zishrink.awk
MISC=		$(AWK_SCRIPTS) zoneinfo2tdf.pl
TZS_YEAR=	2050
TZS=		to$(TZS_YEAR).tzs
TZS_NEW=	to$(TZS_YEAR)new.tzs
TZS_DEPS=	$(PRIMARY_YDATA) asctime.c localtime.c \
			private.h tzfile.h zdump.c zic.c
ENCHILADA=	$(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) tzdata.zi

# Consult these files when deciding whether to rebuild the 'version' file.
# This list is not the same as the output of 'git ls-files', since
# .gitignore is not distributed.
VERSION_DEPS= \
		calendars CONTRIBUTING LICENSE Makefile NEWS README \
		africa antarctica asctime.c asia australasia \
		backward backzone \
		checklinks.awk checktab.awk \
		date.1 date.c difftime.c \
		etcetera europe factory iso3166.tab \
		leap-seconds.list leapseconds.awk localtime.c \
		newctime.3 newstrftime.3 newtzset.3 northamerica \
		pacificnew private.h \
		southamerica strftime.c systemv theory.html \
		time2posix.3 tz-art.html tz-how-to.html tz-link.html \
		tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
		workman.sh yearistype.sh \
		zdump.8 zdump.c zic.8 zic.c \
		zone.tab zone1970.tab zoneinfo2tdf.pl

# And for the benefit of csh users on systems that assume the user
# shell should be used to handle commands in Makefiles. . .

SHELL=		/bin/sh

all:		tzselect yearistype zic zdump libtz.a $(TABDATA) \
		  vanguard.zi main.zi rearguard.zi

ALL:		all date $(ENCHILADA)

install:	all $(DATA) $(REDO) $(MANS)
		mkdir -p '$(DESTDIR)$(BINDIR)' \
			'$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \
			'$(DESTDIR)$(LIBDIR)' \
			'$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
			'$(DESTDIR)$(MANDIR)/man8'
		$(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \
			-t '$(DESTDIR)$(TZDEFAULT)'
		cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
		cp tzselect '$(DESTDIR)$(BINDIR)/.'
		cp zdump '$(DESTDIR)$(ZDUMPDIR)/.'
		cp zic '$(DESTDIR)$(ZICDIR)/.'
		cp libtz.a '$(DESTDIR)$(LIBDIR)/.'
		$(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a'
		cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.'
		cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.'
		cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.'

INSTALL:	ALL install date.1
		mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1'
		cp date '$(DESTDIR)$(BINDIR)/.'
		cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.'

version:	$(VERSION_DEPS)
		{ (type git) >/dev/null 2>&1 && \
		  V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
				--abbrev=7 --dirty` || \
		  V='$(VERSION)'; } && \
		printf '%s\n' "$$V" >$@@.out
		mv $@@.out $@@

# These files can be tailored by setting BACKWARD, PACKRATDATA, etc.
vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS)
		$(AWK) -v outfile='$@@' -f ziguard.awk $(TDATA) $(PACKRATDATA) \
		  >$@@.out
		mv $@@.out $@@
tzdata.zi:	$(DATAFORM).zi version
		version=`sed 1q version` && \
		  LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \
		    $(DATAFORM).zi >$@@.out
		mv $@@.out $@@

version.h:	version
		VERSION=`cat version` && printf '%s\n' \
		  'static char const PKGVERSION[]="($(PACKAGE)) ";' \
		  "static char const TZVERSION[]=\"$$VERSION\";" \
		  'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \
		  >$@@.out
		mv $@@.out $@@

zdump:		$(TZDOBJS)
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)

zic:		$(TZCOBJS)
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)

yearistype:	yearistype.sh
		cp yearistype.sh yearistype
		chmod +x yearistype

leapseconds:	$(LEAP_DEPS)
		$(AWK) -f leapseconds.awk leap-seconds.list >$@@.out
		mv $@@.out $@@

# Arguments to pass to submakes of install_data.
# They can be overridden by later submake arguments.
INSTALLARGS = \
 BACKWARD='$(BACKWARD)' \
 DESTDIR='$(DESTDIR)' \
 LEAPSECONDS='$(LEAPSECONDS)' \
 PACKRATDATA='$(PACKRATDATA)' \
 TZDEFAULT='$(TZDEFAULT)' \
 TZDIR='$(TZDIR)' \
 YEARISTYPE='$(YEARISTYPE)' \
 ZIC='$(ZIC)'

# 'make install_data' installs one set of tz binary files.
install_data:	zic leapseconds yearistype tzdata.zi
		$(ZIC_INSTALL) tzdata.zi

posix_only:
		$(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data

right_only:
		$(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \
			install_data

# In earlier versions of this makefile, the other two directories were
# subdirectories of $(TZDIR).  However, this led to configuration errors.
# For example, with posix_right under the earlier scheme,
# TZ='right/Australia/Adelaide' got you localtime with leap seconds,
# but gmtime without leap seconds, which led to problems with applications
# like sendmail that subtract gmtime from localtime.
# Therefore, the other two directories are now siblings of $(TZDIR).
# You must replace all of $(TZDIR) to switch from not using leap seconds
# to using them, or vice versa.
right_posix:	right_only
		rm -fr '$(DESTDIR)$(TZDIR)-leaps'
		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \
		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only

posix_right:	posix_only
		rm -fr '$(DESTDIR)$(TZDIR)-posix'
		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \
		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only

# This obsolescent rule is present for backwards compatibility with
# tz releases 2014g through 2015g.  It should go away eventually.
posix_packrat:
		$(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only

zones:		$(REDO)

# dummy.zd is not a real file; it is mentioned here only so that the
# top-level 'make' does not have a syntax error.
ZDS = dummy.zd
# Rule used only by submakes invoked by the $(TZS_NEW) rule.
# It is separate so that GNU 'make -j' can run instances in parallel.
$(ZDS): zdump
		./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@@ : '\(.*\).zd') >$@@

$(TZS_NEW):	tzdata.zi zdump zic
		rm -fr tzs.dir
		mkdir tzs.dir
		$(zic) -d tzs.dir tzdata.zi
		$(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
		   tzdata.zi | LC_ALL=C sort >$@@.out
		wd=`pwd` && \
		set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \
			| LC_ALL=C sort -t . -k 2,2` && \
		shift && \
		ZDS=$$* && \
		$(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \
		sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@@.out
		rm -fr tzs.dir
		mv $@@.out $@@

# If $(TZS) does not already exist (e.g., old-format tarballs), create it.
# If it exists but 'make check_tzs' fails, a maintainer should inspect the
# failed output and fix the inconsistency, perhaps by running 'make force_tzs'.
$(TZS):
		$(MAKE) force_tzs

force_tzs:	$(TZS_NEW)
		cp $(TZS_NEW) $(TZS)

libtz.a:	$(LIBOBJS)
		rm -f $@@
		$(AR) -rc $@@ $(LIBOBJS)
		$(RANLIB) $@@

date:		$(DATEOBJS)
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)

tzselect:	tzselect.ksh version
		VERSION=`cat version` && sed \
			-e 's|#!/bin/bash|#!$(KSHELL)|g' \
			-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
			-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
			-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
			-e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \
			<$@@.ksh >$@@.out
		chmod +x $@@.out
		mv $@@.out $@@

check:		check_character_set check_white_space check_links \
		  check_name_lengths check_sorted \
		  check_tables check_web check_zishrink check_tzs

check_character_set: $(ENCHILADA)
	test ! '$(UTF8_LOCALE)' || \
	! printf 'A\304\200B\n' | \
	  LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \
		LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \
		sharp='#' && \
		! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
			$(MISC) $(SOURCES) $(WEB_PAGES) \
			CONTRIBUTING LICENSE README \
			version tzdata.zi && \
		! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \
			Makefile && \
		! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
			leapseconds yearistype.sh zone.tab && \
		! grep -Env $(OK_LINE) $(ENCHILADA); \
	}

check_white_space: $(ENCHILADA)
		patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
		! grep -En "$$pat" $(ENCHILADA)
		! grep -n '[[:space:]]$$' \
			$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)

PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
FILE_NAME_COMPONENT_TOO_LONG = \
  $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15}

check_name_lengths: $(TDATA_TO_CHECK) backzone
		! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
			$(TDATA_TO_CHECK) backzone

CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }

check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
		$(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu
		$(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu
		$(AWK) '/^[^#]/ {print $$1}' iso3166.tab | LC_ALL=C sort -cu
		$(AWK) '/^[^#]/ {print $$1}' zone.tab | LC_ALL=C sort -c
		$(AWK) '/^[^#]/ {print substr($$0, 1, 2)}' zone1970.tab | \
		  LC_ALL=C sort -c
		$(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
		  LC_ALL=C sort -cu

check_links:	checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
		$(AWK) -f checklinks.awk $(TDATA_TO_CHECK)
		$(AWK) -f checklinks.awk tzdata.zi

check_tables:	checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
		for tab in $(ZONETABLES); do \
		  $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
		    || exit; \
		done

check_tzs:	$(TZS) $(TZS_NEW)
		diff -u $(TZS) $(TZS_NEW)

# This checks only the HTML 4.01 strict page.
# To check the the other pages, use <https://validator.w3.org/>.
check_web:	tz-how-to.html
		$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html

# Check that zishrink.awk does not alter the data, and that ziguard.awk
# preserves main-format data.
check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \
		  $(DATAFORM).zi tzdata.zi
		for type in posix right; do \
		  mkdir -p time_t.dir/$$type time_t.dir/$$type-t \
		    time_t.dir/$$type-shrunk && \
		  case $$type in \
		    right) leap='-L leapseconds';; \
	            *) leap=;; \
		  esac && \
		  $(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \
		  case $(DATAFORM) in \
		    main) \
		      $(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \
		      $(AWK) '/^Rule/' $(TDATA) | \
			$(ZIC) $$leap -d time_t.dir/$$type-t - \
			  $(PACKRATDATA) && \
		      diff -r time_t.dir/$$type time_t.dir/$$type-t;; \
		  esac && \
		  $(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \
		  diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \
		done
		rm -fr time_t.dir

clean_misc:
		rm -f core *.o *.out \
		  date tzselect version.h zdump zic yearistype libtz.a
clean:		clean_misc
		rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW)

maintainer-clean: clean
		@@echo 'This command is intended for maintainers to use; it'
		@@echo 'deletes files that may need special tools to rebuild.'
		rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.*

names:
		@@echo $(ENCHILADA)

public:		check check_public $(CHECK_TIME_T_ALTERNATIVES) \
		tarballs signatures

date.1.txt:	date.1
newctime.3.txt:	newctime.3
newstrftime.3.txt: newstrftime.3
newtzset.3.txt:	newtzset.3
time2posix.3.txt: time2posix.3
tzfile.5.txt:	tzfile.5
tzselect.8.txt:	tzselect.8
zdump.8.txt:	zdump.8
zic.8.txt:	zic.8

$(MANTXTS):	workman.sh
		LC_ALL=C sh workman.sh `expr $@@ : '\(.*\)\.txt$$'` >$@@.out
		mv $@@.out $@@

# Set the time stamps to those of the git repository, if available,
# and if the files have not changed since then.
# This uses GNU 'touch' syntax 'touch -d@@N FILE',
# where N is the number of seconds since 1970.
# If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
# Also, set the timestamp of each prebuilt file like 'leapseconds'
# to be the maximum of the files it depends on.
set-timestamps.out: $(ENCHILADA)
		rm -f $@@
		if (type git) >/dev/null 2>&1 && \
		   files=`git ls-files $(ENCHILADA)` && \
		   touch -md @@1 test.out; then \
		  rm -f test.out && \
		  for file in $$files; do \
		    if git diff --quiet $$file; then \
		      time=`git log -1 --format='tformat:%ct' $$file` && \
		      touch -cmd @@$$time $$file; \
		    else \
		      echo >&2 "$$file: warning: does not match repository"; \
		    fi || exit; \
		  done; \
		fi
		touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds
		for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \
		  touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
		    exit; \
		done
		touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi
		touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
		touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version
		touch $@@

# The zics below ensure that each data file can stand on its own.
# We also do an all-files run to catch links to links.

check_public:
		$(MAKE) maintainer-clean
		$(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
		mkdir -p public.dir
		for i in $(TDATA_TO_CHECK) tzdata.zi; do \
		  $(zic) -v -d public.dir $$i 2>&1 || exit; \
		done
		$(zic) -v -d public.dir $(TDATA_TO_CHECK)
		rm -fr public.dir

# Check that the code works under various alternative
# implementations of time_t.
check_time_t_alternatives:
		if diff -q Makefile Makefile 2>/dev/null; then \
		  quiet_option='-q'; \
d128 24
a151 116
		  quiet_option=''; \
		fi && \
		wd=`pwd` && \
		zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
		for type in $(TIME_T_ALTERNATIVES); do \
		  mkdir -p time_t.dir/$$type && \
		  $(MAKE) clean_misc && \
		  $(MAKE) TOPDIR="$$wd/time_t.dir/$$type" \
		    CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
		    REDO='$(REDO)' \
		    install && \
		  diff $$quiet_option -r \
		    time_t.dir/int64_t/etc \
		    time_t.dir/$$type/etc && \
		  diff $$quiet_option -r \
		    time_t.dir/int64_t/usr/share \
		    time_t.dir/$$type/usr/share && \
		  case $$type in \
		  int32_t) range=-2147483648,2147483647;; \
		  uint32_t) range=0,4294967296;; \
		  int64_t) continue;; \
		  *u*) range=0,10000000000;; \
		  *) range=-10000000000,10000000000;; \
		  esac && \
		  echo checking $$type zones ... && \
		  time_t.dir/int64_t/usr/bin/zdump -V -t $$range $$zones \
		      >time_t.dir/int64_t.out && \
		  time_t.dir/$$type/usr/bin/zdump -V -t $$range $$zones \
		      >time_t.dir/$$type.out && \
		  diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \
		    || exit; \
		done
		rm -fr time_t.dir

tarballs traditional_tarballs signatures traditional_signatures: version
		VERSION=`cat version` && \
		$(MAKE) VERSION="$$VERSION" $@@_version

# These *_version rules are intended for use if VERSION is set by some
# other means.  Ordinarily these rules are used only by the above
# non-_version rules, which set VERSION on the 'make' command line.
tarballs_version: traditional_tarballs_version tzdb-$(VERSION).tar.lz
traditional_tarballs_version: \
  tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
signatures_version: traditional_signatures_version tzdb-$(VERSION).tar.lz.asc
traditional_signatures_version: \
  tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc \

tzcode$(VERSION).tar.gz: set-timestamps.out
		LC_ALL=C && export LC_ALL && \
		tar $(TARFLAGS) -cf - \
		    $(COMMON) $(DOCS) $(SOURCES) | \
		  gzip $(GZIPFLAGS) >$@@.out
		mv $@@.out $@@

tzdata$(VERSION).tar.gz: set-timestamps.out
		LC_ALL=C && export LC_ALL && \
		tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
		  gzip $(GZIPFLAGS) >$@@.out
		mv $@@.out $@@

tzdb-$(VERSION).tar.lz: set-timestamps.out
		rm -fr tzdb-$(VERSION)
		mkdir tzdb-$(VERSION)
		ln $(ENCHILADA) tzdb-$(VERSION)
		touch -cmr `ls -t tzdb-$(VERSION)/* | sed 1q` tzdb-$(VERSION)
		LC_ALL=C && export LC_ALL && \
		tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 >$@@.out
		mv $@@.out $@@

tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
		gpg --armor --detach-sign $?

tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
		gpg --armor --detach-sign $?

tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
		gpg --armor --detach-sign $?

typecheck:
		$(MAKE) clean
		for i in "long long" unsigned; \
		do \
			$(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
			./zdump -v Europe/Rome ; \
			$(MAKE) clean ; \
		done

zonenames:	tzdata.zi
		@@$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi

asctime.o:	private.h tzfile.h
date.o:		private.h
difftime.o:	private.h
localtime.o:	private.h tzfile.h
strftime.o:	private.h tzfile.h
zdump.o:	version.h
zic.o:		private.h tzfile.h version.h

.KEEP_STATE:

.PHONY: ALL INSTALL all
.PHONY: check check_character_set check_links check_name_lengths
.PHONY: check_public check_sorted check_tables
.PHONY: check_time_t_alternatives check_tzs check_web check_white_space
.PHONY: check_zishrink
.PHONY: clean clean_misc dummy.zd force_tzs
.PHONY: install install_data maintainer-clean names
.PHONY: posix_only posix_packrat posix_right
.PHONY: public right_only right_posix signatures signatures_version
.PHONY: tarballs tarballs_version
.PHONY: traditional_signatures traditional_signatures_version
.PHONY: traditional_tarballs traditional_tarballs_version
.PHONY: typecheck
.PHONY: zonenames zones
.PHONY: $(ZDS)
@


1.43.18.4
log
@Back out all changes to this file accidently included in the pullup of
tickt #1539.
@
text
@d1 2
a2 1
#	$NetBSD$
d4 2
a5 1
.include <bsd.own.mk>
d7 2
a8 1
TZDISTDIR=${.CURDIR}
d10 22
a31 1
.PATH: ${TZDISTDIR}
d37 1
a37 1
# (When a POSIX-style environment variable is handled, the rules in the
d40 1
a40 1
# summer time.)
d51 36
d89 12
a100 2
# Use an absolute path name for TZDIR unless you're just testing the software.
# Note: ${DESTDIR} is prepended to this for the actual copy.
d102 2
a103 1
TZDIR=	/usr/share/zoneinfo
d105 9
a113 2
# If you always want time values interpreted as "seconds since the epoch
# (not counting leap seconds)", use
d115 2
a116 2
# below.  If you always want right time values interpreted as "seconds since
# the epoch" (counting leap seconds)", use
d124 33
a156 1
# below.
d158 6
a163 1
REDO=		posix_only
a165 1
YEARISTYPE=	"${HOST_SH} ${TZDISTDIR}/yearistype.sh"
d167 309
d478 1
a478 1
YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
d480 2
a481 1
TDATA=		$(YDATA) $(NDATA)
d483 385
a867 68
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
DATA=		$(YDATA) $(NDATA) $(TABDATA) # yearistype.sh

TZBUILDDIR=	${.OBJDIR}/builddir

.PHONY:	posix_only
posix_only: ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L /dev/null ${TDATA}

.PHONY:	right_only
right_only: leapseconds ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L leapseconds ${TDATA}

.PHONY:	other_two
other_two: leapseconds ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/posix -L /dev/null ${TDATA}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/right -L leapseconds ${TDATA}

.PHONY:	posix_right
posix_right: posix_only other_two

.PHONY:	right_posix
right_posix: right_only other_two

.if ${MKUNPRIVED} == "no"
TOOL_PAX.unpriv=-pe
.else
TOOL_PAX.unpriv=
.endif

.if ${MKSHARE} != "no"
afterinstall: ${DATA} ${REDO} ${TABDATA}
	${_MKMSG_CREATE} ${POSIXRULES}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -p ${POSIXRULES}
	cd ${TZBUILDDIR} && \
	    find . -type f -print | xargs ${TOOL_STAT} -qf '%d,%i %N' | sort \
	| while read devino tzfile; do \
		destfile=${DESTDIR}${TZDIR}/$${tzfile#./}; \
		destdir=$$(dirname $${destfile}); \
		if [ ! -d "$$destdir" ]; then \
			${_MKSHMSG_INSTALL} $$destdir; \
			${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} \
			$$destdir; \
			${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} $$destdir; \
		fi; \
		if [ "$$devino" = "$$lastdevino" ]; then \
			if  ldevino=$$(${TOOL_STAT} -qf '%d %i' $$lastfile) && \
			    tdevino=$$(${TOOL_STAT} -qf '%d %i' $$destfile) && \
			    [ "$$ldevino" = "$$tdevino" ]; then \
				continue; \
			fi; \
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
			${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
d869 116
a984 24
			lastdevino=$$devino; \
			lastfile=$$destfile; \
			cmp -s $$tzfile $$destfile >/dev/null 2>&1 && continue;\
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
			${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
		fi; \
	done
	for f in ${TABDATA}; do \
		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
			${TZDISTDIR}/$$f ${DESTDIR}${TZDIR}; \
	done
	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
		${TZDISTDIR}/TZDATA_VERSION ${DESTDIR}${TZDIR}/TZDATA_VERSION
.else	# ${MKSHARE} == "no"
afterinstall:
.endif	# ${MKSHARE} == "no"

clean:
	-rm -rf ${TZBUILDDIR}

.include <bsd.prog.mk>
@


1.43.14.1
log
@Apply patch (requested by apb in ticket #1107):

distrib/sets/lists/base/mi				patch
doc/3RDPARTY						patch
share/zoneinfo/Makefile					patch
share/zoneinfo/africa					patch
share/zoneinfo/antarctica				patch
share/zoneinfo/asia					patch
share/zoneinfo/australasia				patch
share/zoneinfo/backward					patch
share/zoneinfo/etcetera					patch
share/zoneinfo/europe					patch
share/zoneinfo/factory					patch
share/zoneinfo/iso3166.tab				patch
share/zoneinfo/leap-seconds.list			patch
share/zoneinfo/northamerica				patch
share/zoneinfo/pacificnew				patch
share/zoneinfo/southamerica				patch
share/zoneinfo/systemv					patch
share/zoneinfo/yearistype.sh				patch
share/zoneinfo/zone.tab					patch
share/zoneinfo/zone1970.tab				patch

	Update timezone database from tzdata2014c to tzdata2014f.
	This adds two new timezones (Asia/Chita and Asia/Srednekolymsk),
	updates many other timezones, and adds two new
	data files in the /usr/share/zoneinfo directory (leapseconds
	and zone1970.dat).
	[apb, ticket #1107]
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43 2009/04/10 16:16:12 apb Exp $
d49 2
a50 3
ZONETABLES=	zone1970.tab zone.tab
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
DATA=		$(YDATA) $(NDATA) $(TABDATA) # yearistype.sh
@


1.43.14.2
log
@Apply patch (requested by mrg in ticket #1467):
Update tzdata to 2017b.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43.8.3 2017/08/10 05:59:06 snj Exp $
d5 4
a8 3
TZDISTDIR=${.CURDIR}

.PATH: ${TZDISTDIR}
a13 4
# (When a POSIX-style environment variable is handled, the rules in the
# template file are used to determine "spring forward" and "fall back" days and
# times; the environment variable itself specifies UT offsets of standard and
# summer time.)
a15 5
# to correct things.
# Use the command
#	make zonenames
# to get a list of the values you can use for POSIXRULES.
# If you want POSIX compatibility, use "America/New_York".
d17 1
a17 1
POSIXRULES=	America/New_York
a18 2
# "Compiled" time zone information is placed in the "TZDIR" directory
# (and subdirectories).
d26 1
a26 1
#	REDO=		posix_only
d41 1
a41 1
YEARISTYPE=	"${HOST_SH} ${TZDISTDIR}/yearistype.sh"
d43 6
a48 5
PRIMARY_YDATA=	africa antarctica asia australasia \
		europe northamerica southamerica
YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
NDATA=		systemv factory
TDATA=		$(YDATA) $(NDATA)
d52 1
d60 1
a60 1
	cd ${TZDISTDIR} && \
d67 1
a67 1
	cd ${TZDISTDIR} && \
d74 1
a74 1
	cd ${TZDISTDIR} && \
d76 1
a76 1
	cd ${TZDISTDIR} && \
d95 1
a95 1
	cd ${TZDISTDIR} && \
a100 7
		destdir=$$(dirname $${destfile}); \
		if [ ! -d "$$destdir" ]; then \
			${_MKSHMSG_INSTALL} $$destdir; \
			${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} \
			$$destdir; \
			${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} $$destdir; \
		fi; \
d102 2
a103 2
			if  ldevino=$$(${TOOL_STAT} -qf '%d %i' $$lastfile) && \
			    tdevino=$$(${TOOL_STAT} -qf '%d %i' $$destfile) && \
d125 1
a125 1
			${TZDISTDIR}/$$f ${DESTDIR}${TZDIR}; \
a126 2
	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
		${TZDISTDIR}/TZDATA_VERSION ${DESTDIR}${TZDIR}/TZDATA_VERSION
@


1.43.14.3
log
@Pull up the following revisions, requested by kre in tickt #1539:

	external/public-domain/tz/dist/CONTRIBUTING	up to 1.1.1.5
	external/public-domain/tz/dist/Makefile 	up to 1.1.1.20
	external/public-domain/tz/dist/NEWS		up to 1.1.1.21
	external/public-domain/tz/dist/README		up to 1.1.1.6
	external/public-domain/tz/dist/TZDATA_VERSION	up to 1.11
	external/public-domain/tz/dist/africa		up to 1.1.1.14
	external/public-domain/tz/dist/antarctica	up to 1.1.1.10
	external/public-domain/tz/dist/asia		up to 1.1.1.19
	external/public-domain/tz/dist/australasia	up to 1.1.1.14
	external/public-domain/tz/dist/backzone 	up to 1.1.1.14
	external/public-domain/tz/dist/calendars	up to 1.1.1.1
	external/public-domain/tz/dist/checktab.awk	up to 1.1.1.9
	external/public-domain/tz/dist/europe		up to 1.1.1.20
	external/public-domain/tz/dist/leap-seconds.list up to 1.1.1.9
	external/public-domain/tz/dist/leapseconds	up to 1.1.1.10
	external/public-domain/tz/dist/northamerica	up to 1.1.1.19
	external/public-domain/tz/dist/southamerica	up to 1.1.1.14
	external/public-domain/tz/dist/theory.html	up to 1.1.1.3
	external/public-domain/tz/dist/version		up to 1.1.1.8
	external/public-domain/tz/dist/ziguard.awk	up to 1.1.1.1
	external/public-domain/tz/dist/zishrink.awk	up to 1.1.1.3
	external/public-domain/tz/dist/zone.tab 	up to 1.1.1.14
	external/public-domain/tz/dist/zone1970.tab	up to 1.1.1.16
		(with external/public-domain/tz/dist/ -> share/zoneinfo/)
	share/zoneinfo/Theory				delete
	doc/3RDPARTY					(patch)
	distrib/sets/lists/base/mi			1.1164


Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv18468

Log Message:
Import tzdata2018d from ftp://ftp.iana.org/tz/releases/tzdata2018d.tar.gz

Summary of changes in tzdata2018d (2018-03-22 07:05:46 -0700):

	In 2018, Palestine starts DST on March 24 (today!), not March 31

	Casey Station in Antarctica changed from +11 to +08 on 2018-03-11
	at 04:00.

	Various adjustments to some historical conversions (several for
	Uruguay (1920 .. 1990), one fpr Enderbury and Kiritimati (1994/5),
	one for Portugal and colonies (1912) and Jamaica and Turks & Caicos
	(pre 1913)).

Summary of changes in tzdata2017c:

	Northern Cyprus switches from +03 to +02/+03 on 2017-10-29.
	Fiji ends DST 2018-01-14, not 2018-01-21.
	Namibia switches from +01/+02 to +02 on 2018-04-01.
	Sudan switches from +03 to +02 on 2017-11-01.
	Tonga likely switches from +13/+14 to +13 on 2017-11-05.
	Turks & Caicos switches from -04 to -05/-04 on 2018-11-04.
	Some corrections to (mostly ancient) historical data.

Summary of changes in tzdata2018c (2018-01-22 23:00:44 -0800):
Summary of changes in tzdata2018b (2018-01-17 23:24:48 -0800):
Summary of changes in tzdata2018a (2018-01-12 22:29:21 -0800):

	2018a and 2018b were (kind of) released, but never announced.
	Some "issues" were found with them that caused the relatively
	quick updates...

	The updates are from the previous version (2017c) to the
	current one (2018c) - that 2018a & 2018b intervened is best
	forgotten... (changes in 2018a that were corrected (2018b) or
	reverted (2018c) are not mentioned).

	Briefly:

	     Sao Tome and Principe (An island nation off west coast of
	     Equatorial Africa) switched from +00 to +01.

	     Brazil's DST will now start on November's first Sunday.


	     Use Debian-style installation locations, instead of 4.3BSD-style.
		(this does not affect NetBSD, we do not use the tzdata Makefile)

	Changes to past and future time stamps

	    Sao Tome and Principe switched from +00 to +01 on 2018-01-01 at
	    01:00.  (Thanks to Steffen Thorsen and Michael Deckers.)

	  Changes to future time stamps

	    Starting in 2018 southern Brazil will begin DST on November's
	    first Sunday instead of October's third Sunday.  (Thanks to
	    Steffen Thorsen.)

	Changes to past time stamps

	    Japanese DST transitions (1948-1951) were Sundays at 00:00, not
	    Saturdays or Sundays at 02:00.  (Thanks to Takayuki Nikai.)

	    A discrepancy of 4 s in timestamps before 1931 in South Sudan has
	    been corrected.  The 'backzone' and 'zone.tab' files did not agree
	    with the 'africa' and 'zone1970.tab' files.  (Problem reported by
	    Michael Deckers.)

	    The abbreviation invented for Bolivia Summer Time (1931-2) is now
	    BST instead of BOST, to be more consistent with the convention
	    used for Latvian Summer Time (1918-9) and for British Summer Time.
@
text
@d1 1
a1 2
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
d3 1
a3 2
# Package name for the code distribution.
PACKAGE=	tzcode
d5 1
a5 2
# Version number for the distribution, overridden in the 'tarballs' rule below.
VERSION=	unknown
d7 1
a7 22
# Email address for bug reports.
BUGEMAIL=	tz@@iana.org

# Choose source data features.  To get new features right away, use:
#	DATAFORM=	vanguard
# To wait a while before using new features, to give downstream users
# time to upgrade zic (the default), use:
#	DATAFORM=	main
# To wait even longer for new features, use:
#	DATAFORM=	rearguard
DATAFORM=		main

# Change the line below for your time zone (after finding the zone you want in
# the time zone files, or adding it to a time zone file).
# Alternately, if you discover you've got the wrong time zone, you can just
#	zic -l rightzone
# to correct things.
# Use the command
#	make zonenames
# to get a list of the values you can use for LOCALTIME.

LOCALTIME=	GMT
d13 1
a13 1
# When a POSIX-style environment variable is handled, the rules in the
d16 1
a16 1
# daylight saving time.
a26 36
# Also see TZDEFRULESTRING below, which takes effect only
# if the time zone files cannot be accessed.


# Installation locations.
#
# The defaults are suitable for Debian, except that if REDO is
# posix_right or right_posix then files that Debian puts under
# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead
# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps,
# respectively.  Problems with the Debian approach are discussed in
# the commentary for the right_posix rule (below).

# Destination directory, which can be used for staging.
# 'make DESTDIR=/stage install' installs under /stage (e.g., to
# /stage/etc/localtime instead of to /etc/localtime).  Files under
# /stage are not intended to work as-is, but can be copied by hand to
# the root directory later.  If DESTDIR is empty, 'make install' does
# not stage, but installs directly into production locations.
DESTDIR =

# Everything is installed into subdirectories of TOPDIR, and used there.
# TOPDIR should be empty (meaning the root directory),
# or a directory name that does not end in "/".
# TOPDIR should be empty or an absolute name unless you're just testing.
TOPDIR =

# The default local time zone is taken from the file TZDEFAULT.
TZDEFAULT = $(TOPDIR)/etc/localtime

# The subdirectory containing installed program and data files, and
# likewise for installed files that can be shared among architectures.
# These should be relative file names.
USRDIR = usr
USRSHAREDIR = $(USRDIR)/share

d29 2
a30 12
# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
TZDIR_BASENAME=	zoneinfo
TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME)

# The "tzselect" and (if you do "make INSTALL") "date" commands go in:
BINDIR = $(TOPDIR)/$(USRDIR)/bin

# The "zdump" command goes in:
ZDUMPDIR = $(BINDIR)

# The "zic" command goes in:
ZICDIR = $(TOPDIR)/$(USRDIR)/sbin
d32 1
a32 2
# Manual pages go in subdirectories of. . .
MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man
d34 2
a35 9
# Library functions are put in an archive in LIBDIR.
LIBDIR = $(TOPDIR)/$(USRDIR)/lib


# Types to try, as an alternative to time_t.  int64_t should be first.
TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t

# If you want only POSIX time, with time values interpreted as
# seconds since the epoch (not counting leap seconds), use
d37 2
a38 2
# below.  If you want only "right" time, with values interpreted
# as seconds since the epoch (counting leap seconds), use
d46 1
a46 33
# below.  POSIX mandates that leap seconds not be counted; for compatibility
# with it, use "posix_only" or "posix_right".  Use POSIX time on systems with
# leap smearing; this can work better than unsmeared "right" time with
# applications that are not leap second aware, and is closer to unsmeared
# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error).

REDO=		posix_right

# To install data in text form that has all the information of the binary data,
# (optionally incorporating leap second information), use
#	TZDATA_TEXT=	tzdata.zi leapseconds
# To install text data without leap second information (e.g., because
# REDO='posix_only'), use
#	TZDATA_TEXT=	tzdata.zi
# To avoid installing text data, use
#	TZDATA_TEXT=

TZDATA_TEXT=	leapseconds tzdata.zi

# For backward-compatibility links for old zone names, use
#	BACKWARD=	backward
# If you also want the link US/Pacific-New, even though it is confusing
# and is planned to be removed from the database eventually, use
#	BACKWARD=	backward pacificnew
# To omit these links, use
#	BACKWARD=

BACKWARD=	backward

# If you want out-of-scope and often-wrong data from the file 'backzone', use
#	PACKRATDATA=	backzone
# To omit this data, use
#	PACKRATDATA=
d48 1
a48 6
PACKRATDATA=

# The name of a locale using the UTF-8 encoding, used during self-tests.
# The tests are skipped if the name does not appear to work on this system.

UTF8_LOCALE=	en_US.utf8
d51 1
a52 309
YEARISTYPE=	./yearistype

# Non-default libraries needed to link.
LDLIBS=

# Add the following to the end of the "CFLAGS=" line as needed to override
# defaults specified in the source code.  "-DFOO" is equivalent to "-DFOO=1".
#  -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
#  -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime
#	formats that generate only the last two digits of year numbers
#  -DEPOCH_LOCAL if the 'time' function returns local time not UT
#  -DEPOCH_OFFSET=N if the 'time' function returns a value N greater
#	than what POSIX specifies, assuming local time is UT.
#	For example, N is 252460800 on AmigaOS.
#  -DHAVE_DECL_ASCTIME_R=0 if <time.h> does not declare asctime_r
#  -DHAVE_DECL_ENVIRON if <unistd.h> declares 'environ'
#  -DHAVE_DIRECT_H if mkdir needs <direct.h> (MS-Windows)
#  -DHAVE_GENERIC=0 if _Generic does not work
#  -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)
#  -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares
#	ctime_r and asctime_r incompatibly with the POSIX standard
#	(Solaris when _POSIX_PTHREAD_SEMANTICS is not defined).
#  -DHAVE_INTTYPES_H if you have a non-C99 compiler with <inttypes.h>
#  -DHAVE_LINK=0 if your system lacks a link function
#  -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
#  -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
#	localtime_rz can make zdump significantly faster, but is nonstandard.
#  -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
#	functions like 'link' or variables like 'tzname' required by POSIX
#  -DHAVE_SNPRINTF=0 if your system lacks the snprintf function
#  -DHAVE_STDBOOL_H if you have a non-C99 compiler with <stdbool.h>
#  -DHAVE_STDINT_H if you have a non-C99 compiler with <stdint.h>
#  -DHAVE_STRFTIME_L if <time.h> declares locale_t and strftime_l
#  -DHAVE_STRDUP=0 if your system lacks the strdup function
#  -DHAVE_STRTOLL=0 if your system lacks the strtoll function
#  -DHAVE_SYMLINK=0 if your system lacks the symlink function
#  -DHAVE_SYS_STAT_H=0 if your compiler lacks a <sys/stat.h>
#  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a <sys/wait.h>
#  -DHAVE_TZSET=0 if your system lacks a tzset function
#  -DHAVE_UNISTD_H=0 if your compiler lacks a <unistd.h>
#  -Dlocale_t=XXX if your system uses XXX instead of locale_t
#  -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers
#	with external linkage, e.g., applications cannot define 'localtime'.
#  -Dssize_t=long on hosts like MS-Windows that lack ssize_t
#  -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has
#	security implications and is not recommended for general use
#  -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires;
#	not needed by the main-program tz code, which is single-threaded.
#	Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
#  -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
#	This is intended for internal use only; it mangles external names.
#  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
#  -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
#	the default is system-supplied, typically "/usr/lib/locale"
#  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
#	DST transitions if the time zone files cannot be accessed
#  -DUNINIT_TRAP if reading uninitialized storage can cause problems
#	other than simply getting garbage data
#  -DUSE_LTZ=0 to build zdump with the system time zone library
#	Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
#  -DZIC_MAX_ABBR_LEN_WO_WARN=3
#	(or some other number) to set the maximum time zone abbreviation length
#	that zic will accept without a warning (the default is 6)
#  $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking
# Select instrumentation via "make GCC_INSTRUMENT='whatever'".
GCC_INSTRUMENT = \
  -fsanitize=undefined -fsanitize-address-use-after-scope \
  -fsanitize-undefined-trap-on-error -fstack-protector
GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
  $(GCC_INSTRUMENT) \
  -Wall -Wextra \
  -Walloc-size-larger-than=100000 -Warray-bounds=2 \
  -Wbad-function-cast -Wcast-align -Wdate-time \
  -Wdeclaration-after-statement -Wdouble-promotion \
  -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \
  -Winit-self -Wjump-misses-init -Wlogical-op \
  -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
  -Wold-style-definition -Woverlength-strings -Wpointer-arith \
  -Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=5 \
  -Wsuggest-attribute=const -Wsuggest-attribute=format \
  -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
  -Wtrampolines -Wundef -Wuninitialized -Wunused \
  -Wvariadic-macros -Wvla -Wwrite-strings \
  -Wno-address -Wno-format-nonliteral -Wno-sign-compare \
  -Wno-type-limits -Wno-unused-parameter
#
# If your system has a "GMT offset" field in its "struct tm"s
# (or if you decide to add such a field in your system's "time.h" file),
# add the name to a define such as
#	-DTM_GMTOFF=tm_gmtoff
# to the end of the "CFLAGS=" line.  If not defined, the code attempts to
# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this.
# Similarly, if your system has a "zone abbreviation" field, define
#	-DTM_ZONE=tm_zone
# and define NO_TM_ZONE to suppress any guessing.  These two fields are not
# required by POSIX, but are widely available on GNU/Linux and BSD systems.
#
# The next batch of options control support for external variables
# exported by tzcode.  In practice these variables are less useful
# than TM_GMTOFF and TM_ZONE.  However, most of them are standardized.
# #
# # To omit or support the external variable "tzname", add one of:
# #	-DHAVE_TZNAME=0
# #	-DHAVE_TZNAME=1
# # to the "CFLAGS=" line.  "tzname" is required by POSIX 1988 and later.
# # If not defined, the code attempts to guess HAVE_TZNAME from other macros.
# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause
# # crashes when combined with some platforms' standard libraries,
# # presumably due to memory allocation issues.
# #
# # To omit or support the external variables "timezone" and "daylight", add
# #	-DUSG_COMPAT=0
# #	-DUSG_COMPAT=1
# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by
# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later.
# # If not defined, the code attempts to guess USG_COMPAT from other macros.
# #
# # To support the external variable "altzone", add
# #	-DALTZONE
# # to the end of the "CFLAGS=" line; although "altzone" appeared in
# # System V Release 3.1 it has not been standardized.
#
# If you want functions that were inspired by early versions of X3J11's work,
# add
#	-DSTD_INSPIRED
# to the end of the "CFLAGS=" line.  This arranges for the functions
# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
# "posix2time", and "time2posix" to be added to the time conversion library.
# "tzsetwall" is like "tzset" except that it arranges for local wall clock
# time (rather than the time specified in the TZ environment variable)
# to be used.
# "offtime" is like "gmtime" except that it accepts a second (long) argument
# that gives an offset to add to the time_t when converting it.
# "timelocal" is equivalent to "mktime".
# "timegm" is like "timelocal" except that it turns a struct tm into
# a time_t using UT (rather than local time as "timelocal" does).
# "timeoff" is like "timegm" except that it accepts a second (long) argument
# that gives an offset to use when converting to a time_t.
# "posix2time" and "time2posix" are described in an included manual page.
# X3J11's work does not describe any of these functions.
# Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0.
# These functions may well disappear in future releases of the time
# conversion package.
#
# If you don't want functions that were inspired by NetBSD, add
#	-DNETBSD_INSPIRED=0
# to the end of the "CFLAGS=" line.  Otherwise, the functions
# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the
# time library, and if STD_INSPIRED is also defined the functions
# "posix2time_z" and "time2posix_z" are added as well.
# The functions ending in "_z" (or "_rz") are like their unsuffixed
# (or suffixed-by-"_r") counterparts, except with an extra first
# argument of opaque type timezone_t that specifies the time zone.
# "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
#
# If you want to allocate state structures in localtime, add
#	-DALL_STATE
# to the end of the "CFLAGS=" line.  Storage is obtained by calling malloc.
#
# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
# out by the National Institute of Standards and Technology
# which claims to test C and Posix conformance.  If you want to pass PCTS, add
#	-DPCTS
# to the end of the "CFLAGS=" line.
#
# If you want strict compliance with XPG4 as of 1994-04-09, add
#	-DXPG4_1994_04_09
# to the end of the "CFLAGS=" line.  This causes "strftime" to always return
# 53 as a week number (rather than 52 or 53) for January days before
# January's first Monday when a "%V" format is used and January 1
# falls on a Friday, Saturday, or Sunday.

CFLAGS=

# Linker flags.  Default to $(LFLAGS) for backwards compatibility
# to release 2012h and earlier.

LDFLAGS=	$(LFLAGS)

# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in
# submake command lines.  The default is no leap seconds.

LEAPSECONDS=

# The zic command and its arguments.

zic=		./zic
ZIC=		$(zic) $(ZFLAGS)

ZFLAGS=

# How to use zic to install tz binary files.

ZIC_INSTALL=	$(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)

# The name of a Posix-compliant 'awk' on your system.
AWK=		awk

# The full path name of a Posix-compliant shell, preferably one that supports
# the Korn shell's 'select' statement as an extension.
# These days, Bash is the most popular.
# It should be OK to set this to /bin/sh, on platforms where /bin/sh
# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
# is typically nicer if it works.
KSHELL=		/bin/bash

# The path where SGML DTDs are kept and the catalog file(s) to use when
# validating.  The default should work on both Debian and Red Hat.
SGML_TOPDIR= /usr
SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
SGML_CATALOG_FILES= \
  $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat

# The name, arguments and environment of a program to validate your web pages.
# See <http://openjade.sourceforge.net/doc/> for a validator, and
# <https://validator.w3.org/source/> for a validation library.
# Set VALIDATE=':' if you do not have such a program.
VALIDATE = nsgmls
VALIDATE_FLAGS = -s -B -wall -wno-unused-param
VALIDATE_ENV = \
  SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \
  SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \
  SP_CHARSET_FIXED=YES \
  SP_ENCODING=UTF-8

# This expensive test requires USE_LTZ.
# To suppress it, define this macro to be empty.
CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives

# SAFE_CHAR is a regular expression that matches a safe character.
# Some parts of this distribution are limited to safe characters;
# others can use any UTF-8 character.
# For now, the safe characters are a safe subset of ASCII.
# The caller must set the shell variable 'sharp' to the character '#',
# since Makefile macros cannot contain '#'.
# TAB_CHAR is a single tab character, in single quotes.
TAB_CHAR=	'	'
SAFE_CHARSET1=	$(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@@'
SAFE_CHARSET2=	'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
SAFE_CHARSET3=	'abcdefghijklmnopqrstuvwxyz{|}~'
SAFE_CHARSET=	$(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
SAFE_CHAR=	'[]'$(SAFE_CHARSET)'-]'

# Non-ASCII non-letters that OK_CHAR allows, as these characters are
# useful in commentary.  XEmacs 21.5.34 displays them correctly,
# presumably because they are Latin-1.
UNUSUAL_OK_CHARSET= °±½¾×

# OK_CHAR matches any character allowed in the distributed files.
# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
# multibyte letters are also allowed so that commentary can contain a
# few safe symbols and people's names and can quote non-English sources.
# Other non-letters are limited to ASCII renderings for the
# convenience of maintainers using XEmacs 21.5.34, which by default
# mishandles Unicode characters U+0100 and greater.
OK_CHAR=	'[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]'

# SAFE_LINE matches a line of safe characters.
# SAFE_SHARP_LINE is similar, except any OK character can follow '#';
# this is so that comments can contain non-ASCII characters.
# OK_LINE matches a line of OK characters.
SAFE_LINE=	'^'$(SAFE_CHAR)'*$$'
SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$'
OK_LINE=	'^'$(OK_CHAR)'*$$'

# Flags to give 'tar' when making a distribution.
# Try to use flags appropriate for GNU tar.
GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name
TARFLAGS=	`if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
		 then echo $(GNUTARFLAGS); \
		 else :; \
		 fi`

# Flags to give 'gzip' when making a distribution.
GZIPFLAGS=	-9n

###############################################################################

#MAKE=		make

cc=		cc
CC=		$(cc) -DTZDIR='"$(TZDIR)"'

AR=		ar

# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib.
RANLIB=		:

TZCOBJS=	zic.o
TZDOBJS=	zdump.o localtime.o asctime.o strftime.o
DATEOBJS=	date.o localtime.o strftime.o asctime.o
LIBSRCS=	localtime.c asctime.c difftime.c
LIBOBJS=	localtime.o asctime.o difftime.o
HEADERS=	tzfile.h private.h
NONLIBSRCS=	zic.c zdump.c
NEWUCBSRCS=	date.c strftime.c
SOURCES=	$(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \
			tzselect.ksh workman.sh
MANS=		newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
			tzfile.5 tzselect.8 zic.8 zdump.8
MANTXTS=	newctime.3.txt newstrftime.3.txt newtzset.3.txt \
			time2posix.3.txt \
			tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
			date.1.txt
COMMON=		calendars CONTRIBUTING LICENSE Makefile \
			NEWS README theory.html version
WEB_PAGES=	tz-art.html tz-how-to.html tz-link.html
DOCS=		$(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
d55 1
a55 1
YDATA=		$(PRIMARY_YDATA) etcetera
d57 1
a57 2
TDATA_TO_CHECK=	$(YDATA) $(NDATA) backward pacificnew
TDATA=		$(YDATA) $(NDATA) $(BACKWARD)
d59 68
a126 385
TABDATA=	iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
LEAP_DEPS=	leapseconds.awk leap-seconds.list
TZDATA_ZI_DEPS=	ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA)
DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA)
DATA=		$(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
			leapseconds yearistype.sh $(ZONETABLES)
AWK_SCRIPTS=	checklinks.awk checktab.awk leapseconds.awk \
			ziguard.awk zishrink.awk
MISC=		$(AWK_SCRIPTS) zoneinfo2tdf.pl
TZS_YEAR=	2050
TZS=		to$(TZS_YEAR).tzs
TZS_NEW=	to$(TZS_YEAR)new.tzs
TZS_DEPS=	$(PRIMARY_YDATA) asctime.c localtime.c \
			private.h tzfile.h zdump.c zic.c
ENCHILADA=	$(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) tzdata.zi

# Consult these files when deciding whether to rebuild the 'version' file.
# This list is not the same as the output of 'git ls-files', since
# .gitignore is not distributed.
VERSION_DEPS= \
		calendars CONTRIBUTING LICENSE Makefile NEWS README \
		africa antarctica asctime.c asia australasia \
		backward backzone \
		checklinks.awk checktab.awk \
		date.1 date.c difftime.c \
		etcetera europe factory iso3166.tab \
		leap-seconds.list leapseconds.awk localtime.c \
		newctime.3 newstrftime.3 newtzset.3 northamerica \
		pacificnew private.h \
		southamerica strftime.c systemv theory.html \
		time2posix.3 tz-art.html tz-how-to.html tz-link.html \
		tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
		workman.sh yearistype.sh \
		zdump.8 zdump.c zic.8 zic.c \
		zone.tab zone1970.tab zoneinfo2tdf.pl

# And for the benefit of csh users on systems that assume the user
# shell should be used to handle commands in Makefiles. . .

SHELL=		/bin/sh

all:		tzselect yearistype zic zdump libtz.a $(TABDATA) \
		  vanguard.zi main.zi rearguard.zi

ALL:		all date $(ENCHILADA)

install:	all $(DATA) $(REDO) $(MANS)
		mkdir -p '$(DESTDIR)$(BINDIR)' \
			'$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \
			'$(DESTDIR)$(LIBDIR)' \
			'$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
			'$(DESTDIR)$(MANDIR)/man8'
		$(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \
			-t '$(DESTDIR)$(TZDEFAULT)'
		cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
		cp tzselect '$(DESTDIR)$(BINDIR)/.'
		cp zdump '$(DESTDIR)$(ZDUMPDIR)/.'
		cp zic '$(DESTDIR)$(ZICDIR)/.'
		cp libtz.a '$(DESTDIR)$(LIBDIR)/.'
		$(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a'
		cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.'
		cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.'
		cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.'

INSTALL:	ALL install date.1
		mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1'
		cp date '$(DESTDIR)$(BINDIR)/.'
		cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.'

version:	$(VERSION_DEPS)
		{ (type git) >/dev/null 2>&1 && \
		  V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
				--abbrev=7 --dirty` || \
		  V='$(VERSION)'; } && \
		printf '%s\n' "$$V" >$@@.out
		mv $@@.out $@@

# These files can be tailored by setting BACKWARD, PACKRATDATA, etc.
vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS)
		$(AWK) -v outfile='$@@' -f ziguard.awk $(TDATA) $(PACKRATDATA) \
		  >$@@.out
		mv $@@.out $@@
tzdata.zi:	$(DATAFORM).zi version
		version=`sed 1q version` && \
		  LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \
		    $(DATAFORM).zi >$@@.out
		mv $@@.out $@@

version.h:	version
		VERSION=`cat version` && printf '%s\n' \
		  'static char const PKGVERSION[]="($(PACKAGE)) ";' \
		  "static char const TZVERSION[]=\"$$VERSION\";" \
		  'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \
		  >$@@.out
		mv $@@.out $@@

zdump:		$(TZDOBJS)
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)

zic:		$(TZCOBJS)
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)

yearistype:	yearistype.sh
		cp yearistype.sh yearistype
		chmod +x yearistype

leapseconds:	$(LEAP_DEPS)
		$(AWK) -f leapseconds.awk leap-seconds.list >$@@.out
		mv $@@.out $@@

# Arguments to pass to submakes of install_data.
# They can be overridden by later submake arguments.
INSTALLARGS = \
 BACKWARD='$(BACKWARD)' \
 DESTDIR='$(DESTDIR)' \
 LEAPSECONDS='$(LEAPSECONDS)' \
 PACKRATDATA='$(PACKRATDATA)' \
 TZDEFAULT='$(TZDEFAULT)' \
 TZDIR='$(TZDIR)' \
 YEARISTYPE='$(YEARISTYPE)' \
 ZIC='$(ZIC)'

# 'make install_data' installs one set of tz binary files.
install_data:	zic leapseconds yearistype tzdata.zi
		$(ZIC_INSTALL) tzdata.zi

posix_only:
		$(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data

right_only:
		$(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \
			install_data

# In earlier versions of this makefile, the other two directories were
# subdirectories of $(TZDIR).  However, this led to configuration errors.
# For example, with posix_right under the earlier scheme,
# TZ='right/Australia/Adelaide' got you localtime with leap seconds,
# but gmtime without leap seconds, which led to problems with applications
# like sendmail that subtract gmtime from localtime.
# Therefore, the other two directories are now siblings of $(TZDIR).
# You must replace all of $(TZDIR) to switch from not using leap seconds
# to using them, or vice versa.
right_posix:	right_only
		rm -fr '$(DESTDIR)$(TZDIR)-leaps'
		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \
		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only

posix_right:	posix_only
		rm -fr '$(DESTDIR)$(TZDIR)-posix'
		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \
		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only

# This obsolescent rule is present for backwards compatibility with
# tz releases 2014g through 2015g.  It should go away eventually.
posix_packrat:
		$(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only

zones:		$(REDO)

# dummy.zd is not a real file; it is mentioned here only so that the
# top-level 'make' does not have a syntax error.
ZDS = dummy.zd
# Rule used only by submakes invoked by the $(TZS_NEW) rule.
# It is separate so that GNU 'make -j' can run instances in parallel.
$(ZDS): zdump
		./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@@ : '\(.*\).zd') >$@@

$(TZS_NEW):	tzdata.zi zdump zic
		rm -fr tzs.dir
		mkdir tzs.dir
		$(zic) -d tzs.dir tzdata.zi
		$(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
		   tzdata.zi | LC_ALL=C sort >$@@.out
		wd=`pwd` && \
		set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \
			| LC_ALL=C sort -t . -k 2,2` && \
		shift && \
		ZDS=$$* && \
		$(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \
		sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@@.out
		rm -fr tzs.dir
		mv $@@.out $@@

# If $(TZS) does not already exist (e.g., old-format tarballs), create it.
# If it exists but 'make check_tzs' fails, a maintainer should inspect the
# failed output and fix the inconsistency, perhaps by running 'make force_tzs'.
$(TZS):
		$(MAKE) force_tzs

force_tzs:	$(TZS_NEW)
		cp $(TZS_NEW) $(TZS)

libtz.a:	$(LIBOBJS)
		rm -f $@@
		$(AR) -rc $@@ $(LIBOBJS)
		$(RANLIB) $@@

date:		$(DATEOBJS)
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)

tzselect:	tzselect.ksh version
		VERSION=`cat version` && sed \
			-e 's|#!/bin/bash|#!$(KSHELL)|g' \
			-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
			-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
			-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
			-e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \
			<$@@.ksh >$@@.out
		chmod +x $@@.out
		mv $@@.out $@@

check:		check_character_set check_white_space check_links \
		  check_name_lengths check_sorted \
		  check_tables check_web check_zishrink check_tzs

check_character_set: $(ENCHILADA)
	test ! '$(UTF8_LOCALE)' || \
	! printf 'A\304\200B\n' | \
	  LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \
		LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \
		sharp='#' && \
		! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
			$(MISC) $(SOURCES) $(WEB_PAGES) \
			CONTRIBUTING LICENSE README \
			version tzdata.zi && \
		! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \
			Makefile && \
		! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
			leapseconds yearistype.sh zone.tab && \
		! grep -Env $(OK_LINE) $(ENCHILADA); \
	}

check_white_space: $(ENCHILADA)
		patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
		! grep -En "$$pat" $(ENCHILADA)
		! grep -n '[[:space:]]$$' \
			$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)

PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
FILE_NAME_COMPONENT_TOO_LONG = \
  $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15}

check_name_lengths: $(TDATA_TO_CHECK) backzone
		! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
			$(TDATA_TO_CHECK) backzone

CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }

check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
		$(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu
		$(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu
		$(AWK) '/^[^#]/ {print $$1}' iso3166.tab | LC_ALL=C sort -cu
		$(AWK) '/^[^#]/ {print $$1}' zone.tab | LC_ALL=C sort -c
		$(AWK) '/^[^#]/ {print substr($$0, 1, 2)}' zone1970.tab | \
		  LC_ALL=C sort -c
		$(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
		  LC_ALL=C sort -cu

check_links:	checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
		$(AWK) -f checklinks.awk $(TDATA_TO_CHECK)
		$(AWK) -f checklinks.awk tzdata.zi

check_tables:	checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
		for tab in $(ZONETABLES); do \
		  $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
		    || exit; \
		done

check_tzs:	$(TZS) $(TZS_NEW)
		diff -u $(TZS) $(TZS_NEW)

# This checks only the HTML 4.01 strict page.
# To check the the other pages, use <https://validator.w3.org/>.
check_web:	tz-how-to.html
		$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html

# Check that zishrink.awk does not alter the data, and that ziguard.awk
# preserves main-format data.
check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \
		  $(DATAFORM).zi tzdata.zi
		for type in posix right; do \
		  mkdir -p time_t.dir/$$type time_t.dir/$$type-t \
		    time_t.dir/$$type-shrunk && \
		  case $$type in \
		    right) leap='-L leapseconds';; \
	            *) leap=;; \
		  esac && \
		  $(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \
		  case $(DATAFORM) in \
		    main) \
		      $(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \
		      $(AWK) '/^Rule/' $(TDATA) | \
			$(ZIC) $$leap -d time_t.dir/$$type-t - \
			  $(PACKRATDATA) && \
		      diff -r time_t.dir/$$type time_t.dir/$$type-t;; \
		  esac && \
		  $(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \
		  diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \
		done
		rm -fr time_t.dir

clean_misc:
		rm -f core *.o *.out \
		  date tzselect version.h zdump zic yearistype libtz.a
clean:		clean_misc
		rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW)

maintainer-clean: clean
		@@echo 'This command is intended for maintainers to use; it'
		@@echo 'deletes files that may need special tools to rebuild.'
		rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.*

names:
		@@echo $(ENCHILADA)

public:		check check_public $(CHECK_TIME_T_ALTERNATIVES) \
		tarballs signatures

date.1.txt:	date.1
newctime.3.txt:	newctime.3
newstrftime.3.txt: newstrftime.3
newtzset.3.txt:	newtzset.3
time2posix.3.txt: time2posix.3
tzfile.5.txt:	tzfile.5
tzselect.8.txt:	tzselect.8
zdump.8.txt:	zdump.8
zic.8.txt:	zic.8

$(MANTXTS):	workman.sh
		LC_ALL=C sh workman.sh `expr $@@ : '\(.*\)\.txt$$'` >$@@.out
		mv $@@.out $@@

# Set the time stamps to those of the git repository, if available,
# and if the files have not changed since then.
# This uses GNU 'touch' syntax 'touch -d@@N FILE',
# where N is the number of seconds since 1970.
# If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
# Also, set the timestamp of each prebuilt file like 'leapseconds'
# to be the maximum of the files it depends on.
set-timestamps.out: $(ENCHILADA)
		rm -f $@@
		if (type git) >/dev/null 2>&1 && \
		   files=`git ls-files $(ENCHILADA)` && \
		   touch -md @@1 test.out; then \
		  rm -f test.out && \
		  for file in $$files; do \
		    if git diff --quiet $$file; then \
		      time=`git log -1 --format='tformat:%ct' $$file` && \
		      touch -cmd @@$$time $$file; \
		    else \
		      echo >&2 "$$file: warning: does not match repository"; \
		    fi || exit; \
		  done; \
		fi
		touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds
		for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \
		  touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
		    exit; \
		done
		touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi
		touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
		touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version
		touch $@@

# The zics below ensure that each data file can stand on its own.
# We also do an all-files run to catch links to links.

check_public:
		$(MAKE) maintainer-clean
		$(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
		mkdir -p public.dir
		for i in $(TDATA_TO_CHECK) tzdata.zi; do \
		  $(zic) -v -d public.dir $$i 2>&1 || exit; \
		done
		$(zic) -v -d public.dir $(TDATA_TO_CHECK)
		rm -fr public.dir

# Check that the code works under various alternative
# implementations of time_t.
check_time_t_alternatives:
		if diff -q Makefile Makefile 2>/dev/null; then \
		  quiet_option='-q'; \
d128 24
a151 116
		  quiet_option=''; \
		fi && \
		wd=`pwd` && \
		zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
		for type in $(TIME_T_ALTERNATIVES); do \
		  mkdir -p time_t.dir/$$type && \
		  $(MAKE) clean_misc && \
		  $(MAKE) TOPDIR="$$wd/time_t.dir/$$type" \
		    CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
		    REDO='$(REDO)' \
		    install && \
		  diff $$quiet_option -r \
		    time_t.dir/int64_t/etc \
		    time_t.dir/$$type/etc && \
		  diff $$quiet_option -r \
		    time_t.dir/int64_t/usr/share \
		    time_t.dir/$$type/usr/share && \
		  case $$type in \
		  int32_t) range=-2147483648,2147483647;; \
		  uint32_t) range=0,4294967296;; \
		  int64_t) continue;; \
		  *u*) range=0,10000000000;; \
		  *) range=-10000000000,10000000000;; \
		  esac && \
		  echo checking $$type zones ... && \
		  time_t.dir/int64_t/usr/bin/zdump -V -t $$range $$zones \
		      >time_t.dir/int64_t.out && \
		  time_t.dir/$$type/usr/bin/zdump -V -t $$range $$zones \
		      >time_t.dir/$$type.out && \
		  diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \
		    || exit; \
		done
		rm -fr time_t.dir

tarballs traditional_tarballs signatures traditional_signatures: version
		VERSION=`cat version` && \
		$(MAKE) VERSION="$$VERSION" $@@_version

# These *_version rules are intended for use if VERSION is set by some
# other means.  Ordinarily these rules are used only by the above
# non-_version rules, which set VERSION on the 'make' command line.
tarballs_version: traditional_tarballs_version tzdb-$(VERSION).tar.lz
traditional_tarballs_version: \
  tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
signatures_version: traditional_signatures_version tzdb-$(VERSION).tar.lz.asc
traditional_signatures_version: \
  tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc \

tzcode$(VERSION).tar.gz: set-timestamps.out
		LC_ALL=C && export LC_ALL && \
		tar $(TARFLAGS) -cf - \
		    $(COMMON) $(DOCS) $(SOURCES) | \
		  gzip $(GZIPFLAGS) >$@@.out
		mv $@@.out $@@

tzdata$(VERSION).tar.gz: set-timestamps.out
		LC_ALL=C && export LC_ALL && \
		tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
		  gzip $(GZIPFLAGS) >$@@.out
		mv $@@.out $@@

tzdb-$(VERSION).tar.lz: set-timestamps.out
		rm -fr tzdb-$(VERSION)
		mkdir tzdb-$(VERSION)
		ln $(ENCHILADA) tzdb-$(VERSION)
		touch -cmr `ls -t tzdb-$(VERSION)/* | sed 1q` tzdb-$(VERSION)
		LC_ALL=C && export LC_ALL && \
		tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 >$@@.out
		mv $@@.out $@@

tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
		gpg --armor --detach-sign $?

tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
		gpg --armor --detach-sign $?

tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
		gpg --armor --detach-sign $?

typecheck:
		$(MAKE) clean
		for i in "long long" unsigned; \
		do \
			$(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
			./zdump -v Europe/Rome ; \
			$(MAKE) clean ; \
		done

zonenames:	tzdata.zi
		@@$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi

asctime.o:	private.h tzfile.h
date.o:		private.h
difftime.o:	private.h
localtime.o:	private.h tzfile.h
strftime.o:	private.h tzfile.h
zdump.o:	version.h
zic.o:		private.h tzfile.h version.h

.KEEP_STATE:

.PHONY: ALL INSTALL all
.PHONY: check check_character_set check_links check_name_lengths
.PHONY: check_public check_sorted check_tables
.PHONY: check_time_t_alternatives check_tzs check_web check_white_space
.PHONY: check_zishrink
.PHONY: clean clean_misc dummy.zd force_tzs
.PHONY: install install_data maintainer-clean names
.PHONY: posix_only posix_packrat posix_right
.PHONY: public right_only right_posix signatures signatures_version
.PHONY: tarballs tarballs_version
.PHONY: traditional_signatures traditional_signatures_version
.PHONY: traditional_tarballs traditional_tarballs_version
.PHONY: typecheck
.PHONY: zonenames zones
.PHONY: $(ZDS)
@


1.43.14.4
log
@Back out all changes to this file accidently included in the pullup of
tickt #1539.
@
text
@d1 2
a2 1
#	$NetBSD$
d4 2
a5 1
.include <bsd.own.mk>
d7 2
a8 1
TZDISTDIR=${.CURDIR}
d10 22
a31 1
.PATH: ${TZDISTDIR}
d37 1
a37 1
# (When a POSIX-style environment variable is handled, the rules in the
d40 1
a40 1
# summer time.)
d51 36
d89 12
a100 2
# Use an absolute path name for TZDIR unless you're just testing the software.
# Note: ${DESTDIR} is prepended to this for the actual copy.
d102 2
a103 1
TZDIR=	/usr/share/zoneinfo
d105 9
a113 2
# If you always want time values interpreted as "seconds since the epoch
# (not counting leap seconds)", use
d115 2
a116 2
# below.  If you always want right time values interpreted as "seconds since
# the epoch" (counting leap seconds)", use
d124 33
a156 1
# below.
d158 6
a163 1
REDO=		posix_only
a165 1
YEARISTYPE=	"${HOST_SH} ${TZDISTDIR}/yearistype.sh"
d167 309
d478 1
a478 1
YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
d480 2
a481 1
TDATA=		$(YDATA) $(NDATA)
d483 385
a867 68
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
DATA=		$(YDATA) $(NDATA) $(TABDATA) # yearistype.sh

TZBUILDDIR=	${.OBJDIR}/builddir

.PHONY:	posix_only
posix_only: ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L /dev/null ${TDATA}

.PHONY:	right_only
right_only: leapseconds ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L leapseconds ${TDATA}

.PHONY:	other_two
other_two: leapseconds ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/posix -L /dev/null ${TDATA}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/right -L leapseconds ${TDATA}

.PHONY:	posix_right
posix_right: posix_only other_two

.PHONY:	right_posix
right_posix: right_only other_two

.if ${MKUNPRIVED} == "no"
TOOL_PAX.unpriv=-pe
.else
TOOL_PAX.unpriv=
.endif

.if ${MKSHARE} != "no"
afterinstall: ${DATA} ${REDO} ${TABDATA}
	${_MKMSG_CREATE} ${POSIXRULES}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -p ${POSIXRULES}
	cd ${TZBUILDDIR} && \
	    find . -type f -print | xargs ${TOOL_STAT} -qf '%d,%i %N' | sort \
	| while read devino tzfile; do \
		destfile=${DESTDIR}${TZDIR}/$${tzfile#./}; \
		destdir=$$(dirname $${destfile}); \
		if [ ! -d "$$destdir" ]; then \
			${_MKSHMSG_INSTALL} $$destdir; \
			${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} \
			$$destdir; \
			${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} $$destdir; \
		fi; \
		if [ "$$devino" = "$$lastdevino" ]; then \
			if  ldevino=$$(${TOOL_STAT} -qf '%d %i' $$lastfile) && \
			    tdevino=$$(${TOOL_STAT} -qf '%d %i' $$destfile) && \
			    [ "$$ldevino" = "$$tdevino" ]; then \
				continue; \
			fi; \
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
			${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
d869 116
a984 24
			lastdevino=$$devino; \
			lastfile=$$destfile; \
			cmp -s $$tzfile $$destfile >/dev/null 2>&1 && continue;\
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
			${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
		fi; \
	done
	for f in ${TABDATA}; do \
		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
			${TZDISTDIR}/$$f ${DESTDIR}${TZDIR}; \
	done
	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
		${TZDISTDIR}/TZDATA_VERSION ${DESTDIR}${TZDIR}/TZDATA_VERSION
.else	# ${MKSHARE} == "no"
afterinstall:
.endif	# ${MKSHARE} == "no"

clean:
	-rm -rf ${TZBUILDDIR}

.include <bsd.prog.mk>
@


1.43.6.1
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43 2009/04/10 16:16:12 apb Exp $
d5 5
a13 4
# (When a POSIX-style environment variable is handled, the rules in the
# template file are used to determine "spring forward" and "fall back" days and
# times; the environment variable itself specifies UT offsets of standard and
# summer time.)
a15 5
# to correct things.
# Use the command
#	make zonenames
# to get a list of the values you can use for POSIXRULES.
# If you want POSIX compatibility, use "America/New_York".
d17 1
a17 1
POSIXRULES=	America/New_York
a18 2
# "Compiled" time zone information is placed in the "TZDIR" directory
# (and subdirectories).
d26 1
a26 1
#	REDO=		posix_only
d43 6
a48 5
PRIMARY_YDATA=	africa antarctica asia australasia \
		europe northamerica southamerica
YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
NDATA=		systemv factory
TDATA=		$(YDATA) $(NDATA)
d50 2
a51 1
DATA=		$(YDATA) $(NDATA) leapseconds # yearistype.sh
a99 7
		destdir=$$(dirname $${destfile}); \
		if [ ! -d "$$destdir" ]; then \
			${_MKSHMSG_INSTALL} $$destdir; \
			${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} \
			$$destdir; \
			${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} $$destdir; \
		fi; \
d101 2
a102 2
			if  ldevino=$$(${TOOL_STAT} -qf '%d %i' $$lastfile) && \
			    tdevino=$$(${TOOL_STAT} -qf '%d %i' $$destfile) && \
@


1.43.8.1
log
@share/zoneinfo/Makefile				patch
distrib/sets/lists/base/mi			patch

	Remove the the Asia/Riyadh{87,88,89} timezones, and their
	Mideast/* aliases.  These zones were removed upstream in
	tzdata2013i (December 2013).
	[apb, ticket #1065]
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43 2009/04/10 16:16:12 apb Exp $
d47 2
a48 1
TDATA=		$(YDATA) $(NDATA)
d50 1
a50 1
DATA=		$(YDATA) $(NDATA) leapseconds # yearistype.sh
@


1.43.8.2
log
@Apply patch (requested by apb in ticket #1107):

distrib/sets/lists/base/mi                              patch
doc/3RDPARTY                                            patch
share/zoneinfo/Makefile                                 patch
share/zoneinfo/africa                                   patch
share/zoneinfo/antarctica                               patch
share/zoneinfo/asia                                     patch
share/zoneinfo/australasia                              patch
share/zoneinfo/backward                                 patch
share/zoneinfo/etcetera                                 patch
share/zoneinfo/europe                                   patch
share/zoneinfo/factory                                  patch
share/zoneinfo/iso3166.tab                              patch
share/zoneinfo/leap-seconds.list                        patch
share/zoneinfo/northamerica                             patch
share/zoneinfo/pacificnew                               patch
share/zoneinfo/southamerica                             patch
share/zoneinfo/systemv                                  patch
share/zoneinfo/yearistype.sh                            patch
share/zoneinfo/zone.tab                                 patch
share/zoneinfo/zone1970.tab                             patch

        Update timezone database from tzdata2014c to tzdata2014f.
        This adds two new timezones (Asia/Chita and Asia/Srednekolymsk),
        updates many other timezones, and adds two new
        data files in the /usr/share/zoneinfo directory (leapseconds
        and zone1970.dat).
        [apb, ticket #1107]
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43.8.1 2014/05/21 21:25:48 bouyer Exp $
d48 2
a49 3
ZONETABLES=	zone1970.tab zone.tab
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
DATA=		$(YDATA) $(NDATA) $(TABDATA) # yearistype.sh
@


1.43.8.3
log
@Apply patch (requested by mrg in ticket #1467):
Update tzdata to 2017b.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43.8.2 2014/08/15 23:34:17 riz Exp $
d5 4
a8 3
TZDISTDIR=${.CURDIR}

.PATH: ${TZDISTDIR}
a13 4
# (When a POSIX-style environment variable is handled, the rules in the
# template file are used to determine "spring forward" and "fall back" days and
# times; the environment variable itself specifies UT offsets of standard and
# summer time.)
a15 5
# to correct things.
# Use the command
#	make zonenames
# to get a list of the values you can use for POSIXRULES.
# If you want POSIX compatibility, use "America/New_York".
d17 1
a17 1
POSIXRULES=	America/New_York
a18 2
# "Compiled" time zone information is placed in the "TZDIR" directory
# (and subdirectories).
d26 1
a26 1
#	REDO=		posix_only
d41 1
a41 1
YEARISTYPE=	"${HOST_SH} ${TZDISTDIR}/yearistype.sh"
d43 4
a46 4
PRIMARY_YDATA=	africa antarctica asia australasia \
		europe northamerica southamerica
YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
NDATA=		systemv factory
d51 1
d59 1
a59 1
	cd ${TZDISTDIR} && \
d66 1
a66 1
	cd ${TZDISTDIR} && \
d73 1
a73 1
	cd ${TZDISTDIR} && \
d75 1
a75 1
	cd ${TZDISTDIR} && \
d94 1
a94 1
	cd ${TZDISTDIR} && \
a99 7
		destdir=$$(dirname $${destfile}); \
		if [ ! -d "$$destdir" ]; then \
			${_MKSHMSG_INSTALL} $$destdir; \
			${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} \
			$$destdir; \
			${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} $$destdir; \
		fi; \
d101 2
a102 2
			if  ldevino=$$(${TOOL_STAT} -qf '%d %i' $$lastfile) && \
			    tdevino=$$(${TOOL_STAT} -qf '%d %i' $$destfile) && \
d124 1
a124 1
			${TZDISTDIR}/$$f ${DESTDIR}${TZDIR}; \
a125 2
	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
		${TZDISTDIR}/TZDATA_VERSION ${DESTDIR}${TZDIR}/TZDATA_VERSION
@


1.43.8.4
log
@Pull up the following revisions, requested by kre in tickt #1539:

	external/public-domain/tz/dist/CONTRIBUTING	up to 1.1.1.5
	external/public-domain/tz/dist/Makefile 	up to 1.1.1.20
	external/public-domain/tz/dist/NEWS		up to 1.1.1.21
	external/public-domain/tz/dist/README		up to 1.1.1.6
	external/public-domain/tz/dist/TZDATA_VERSION	up to 1.11
	external/public-domain/tz/dist/africa		up to 1.1.1.14
	external/public-domain/tz/dist/antarctica	up to 1.1.1.10
	external/public-domain/tz/dist/asia		up to 1.1.1.19
	external/public-domain/tz/dist/australasia	up to 1.1.1.14
	external/public-domain/tz/dist/backzone 	up to 1.1.1.14
	external/public-domain/tz/dist/calendars	up to 1.1.1.1
	external/public-domain/tz/dist/checktab.awk	up to 1.1.1.9
	external/public-domain/tz/dist/europe		up to 1.1.1.20
	external/public-domain/tz/dist/leap-seconds.list up to 1.1.1.9
	external/public-domain/tz/dist/leapseconds	up to 1.1.1.10
	external/public-domain/tz/dist/northamerica	up to 1.1.1.19
	external/public-domain/tz/dist/southamerica	up to 1.1.1.14
	external/public-domain/tz/dist/theory.html	up to 1.1.1.3
	external/public-domain/tz/dist/version		up to 1.1.1.8
	external/public-domain/tz/dist/ziguard.awk	up to 1.1.1.1
	external/public-domain/tz/dist/zishrink.awk	up to 1.1.1.3
	external/public-domain/tz/dist/zone.tab 	up to 1.1.1.14
	external/public-domain/tz/dist/zone1970.tab	up to 1.1.1.16
		(with external/public-domain/tz/dist/ -> share/zoneinfo/)
	share/zoneinfo/Theory				delete
	doc/3RDPARTY					(patch)
	distrib/sets/lists/base/mi			1.1164


Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv18468

Log Message:
Import tzdata2018d from ftp://ftp.iana.org/tz/releases/tzdata2018d.tar.gz

Summary of changes in tzdata2018d (2018-03-22 07:05:46 -0700):

	In 2018, Palestine starts DST on March 24 (today!), not March 31

	Casey Station in Antarctica changed from +11 to +08 on 2018-03-11
	at 04:00.

	Various adjustments to some historical conversions (several for
	Uruguay (1920 .. 1990), one fpr Enderbury and Kiritimati (1994/5),
	one for Portugal and colonies (1912) and Jamaica and Turks & Caicos
	(pre 1913)).

Summary of changes in tzdata2017c:

	Northern Cyprus switches from +03 to +02/+03 on 2017-10-29.
	Fiji ends DST 2018-01-14, not 2018-01-21.
	Namibia switches from +01/+02 to +02 on 2018-04-01.
	Sudan switches from +03 to +02 on 2017-11-01.
	Tonga likely switches from +13/+14 to +13 on 2017-11-05.
	Turks & Caicos switches from -04 to -05/-04 on 2018-11-04.
	Some corrections to (mostly ancient) historical data.

Summary of changes in tzdata2018c (2018-01-22 23:00:44 -0800):
Summary of changes in tzdata2018b (2018-01-17 23:24:48 -0800):
Summary of changes in tzdata2018a (2018-01-12 22:29:21 -0800):

	2018a and 2018b were (kind of) released, but never announced.
	Some "issues" were found with them that caused the relatively
	quick updates...

	The updates are from the previous version (2017c) to the
	current one (2018c) - that 2018a & 2018b intervened is best
	forgotten... (changes in 2018a that were corrected (2018b) or
	reverted (2018c) are not mentioned).

	Briefly:

	     Sao Tome and Principe (An island nation off west coast of
	     Equatorial Africa) switched from +00 to +01.

	     Brazil's DST will now start on November's first Sunday.


	     Use Debian-style installation locations, instead of 4.3BSD-style.
		(this does not affect NetBSD, we do not use the tzdata Makefile)

	Changes to past and future time stamps

	    Sao Tome and Principe switched from +00 to +01 on 2018-01-01 at
	    01:00.  (Thanks to Steffen Thorsen and Michael Deckers.)

	  Changes to future time stamps

	    Starting in 2018 southern Brazil will begin DST on November's
	    first Sunday instead of October's third Sunday.  (Thanks to
	    Steffen Thorsen.)

	Changes to past time stamps

	    Japanese DST transitions (1948-1951) were Sundays at 00:00, not
	    Saturdays or Sundays at 02:00.  (Thanks to Takayuki Nikai.)

	    A discrepancy of 4 s in timestamps before 1931 in South Sudan has
	    been corrected.  The 'backzone' and 'zone.tab' files did not agree
	    with the 'africa' and 'zone1970.tab' files.  (Problem reported by
	    Michael Deckers.)

	    The abbreviation invented for Bolivia Summer Time (1931-2) is now
	    BST instead of BOST, to be more consistent with the convention
	    used for Latvian Summer Time (1918-9) and for British Summer Time.
@
text
@d1 1
a1 2
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
d3 1
a3 2
# Package name for the code distribution.
PACKAGE=	tzcode
d5 1
a5 2
# Version number for the distribution, overridden in the 'tarballs' rule below.
VERSION=	unknown
d7 1
a7 22
# Email address for bug reports.
BUGEMAIL=	tz@@iana.org

# Choose source data features.  To get new features right away, use:
#	DATAFORM=	vanguard
# To wait a while before using new features, to give downstream users
# time to upgrade zic (the default), use:
#	DATAFORM=	main
# To wait even longer for new features, use:
#	DATAFORM=	rearguard
DATAFORM=		main

# Change the line below for your time zone (after finding the zone you want in
# the time zone files, or adding it to a time zone file).
# Alternately, if you discover you've got the wrong time zone, you can just
#	zic -l rightzone
# to correct things.
# Use the command
#	make zonenames
# to get a list of the values you can use for LOCALTIME.

LOCALTIME=	GMT
d13 1
a13 1
# When a POSIX-style environment variable is handled, the rules in the
d16 1
a16 1
# daylight saving time.
a26 36
# Also see TZDEFRULESTRING below, which takes effect only
# if the time zone files cannot be accessed.


# Installation locations.
#
# The defaults are suitable for Debian, except that if REDO is
# posix_right or right_posix then files that Debian puts under
# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead
# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps,
# respectively.  Problems with the Debian approach are discussed in
# the commentary for the right_posix rule (below).

# Destination directory, which can be used for staging.
# 'make DESTDIR=/stage install' installs under /stage (e.g., to
# /stage/etc/localtime instead of to /etc/localtime).  Files under
# /stage are not intended to work as-is, but can be copied by hand to
# the root directory later.  If DESTDIR is empty, 'make install' does
# not stage, but installs directly into production locations.
DESTDIR =

# Everything is installed into subdirectories of TOPDIR, and used there.
# TOPDIR should be empty (meaning the root directory),
# or a directory name that does not end in "/".
# TOPDIR should be empty or an absolute name unless you're just testing.
TOPDIR =

# The default local time zone is taken from the file TZDEFAULT.
TZDEFAULT = $(TOPDIR)/etc/localtime

# The subdirectory containing installed program and data files, and
# likewise for installed files that can be shared among architectures.
# These should be relative file names.
USRDIR = usr
USRSHAREDIR = $(USRDIR)/share

d29 2
a30 12
# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
TZDIR_BASENAME=	zoneinfo
TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME)

# The "tzselect" and (if you do "make INSTALL") "date" commands go in:
BINDIR = $(TOPDIR)/$(USRDIR)/bin

# The "zdump" command goes in:
ZDUMPDIR = $(BINDIR)

# The "zic" command goes in:
ZICDIR = $(TOPDIR)/$(USRDIR)/sbin
d32 1
a32 2
# Manual pages go in subdirectories of. . .
MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man
d34 2
a35 9
# Library functions are put in an archive in LIBDIR.
LIBDIR = $(TOPDIR)/$(USRDIR)/lib


# Types to try, as an alternative to time_t.  int64_t should be first.
TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t

# If you want only POSIX time, with time values interpreted as
# seconds since the epoch (not counting leap seconds), use
d37 2
a38 2
# below.  If you want only "right" time, with values interpreted
# as seconds since the epoch (counting leap seconds), use
d46 1
a46 33
# below.  POSIX mandates that leap seconds not be counted; for compatibility
# with it, use "posix_only" or "posix_right".  Use POSIX time on systems with
# leap smearing; this can work better than unsmeared "right" time with
# applications that are not leap second aware, and is closer to unsmeared
# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error).

REDO=		posix_right

# To install data in text form that has all the information of the binary data,
# (optionally incorporating leap second information), use
#	TZDATA_TEXT=	tzdata.zi leapseconds
# To install text data without leap second information (e.g., because
# REDO='posix_only'), use
#	TZDATA_TEXT=	tzdata.zi
# To avoid installing text data, use
#	TZDATA_TEXT=

TZDATA_TEXT=	leapseconds tzdata.zi

# For backward-compatibility links for old zone names, use
#	BACKWARD=	backward
# If you also want the link US/Pacific-New, even though it is confusing
# and is planned to be removed from the database eventually, use
#	BACKWARD=	backward pacificnew
# To omit these links, use
#	BACKWARD=

BACKWARD=	backward

# If you want out-of-scope and often-wrong data from the file 'backzone', use
#	PACKRATDATA=	backzone
# To omit this data, use
#	PACKRATDATA=
d48 1
a48 6
PACKRATDATA=

# The name of a locale using the UTF-8 encoding, used during self-tests.
# The tests are skipped if the name does not appear to work on this system.

UTF8_LOCALE=	en_US.utf8
d51 1
a52 309
YEARISTYPE=	./yearistype

# Non-default libraries needed to link.
LDLIBS=

# Add the following to the end of the "CFLAGS=" line as needed to override
# defaults specified in the source code.  "-DFOO" is equivalent to "-DFOO=1".
#  -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
#  -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime
#	formats that generate only the last two digits of year numbers
#  -DEPOCH_LOCAL if the 'time' function returns local time not UT
#  -DEPOCH_OFFSET=N if the 'time' function returns a value N greater
#	than what POSIX specifies, assuming local time is UT.
#	For example, N is 252460800 on AmigaOS.
#  -DHAVE_DECL_ASCTIME_R=0 if <time.h> does not declare asctime_r
#  -DHAVE_DECL_ENVIRON if <unistd.h> declares 'environ'
#  -DHAVE_DIRECT_H if mkdir needs <direct.h> (MS-Windows)
#  -DHAVE_GENERIC=0 if _Generic does not work
#  -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)
#  -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares
#	ctime_r and asctime_r incompatibly with the POSIX standard
#	(Solaris when _POSIX_PTHREAD_SEMANTICS is not defined).
#  -DHAVE_INTTYPES_H if you have a non-C99 compiler with <inttypes.h>
#  -DHAVE_LINK=0 if your system lacks a link function
#  -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
#  -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
#	localtime_rz can make zdump significantly faster, but is nonstandard.
#  -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
#	functions like 'link' or variables like 'tzname' required by POSIX
#  -DHAVE_SNPRINTF=0 if your system lacks the snprintf function
#  -DHAVE_STDBOOL_H if you have a non-C99 compiler with <stdbool.h>
#  -DHAVE_STDINT_H if you have a non-C99 compiler with <stdint.h>
#  -DHAVE_STRFTIME_L if <time.h> declares locale_t and strftime_l
#  -DHAVE_STRDUP=0 if your system lacks the strdup function
#  -DHAVE_STRTOLL=0 if your system lacks the strtoll function
#  -DHAVE_SYMLINK=0 if your system lacks the symlink function
#  -DHAVE_SYS_STAT_H=0 if your compiler lacks a <sys/stat.h>
#  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a <sys/wait.h>
#  -DHAVE_TZSET=0 if your system lacks a tzset function
#  -DHAVE_UNISTD_H=0 if your compiler lacks a <unistd.h>
#  -Dlocale_t=XXX if your system uses XXX instead of locale_t
#  -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers
#	with external linkage, e.g., applications cannot define 'localtime'.
#  -Dssize_t=long on hosts like MS-Windows that lack ssize_t
#  -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has
#	security implications and is not recommended for general use
#  -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires;
#	not needed by the main-program tz code, which is single-threaded.
#	Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
#  -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
#	This is intended for internal use only; it mangles external names.
#  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
#  -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
#	the default is system-supplied, typically "/usr/lib/locale"
#  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
#	DST transitions if the time zone files cannot be accessed
#  -DUNINIT_TRAP if reading uninitialized storage can cause problems
#	other than simply getting garbage data
#  -DUSE_LTZ=0 to build zdump with the system time zone library
#	Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
#  -DZIC_MAX_ABBR_LEN_WO_WARN=3
#	(or some other number) to set the maximum time zone abbreviation length
#	that zic will accept without a warning (the default is 6)
#  $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking
# Select instrumentation via "make GCC_INSTRUMENT='whatever'".
GCC_INSTRUMENT = \
  -fsanitize=undefined -fsanitize-address-use-after-scope \
  -fsanitize-undefined-trap-on-error -fstack-protector
GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
  $(GCC_INSTRUMENT) \
  -Wall -Wextra \
  -Walloc-size-larger-than=100000 -Warray-bounds=2 \
  -Wbad-function-cast -Wcast-align -Wdate-time \
  -Wdeclaration-after-statement -Wdouble-promotion \
  -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \
  -Winit-self -Wjump-misses-init -Wlogical-op \
  -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
  -Wold-style-definition -Woverlength-strings -Wpointer-arith \
  -Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=5 \
  -Wsuggest-attribute=const -Wsuggest-attribute=format \
  -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
  -Wtrampolines -Wundef -Wuninitialized -Wunused \
  -Wvariadic-macros -Wvla -Wwrite-strings \
  -Wno-address -Wno-format-nonliteral -Wno-sign-compare \
  -Wno-type-limits -Wno-unused-parameter
#
# If your system has a "GMT offset" field in its "struct tm"s
# (or if you decide to add such a field in your system's "time.h" file),
# add the name to a define such as
#	-DTM_GMTOFF=tm_gmtoff
# to the end of the "CFLAGS=" line.  If not defined, the code attempts to
# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this.
# Similarly, if your system has a "zone abbreviation" field, define
#	-DTM_ZONE=tm_zone
# and define NO_TM_ZONE to suppress any guessing.  These two fields are not
# required by POSIX, but are widely available on GNU/Linux and BSD systems.
#
# The next batch of options control support for external variables
# exported by tzcode.  In practice these variables are less useful
# than TM_GMTOFF and TM_ZONE.  However, most of them are standardized.
# #
# # To omit or support the external variable "tzname", add one of:
# #	-DHAVE_TZNAME=0
# #	-DHAVE_TZNAME=1
# # to the "CFLAGS=" line.  "tzname" is required by POSIX 1988 and later.
# # If not defined, the code attempts to guess HAVE_TZNAME from other macros.
# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause
# # crashes when combined with some platforms' standard libraries,
# # presumably due to memory allocation issues.
# #
# # To omit or support the external variables "timezone" and "daylight", add
# #	-DUSG_COMPAT=0
# #	-DUSG_COMPAT=1
# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by
# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later.
# # If not defined, the code attempts to guess USG_COMPAT from other macros.
# #
# # To support the external variable "altzone", add
# #	-DALTZONE
# # to the end of the "CFLAGS=" line; although "altzone" appeared in
# # System V Release 3.1 it has not been standardized.
#
# If you want functions that were inspired by early versions of X3J11's work,
# add
#	-DSTD_INSPIRED
# to the end of the "CFLAGS=" line.  This arranges for the functions
# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
# "posix2time", and "time2posix" to be added to the time conversion library.
# "tzsetwall" is like "tzset" except that it arranges for local wall clock
# time (rather than the time specified in the TZ environment variable)
# to be used.
# "offtime" is like "gmtime" except that it accepts a second (long) argument
# that gives an offset to add to the time_t when converting it.
# "timelocal" is equivalent to "mktime".
# "timegm" is like "timelocal" except that it turns a struct tm into
# a time_t using UT (rather than local time as "timelocal" does).
# "timeoff" is like "timegm" except that it accepts a second (long) argument
# that gives an offset to use when converting to a time_t.
# "posix2time" and "time2posix" are described in an included manual page.
# X3J11's work does not describe any of these functions.
# Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0.
# These functions may well disappear in future releases of the time
# conversion package.
#
# If you don't want functions that were inspired by NetBSD, add
#	-DNETBSD_INSPIRED=0
# to the end of the "CFLAGS=" line.  Otherwise, the functions
# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the
# time library, and if STD_INSPIRED is also defined the functions
# "posix2time_z" and "time2posix_z" are added as well.
# The functions ending in "_z" (or "_rz") are like their unsuffixed
# (or suffixed-by-"_r") counterparts, except with an extra first
# argument of opaque type timezone_t that specifies the time zone.
# "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
#
# If you want to allocate state structures in localtime, add
#	-DALL_STATE
# to the end of the "CFLAGS=" line.  Storage is obtained by calling malloc.
#
# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
# out by the National Institute of Standards and Technology
# which claims to test C and Posix conformance.  If you want to pass PCTS, add
#	-DPCTS
# to the end of the "CFLAGS=" line.
#
# If you want strict compliance with XPG4 as of 1994-04-09, add
#	-DXPG4_1994_04_09
# to the end of the "CFLAGS=" line.  This causes "strftime" to always return
# 53 as a week number (rather than 52 or 53) for January days before
# January's first Monday when a "%V" format is used and January 1
# falls on a Friday, Saturday, or Sunday.

CFLAGS=

# Linker flags.  Default to $(LFLAGS) for backwards compatibility
# to release 2012h and earlier.

LDFLAGS=	$(LFLAGS)

# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in
# submake command lines.  The default is no leap seconds.

LEAPSECONDS=

# The zic command and its arguments.

zic=		./zic
ZIC=		$(zic) $(ZFLAGS)

ZFLAGS=

# How to use zic to install tz binary files.

ZIC_INSTALL=	$(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)

# The name of a Posix-compliant 'awk' on your system.
AWK=		awk

# The full path name of a Posix-compliant shell, preferably one that supports
# the Korn shell's 'select' statement as an extension.
# These days, Bash is the most popular.
# It should be OK to set this to /bin/sh, on platforms where /bin/sh
# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
# is typically nicer if it works.
KSHELL=		/bin/bash

# The path where SGML DTDs are kept and the catalog file(s) to use when
# validating.  The default should work on both Debian and Red Hat.
SGML_TOPDIR= /usr
SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
SGML_CATALOG_FILES= \
  $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat

# The name, arguments and environment of a program to validate your web pages.
# See <http://openjade.sourceforge.net/doc/> for a validator, and
# <https://validator.w3.org/source/> for a validation library.
# Set VALIDATE=':' if you do not have such a program.
VALIDATE = nsgmls
VALIDATE_FLAGS = -s -B -wall -wno-unused-param
VALIDATE_ENV = \
  SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \
  SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \
  SP_CHARSET_FIXED=YES \
  SP_ENCODING=UTF-8

# This expensive test requires USE_LTZ.
# To suppress it, define this macro to be empty.
CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives

# SAFE_CHAR is a regular expression that matches a safe character.
# Some parts of this distribution are limited to safe characters;
# others can use any UTF-8 character.
# For now, the safe characters are a safe subset of ASCII.
# The caller must set the shell variable 'sharp' to the character '#',
# since Makefile macros cannot contain '#'.
# TAB_CHAR is a single tab character, in single quotes.
TAB_CHAR=	'	'
SAFE_CHARSET1=	$(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@@'
SAFE_CHARSET2=	'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
SAFE_CHARSET3=	'abcdefghijklmnopqrstuvwxyz{|}~'
SAFE_CHARSET=	$(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
SAFE_CHAR=	'[]'$(SAFE_CHARSET)'-]'

# Non-ASCII non-letters that OK_CHAR allows, as these characters are
# useful in commentary.  XEmacs 21.5.34 displays them correctly,
# presumably because they are Latin-1.
UNUSUAL_OK_CHARSET= °±½¾×

# OK_CHAR matches any character allowed in the distributed files.
# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
# multibyte letters are also allowed so that commentary can contain a
# few safe symbols and people's names and can quote non-English sources.
# Other non-letters are limited to ASCII renderings for the
# convenience of maintainers using XEmacs 21.5.34, which by default
# mishandles Unicode characters U+0100 and greater.
OK_CHAR=	'[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]'

# SAFE_LINE matches a line of safe characters.
# SAFE_SHARP_LINE is similar, except any OK character can follow '#';
# this is so that comments can contain non-ASCII characters.
# OK_LINE matches a line of OK characters.
SAFE_LINE=	'^'$(SAFE_CHAR)'*$$'
SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$'
OK_LINE=	'^'$(OK_CHAR)'*$$'

# Flags to give 'tar' when making a distribution.
# Try to use flags appropriate for GNU tar.
GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name
TARFLAGS=	`if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
		 then echo $(GNUTARFLAGS); \
		 else :; \
		 fi`

# Flags to give 'gzip' when making a distribution.
GZIPFLAGS=	-9n

###############################################################################

#MAKE=		make

cc=		cc
CC=		$(cc) -DTZDIR='"$(TZDIR)"'

AR=		ar

# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib.
RANLIB=		:

TZCOBJS=	zic.o
TZDOBJS=	zdump.o localtime.o asctime.o strftime.o
DATEOBJS=	date.o localtime.o strftime.o asctime.o
LIBSRCS=	localtime.c asctime.c difftime.c
LIBOBJS=	localtime.o asctime.o difftime.o
HEADERS=	tzfile.h private.h
NONLIBSRCS=	zic.c zdump.c
NEWUCBSRCS=	date.c strftime.c
SOURCES=	$(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \
			tzselect.ksh workman.sh
MANS=		newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
			tzfile.5 tzselect.8 zic.8 zdump.8
MANTXTS=	newctime.3.txt newstrftime.3.txt newtzset.3.txt \
			time2posix.3.txt \
			tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
			date.1.txt
COMMON=		calendars CONTRIBUTING LICENSE Makefile \
			NEWS README theory.html version
WEB_PAGES=	tz-art.html tz-how-to.html tz-link.html
DOCS=		$(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
d55 1
a55 1
YDATA=		$(PRIMARY_YDATA) etcetera
d57 1
a57 2
TDATA_TO_CHECK=	$(YDATA) $(NDATA) backward pacificnew
TDATA=		$(YDATA) $(NDATA) $(BACKWARD)
d59 68
a126 385
TABDATA=	iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
LEAP_DEPS=	leapseconds.awk leap-seconds.list
TZDATA_ZI_DEPS=	ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA)
DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA)
DATA=		$(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
			leapseconds yearistype.sh $(ZONETABLES)
AWK_SCRIPTS=	checklinks.awk checktab.awk leapseconds.awk \
			ziguard.awk zishrink.awk
MISC=		$(AWK_SCRIPTS) zoneinfo2tdf.pl
TZS_YEAR=	2050
TZS=		to$(TZS_YEAR).tzs
TZS_NEW=	to$(TZS_YEAR)new.tzs
TZS_DEPS=	$(PRIMARY_YDATA) asctime.c localtime.c \
			private.h tzfile.h zdump.c zic.c
ENCHILADA=	$(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) tzdata.zi

# Consult these files when deciding whether to rebuild the 'version' file.
# This list is not the same as the output of 'git ls-files', since
# .gitignore is not distributed.
VERSION_DEPS= \
		calendars CONTRIBUTING LICENSE Makefile NEWS README \
		africa antarctica asctime.c asia australasia \
		backward backzone \
		checklinks.awk checktab.awk \
		date.1 date.c difftime.c \
		etcetera europe factory iso3166.tab \
		leap-seconds.list leapseconds.awk localtime.c \
		newctime.3 newstrftime.3 newtzset.3 northamerica \
		pacificnew private.h \
		southamerica strftime.c systemv theory.html \
		time2posix.3 tz-art.html tz-how-to.html tz-link.html \
		tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
		workman.sh yearistype.sh \
		zdump.8 zdump.c zic.8 zic.c \
		zone.tab zone1970.tab zoneinfo2tdf.pl

# And for the benefit of csh users on systems that assume the user
# shell should be used to handle commands in Makefiles. . .

SHELL=		/bin/sh

all:		tzselect yearistype zic zdump libtz.a $(TABDATA) \
		  vanguard.zi main.zi rearguard.zi

ALL:		all date $(ENCHILADA)

install:	all $(DATA) $(REDO) $(MANS)
		mkdir -p '$(DESTDIR)$(BINDIR)' \
			'$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \
			'$(DESTDIR)$(LIBDIR)' \
			'$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
			'$(DESTDIR)$(MANDIR)/man8'
		$(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \
			-t '$(DESTDIR)$(TZDEFAULT)'
		cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
		cp tzselect '$(DESTDIR)$(BINDIR)/.'
		cp zdump '$(DESTDIR)$(ZDUMPDIR)/.'
		cp zic '$(DESTDIR)$(ZICDIR)/.'
		cp libtz.a '$(DESTDIR)$(LIBDIR)/.'
		$(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a'
		cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.'
		cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.'
		cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.'

INSTALL:	ALL install date.1
		mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1'
		cp date '$(DESTDIR)$(BINDIR)/.'
		cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.'

version:	$(VERSION_DEPS)
		{ (type git) >/dev/null 2>&1 && \
		  V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
				--abbrev=7 --dirty` || \
		  V='$(VERSION)'; } && \
		printf '%s\n' "$$V" >$@@.out
		mv $@@.out $@@

# These files can be tailored by setting BACKWARD, PACKRATDATA, etc.
vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS)
		$(AWK) -v outfile='$@@' -f ziguard.awk $(TDATA) $(PACKRATDATA) \
		  >$@@.out
		mv $@@.out $@@
tzdata.zi:	$(DATAFORM).zi version
		version=`sed 1q version` && \
		  LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \
		    $(DATAFORM).zi >$@@.out
		mv $@@.out $@@

version.h:	version
		VERSION=`cat version` && printf '%s\n' \
		  'static char const PKGVERSION[]="($(PACKAGE)) ";' \
		  "static char const TZVERSION[]=\"$$VERSION\";" \
		  'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \
		  >$@@.out
		mv $@@.out $@@

zdump:		$(TZDOBJS)
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)

zic:		$(TZCOBJS)
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)

yearistype:	yearistype.sh
		cp yearistype.sh yearistype
		chmod +x yearistype

leapseconds:	$(LEAP_DEPS)
		$(AWK) -f leapseconds.awk leap-seconds.list >$@@.out
		mv $@@.out $@@

# Arguments to pass to submakes of install_data.
# They can be overridden by later submake arguments.
INSTALLARGS = \
 BACKWARD='$(BACKWARD)' \
 DESTDIR='$(DESTDIR)' \
 LEAPSECONDS='$(LEAPSECONDS)' \
 PACKRATDATA='$(PACKRATDATA)' \
 TZDEFAULT='$(TZDEFAULT)' \
 TZDIR='$(TZDIR)' \
 YEARISTYPE='$(YEARISTYPE)' \
 ZIC='$(ZIC)'

# 'make install_data' installs one set of tz binary files.
install_data:	zic leapseconds yearistype tzdata.zi
		$(ZIC_INSTALL) tzdata.zi

posix_only:
		$(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data

right_only:
		$(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \
			install_data

# In earlier versions of this makefile, the other two directories were
# subdirectories of $(TZDIR).  However, this led to configuration errors.
# For example, with posix_right under the earlier scheme,
# TZ='right/Australia/Adelaide' got you localtime with leap seconds,
# but gmtime without leap seconds, which led to problems with applications
# like sendmail that subtract gmtime from localtime.
# Therefore, the other two directories are now siblings of $(TZDIR).
# You must replace all of $(TZDIR) to switch from not using leap seconds
# to using them, or vice versa.
right_posix:	right_only
		rm -fr '$(DESTDIR)$(TZDIR)-leaps'
		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \
		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only

posix_right:	posix_only
		rm -fr '$(DESTDIR)$(TZDIR)-posix'
		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \
		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only

# This obsolescent rule is present for backwards compatibility with
# tz releases 2014g through 2015g.  It should go away eventually.
posix_packrat:
		$(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only

zones:		$(REDO)

# dummy.zd is not a real file; it is mentioned here only so that the
# top-level 'make' does not have a syntax error.
ZDS = dummy.zd
# Rule used only by submakes invoked by the $(TZS_NEW) rule.
# It is separate so that GNU 'make -j' can run instances in parallel.
$(ZDS): zdump
		./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@@ : '\(.*\).zd') >$@@

$(TZS_NEW):	tzdata.zi zdump zic
		rm -fr tzs.dir
		mkdir tzs.dir
		$(zic) -d tzs.dir tzdata.zi
		$(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
		   tzdata.zi | LC_ALL=C sort >$@@.out
		wd=`pwd` && \
		set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \
			| LC_ALL=C sort -t . -k 2,2` && \
		shift && \
		ZDS=$$* && \
		$(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \
		sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@@.out
		rm -fr tzs.dir
		mv $@@.out $@@

# If $(TZS) does not already exist (e.g., old-format tarballs), create it.
# If it exists but 'make check_tzs' fails, a maintainer should inspect the
# failed output and fix the inconsistency, perhaps by running 'make force_tzs'.
$(TZS):
		$(MAKE) force_tzs

force_tzs:	$(TZS_NEW)
		cp $(TZS_NEW) $(TZS)

libtz.a:	$(LIBOBJS)
		rm -f $@@
		$(AR) -rc $@@ $(LIBOBJS)
		$(RANLIB) $@@

date:		$(DATEOBJS)
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)

tzselect:	tzselect.ksh version
		VERSION=`cat version` && sed \
			-e 's|#!/bin/bash|#!$(KSHELL)|g' \
			-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
			-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
			-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
			-e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \
			<$@@.ksh >$@@.out
		chmod +x $@@.out
		mv $@@.out $@@

check:		check_character_set check_white_space check_links \
		  check_name_lengths check_sorted \
		  check_tables check_web check_zishrink check_tzs

check_character_set: $(ENCHILADA)
	test ! '$(UTF8_LOCALE)' || \
	! printf 'A\304\200B\n' | \
	  LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \
		LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \
		sharp='#' && \
		! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
			$(MISC) $(SOURCES) $(WEB_PAGES) \
			CONTRIBUTING LICENSE README \
			version tzdata.zi && \
		! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \
			Makefile && \
		! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
			leapseconds yearistype.sh zone.tab && \
		! grep -Env $(OK_LINE) $(ENCHILADA); \
	}

check_white_space: $(ENCHILADA)
		patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
		! grep -En "$$pat" $(ENCHILADA)
		! grep -n '[[:space:]]$$' \
			$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)

PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
FILE_NAME_COMPONENT_TOO_LONG = \
  $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15}

check_name_lengths: $(TDATA_TO_CHECK) backzone
		! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
			$(TDATA_TO_CHECK) backzone

CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }

check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
		$(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu
		$(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu
		$(AWK) '/^[^#]/ {print $$1}' iso3166.tab | LC_ALL=C sort -cu
		$(AWK) '/^[^#]/ {print $$1}' zone.tab | LC_ALL=C sort -c
		$(AWK) '/^[^#]/ {print substr($$0, 1, 2)}' zone1970.tab | \
		  LC_ALL=C sort -c
		$(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
		  LC_ALL=C sort -cu

check_links:	checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
		$(AWK) -f checklinks.awk $(TDATA_TO_CHECK)
		$(AWK) -f checklinks.awk tzdata.zi

check_tables:	checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
		for tab in $(ZONETABLES); do \
		  $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
		    || exit; \
		done

check_tzs:	$(TZS) $(TZS_NEW)
		diff -u $(TZS) $(TZS_NEW)

# This checks only the HTML 4.01 strict page.
# To check the the other pages, use <https://validator.w3.org/>.
check_web:	tz-how-to.html
		$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html

# Check that zishrink.awk does not alter the data, and that ziguard.awk
# preserves main-format data.
check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \
		  $(DATAFORM).zi tzdata.zi
		for type in posix right; do \
		  mkdir -p time_t.dir/$$type time_t.dir/$$type-t \
		    time_t.dir/$$type-shrunk && \
		  case $$type in \
		    right) leap='-L leapseconds';; \
	            *) leap=;; \
		  esac && \
		  $(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \
		  case $(DATAFORM) in \
		    main) \
		      $(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \
		      $(AWK) '/^Rule/' $(TDATA) | \
			$(ZIC) $$leap -d time_t.dir/$$type-t - \
			  $(PACKRATDATA) && \
		      diff -r time_t.dir/$$type time_t.dir/$$type-t;; \
		  esac && \
		  $(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \
		  diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \
		done
		rm -fr time_t.dir

clean_misc:
		rm -f core *.o *.out \
		  date tzselect version.h zdump zic yearistype libtz.a
clean:		clean_misc
		rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW)

maintainer-clean: clean
		@@echo 'This command is intended for maintainers to use; it'
		@@echo 'deletes files that may need special tools to rebuild.'
		rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.*

names:
		@@echo $(ENCHILADA)

public:		check check_public $(CHECK_TIME_T_ALTERNATIVES) \
		tarballs signatures

date.1.txt:	date.1
newctime.3.txt:	newctime.3
newstrftime.3.txt: newstrftime.3
newtzset.3.txt:	newtzset.3
time2posix.3.txt: time2posix.3
tzfile.5.txt:	tzfile.5
tzselect.8.txt:	tzselect.8
zdump.8.txt:	zdump.8
zic.8.txt:	zic.8

$(MANTXTS):	workman.sh
		LC_ALL=C sh workman.sh `expr $@@ : '\(.*\)\.txt$$'` >$@@.out
		mv $@@.out $@@

# Set the time stamps to those of the git repository, if available,
# and if the files have not changed since then.
# This uses GNU 'touch' syntax 'touch -d@@N FILE',
# where N is the number of seconds since 1970.
# If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
# Also, set the timestamp of each prebuilt file like 'leapseconds'
# to be the maximum of the files it depends on.
set-timestamps.out: $(ENCHILADA)
		rm -f $@@
		if (type git) >/dev/null 2>&1 && \
		   files=`git ls-files $(ENCHILADA)` && \
		   touch -md @@1 test.out; then \
		  rm -f test.out && \
		  for file in $$files; do \
		    if git diff --quiet $$file; then \
		      time=`git log -1 --format='tformat:%ct' $$file` && \
		      touch -cmd @@$$time $$file; \
		    else \
		      echo >&2 "$$file: warning: does not match repository"; \
		    fi || exit; \
		  done; \
		fi
		touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds
		for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \
		  touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
		    exit; \
		done
		touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi
		touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
		touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version
		touch $@@

# The zics below ensure that each data file can stand on its own.
# We also do an all-files run to catch links to links.

check_public:
		$(MAKE) maintainer-clean
		$(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
		mkdir -p public.dir
		for i in $(TDATA_TO_CHECK) tzdata.zi; do \
		  $(zic) -v -d public.dir $$i 2>&1 || exit; \
		done
		$(zic) -v -d public.dir $(TDATA_TO_CHECK)
		rm -fr public.dir

# Check that the code works under various alternative
# implementations of time_t.
check_time_t_alternatives:
		if diff -q Makefile Makefile 2>/dev/null; then \
		  quiet_option='-q'; \
d128 24
a151 116
		  quiet_option=''; \
		fi && \
		wd=`pwd` && \
		zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
		for type in $(TIME_T_ALTERNATIVES); do \
		  mkdir -p time_t.dir/$$type && \
		  $(MAKE) clean_misc && \
		  $(MAKE) TOPDIR="$$wd/time_t.dir/$$type" \
		    CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
		    REDO='$(REDO)' \
		    install && \
		  diff $$quiet_option -r \
		    time_t.dir/int64_t/etc \
		    time_t.dir/$$type/etc && \
		  diff $$quiet_option -r \
		    time_t.dir/int64_t/usr/share \
		    time_t.dir/$$type/usr/share && \
		  case $$type in \
		  int32_t) range=-2147483648,2147483647;; \
		  uint32_t) range=0,4294967296;; \
		  int64_t) continue;; \
		  *u*) range=0,10000000000;; \
		  *) range=-10000000000,10000000000;; \
		  esac && \
		  echo checking $$type zones ... && \
		  time_t.dir/int64_t/usr/bin/zdump -V -t $$range $$zones \
		      >time_t.dir/int64_t.out && \
		  time_t.dir/$$type/usr/bin/zdump -V -t $$range $$zones \
		      >time_t.dir/$$type.out && \
		  diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \
		    || exit; \
		done
		rm -fr time_t.dir

tarballs traditional_tarballs signatures traditional_signatures: version
		VERSION=`cat version` && \
		$(MAKE) VERSION="$$VERSION" $@@_version

# These *_version rules are intended for use if VERSION is set by some
# other means.  Ordinarily these rules are used only by the above
# non-_version rules, which set VERSION on the 'make' command line.
tarballs_version: traditional_tarballs_version tzdb-$(VERSION).tar.lz
traditional_tarballs_version: \
  tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
signatures_version: traditional_signatures_version tzdb-$(VERSION).tar.lz.asc
traditional_signatures_version: \
  tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc \

tzcode$(VERSION).tar.gz: set-timestamps.out
		LC_ALL=C && export LC_ALL && \
		tar $(TARFLAGS) -cf - \
		    $(COMMON) $(DOCS) $(SOURCES) | \
		  gzip $(GZIPFLAGS) >$@@.out
		mv $@@.out $@@

tzdata$(VERSION).tar.gz: set-timestamps.out
		LC_ALL=C && export LC_ALL && \
		tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
		  gzip $(GZIPFLAGS) >$@@.out
		mv $@@.out $@@

tzdb-$(VERSION).tar.lz: set-timestamps.out
		rm -fr tzdb-$(VERSION)
		mkdir tzdb-$(VERSION)
		ln $(ENCHILADA) tzdb-$(VERSION)
		touch -cmr `ls -t tzdb-$(VERSION)/* | sed 1q` tzdb-$(VERSION)
		LC_ALL=C && export LC_ALL && \
		tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 >$@@.out
		mv $@@.out $@@

tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
		gpg --armor --detach-sign $?

tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
		gpg --armor --detach-sign $?

tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
		gpg --armor --detach-sign $?

typecheck:
		$(MAKE) clean
		for i in "long long" unsigned; \
		do \
			$(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
			./zdump -v Europe/Rome ; \
			$(MAKE) clean ; \
		done

zonenames:	tzdata.zi
		@@$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi

asctime.o:	private.h tzfile.h
date.o:		private.h
difftime.o:	private.h
localtime.o:	private.h tzfile.h
strftime.o:	private.h tzfile.h
zdump.o:	version.h
zic.o:		private.h tzfile.h version.h

.KEEP_STATE:

.PHONY: ALL INSTALL all
.PHONY: check check_character_set check_links check_name_lengths
.PHONY: check_public check_sorted check_tables
.PHONY: check_time_t_alternatives check_tzs check_web check_white_space
.PHONY: check_zishrink
.PHONY: clean clean_misc dummy.zd force_tzs
.PHONY: install install_data maintainer-clean names
.PHONY: posix_only posix_packrat posix_right
.PHONY: public right_only right_posix signatures signatures_version
.PHONY: tarballs tarballs_version
.PHONY: traditional_signatures traditional_signatures_version
.PHONY: traditional_tarballs traditional_tarballs_version
.PHONY: typecheck
.PHONY: zonenames zones
.PHONY: $(ZDS)
@


1.43.8.5
log
@Back out all changes to this file accidently included in the pullup of
tickt #1539.
@
text
@d1 2
a2 1
#	$NetBSD$
d4 2
a5 1
.include <bsd.own.mk>
d7 2
a8 1
TZDISTDIR=${.CURDIR}
d10 22
a31 1
.PATH: ${TZDISTDIR}
d37 1
a37 1
# (When a POSIX-style environment variable is handled, the rules in the
d40 1
a40 1
# summer time.)
d51 36
d89 12
a100 2
# Use an absolute path name for TZDIR unless you're just testing the software.
# Note: ${DESTDIR} is prepended to this for the actual copy.
d102 2
a103 1
TZDIR=	/usr/share/zoneinfo
d105 9
a113 2
# If you always want time values interpreted as "seconds since the epoch
# (not counting leap seconds)", use
d115 2
a116 2
# below.  If you always want right time values interpreted as "seconds since
# the epoch" (counting leap seconds)", use
d124 33
a156 1
# below.
d158 6
a163 1
REDO=		posix_only
a165 1
YEARISTYPE=	"${HOST_SH} ${TZDISTDIR}/yearistype.sh"
d167 309
d478 1
a478 1
YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
d480 2
a481 1
TDATA=		$(YDATA) $(NDATA)
d483 385
a867 68
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
DATA=		$(YDATA) $(NDATA) $(TABDATA) # yearistype.sh

TZBUILDDIR=	${.OBJDIR}/builddir

.PHONY:	posix_only
posix_only: ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L /dev/null ${TDATA}

.PHONY:	right_only
right_only: leapseconds ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L leapseconds ${TDATA}

.PHONY:	other_two
other_two: leapseconds ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/posix -L /dev/null ${TDATA}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/right -L leapseconds ${TDATA}

.PHONY:	posix_right
posix_right: posix_only other_two

.PHONY:	right_posix
right_posix: right_only other_two

.if ${MKUNPRIVED} == "no"
TOOL_PAX.unpriv=-pe
.else
TOOL_PAX.unpriv=
.endif

.if ${MKSHARE} != "no"
afterinstall: ${DATA} ${REDO} ${TABDATA}
	${_MKMSG_CREATE} ${POSIXRULES}
	mkdir -p ${TZBUILDDIR}
	cd ${TZDISTDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -p ${POSIXRULES}
	cd ${TZBUILDDIR} && \
	    find . -type f -print | xargs ${TOOL_STAT} -qf '%d,%i %N' | sort \
	| while read devino tzfile; do \
		destfile=${DESTDIR}${TZDIR}/$${tzfile#./}; \
		destdir=$$(dirname $${destfile}); \
		if [ ! -d "$$destdir" ]; then \
			${_MKSHMSG_INSTALL} $$destdir; \
			${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} \
			$$destdir; \
			${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} $$destdir; \
		fi; \
		if [ "$$devino" = "$$lastdevino" ]; then \
			if  ldevino=$$(${TOOL_STAT} -qf '%d %i' $$lastfile) && \
			    tdevino=$$(${TOOL_STAT} -qf '%d %i' $$destfile) && \
			    [ "$$ldevino" = "$$tdevino" ]; then \
				continue; \
			fi; \
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
			${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
d869 116
a984 24
			lastdevino=$$devino; \
			lastfile=$$destfile; \
			cmp -s $$tzfile $$destfile >/dev/null 2>&1 && continue;\
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
			${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
		fi; \
	done
	for f in ${TABDATA}; do \
		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
			${TZDISTDIR}/$$f ${DESTDIR}${TZDIR}; \
	done
	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
		${TZDISTDIR}/TZDATA_VERSION ${DESTDIR}${TZDIR}/TZDATA_VERSION
.else	# ${MKSHARE} == "no"
afterinstall:
.endif	# ${MKSHARE} == "no"

clean:
	-rm -rf ${TZBUILDDIR}

.include <bsd.prog.mk>
@


1.43.12.1
log
@resync from head
@
text
@d1 1
a1 1
#	$NetBSD$
a99 7
		destdir=$$(dirname $${destfile}); \
		if [ ! -d "$$destdir" ]; then \
			${_MKSHMSG_INSTALL} $$destdir; \
			${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} \
			$$destdir; \
			${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} $$destdir; \
		fi; \
d101 2
a102 2
			if  ldevino=$$(${TOOL_STAT} -qf '%d %i' $$lastfile) && \
			    tdevino=$$(${TOOL_STAT} -qf '%d %i' $$destfile) && \
@


1.43.12.2
log
@Rebase to HEAD as of a few days ago.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43.12.1 2013/06/23 06:28:55 tls Exp $
@


1.42
log
@also install zone.tab and iso3166.tab from tzdata, some applications
(evolution, KDE) want the former at least, and other OSes install it
(as the Makefile in tzcode suggests)
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.41 2006/02/27 09:08:10 lukem Exp $
d107 4
a110 2
			${_MKSHECHO} ${INSTALL_LINK} $$lastfile $$destfile; \
			${INSTALL_LINK} $$lastfile $$destfile; \
@


1.42.16.1
log
@Pull up following revision(s) (requested by snj in ticket #790):
	share/mk/bsd.lib.mk: revision 1.298
	share/mk/bsd.man.mk: revision 1.100
	share/mk/bsd.hostprog.mk: revision 1.55
	distrib/sets/maketars: revision 1.66
	share/zoneinfo/Makefile: revision 1.43
	share/mk/bsd.kmodule.mk: revision 1.19
	usr.bin/xinstall/xinstall.c: revisions 1.106 - 1.108 via patch
	share/mk/bsd.prog.mk: revision 1.241
	share/dict/Makefile: revision 1.17
	share/mk/bsd.README: revision 1.249
	distrib/common/parselist.awk: revision 1.16
	share/mk/bsd.links.mk: revision 1.34
Explicitly sort entries on preparing set files from METALOG.
METALOG could have different order due to install(1) race
on parallel builds, and mtree(8) doesn't sort files.
Should fix inconsistent shared sets among builds as seen in
/pub/NetBSD-daily/netbsd-5/200904010000Z/shared/ and
/pub/NetBSD-daily/netbsd-5/200904010002Z/shared/ dirs.
Okay'ed by snj@@.
Changes for installing with a metalog:
* When installing hard links and using a metalog, if -o, -g, -m, or -f
  args were explicitly specified on the command line, then believe them,
  but do not implicitly believe uname/gname/mode/flags from the file
  system.
* Output fields in the same order used by mtree.
Fix -Wshadow -Wcast-qual issues
Re-calculate size and digestresult after stripping, to ensure that
correct values appear in the metalog.
Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links.  They have no effect except when using a
metalog, in which case the information is added to the metalog.  In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.
Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.
Reviewed by perry and joerg.  This should fix PR 24457 and PR 41155.
@
text
@d1 1
a1 1
#	$NetBSD$
d107 2
a108 4
			${_MKSHECHO} ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
			${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
@


1.42.16.2
log
@Apply patch (requested by apb in ticket #1684):
distrib/sets/lists/base/mi		patch
doc/3RDPARTY				patch
share/zoneinfo/africa			patch
share/zoneinfo/antarctica		patch
share/zoneinfo/asia			patch
share/zoneinfo/australasia		patch
share/zoneinfo/backward			patch
share/zoneinfo/etcetera			patch
share/zoneinfo/europe			patch
share/zoneinfo/factory			patch
share/zoneinfo/iso3166.tab		patch
share/zoneinfo/leapseconds		patch
share/zoneinfo/northamerica		patch
share/zoneinfo/pacificnew		patch
share/zoneinfo/solar87			patch
share/zoneinfo/solar88			patch
share/zoneinfo/solar89			patch
share/zoneinfo/southamerica		patch
share/zoneinfo/systemv			patch
share/zoneinfo/yearistype.sh		patch
share/zoneinfo/zone.tab			patch

	Update to tzdata2011n.
	[apb, ticket #1684]
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43 2009/04/10 16:16:12 apb Exp $
@


1.42.16.1.2.1
log
@sync to netbsd-5
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.42.12.1 2009/06/06 22:10:12 bouyer Exp $
@


1.42.12.1
log
@Pull up following revision(s) (requested by snj in ticket #790):
	share/mk/bsd.lib.mk: revision 1.298
	share/mk/bsd.man.mk: revision 1.100
	share/mk/bsd.hostprog.mk: revision 1.55
	distrib/sets/maketars: revision 1.66
	share/zoneinfo/Makefile: revision 1.43
	share/mk/bsd.kmodule.mk: revision 1.19
	usr.bin/xinstall/xinstall.c: revisions 1.106 - 1.108 via patch
	share/mk/bsd.prog.mk: revision 1.241
	share/dict/Makefile: revision 1.17
	share/mk/bsd.README: revision 1.249
	distrib/common/parselist.awk: revision 1.16
	share/mk/bsd.links.mk: revision 1.34
Explicitly sort entries on preparing set files from METALOG.
METALOG could have different order due to install(1) race
on parallel builds, and mtree(8) doesn't sort files.
Should fix inconsistent shared sets among builds as seen in
/pub/NetBSD-daily/netbsd-5/200904010000Z/shared/ and
/pub/NetBSD-daily/netbsd-5/200904010002Z/shared/ dirs.
Okay'ed by snj@@.
Changes for installing with a metalog:
* When installing hard links and using a metalog, if -o, -g, -m, or -f
  args were explicitly specified on the command line, then believe them,
  but do not implicitly believe uname/gname/mode/flags from the file
  system.
* Output fields in the same order used by mtree.
Fix -Wshadow -Wcast-qual issues
Re-calculate size and digestresult after stripping, to ensure that
correct values appear in the metalog.
Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links.  They have no effect except when using a
metalog, in which case the information is added to the metalog.  In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.
Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.
Reviewed by perry and joerg.  This should fix PR 24457 and PR 41155.
@
text
@d1 1
a1 1
#	$NetBSD$
d107 2
a108 4
			${_MKSHECHO} ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
			${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
@


1.42.12.1.2.1
log
@Apply patch (requested by apb in ticket #1684):
distrib/sets/lists/base/mi		patch
doc/3RDPARTY				patch
share/zoneinfo/africa			patch
share/zoneinfo/antarctica		patch
share/zoneinfo/asia			patch
share/zoneinfo/australasia		patch
share/zoneinfo/backward			patch
share/zoneinfo/etcetera			patch
share/zoneinfo/europe			patch
share/zoneinfo/factory			patch
share/zoneinfo/iso3166.tab		patch
share/zoneinfo/leapseconds		patch
share/zoneinfo/northamerica		patch
share/zoneinfo/pacificnew		patch
share/zoneinfo/solar87			patch
share/zoneinfo/solar88			patch
share/zoneinfo/solar89			patch
share/zoneinfo/southamerica		patch
share/zoneinfo/systemv			patch
share/zoneinfo/yearistype.sh		patch
share/zoneinfo/zone.tab			patch

	Update to tzdata2011n.
	[apb, ticket #1684]
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43 2009/04/10 16:16:12 apb Exp $
@


1.42.12.1.2.2
log
@Apply patch (requested by apb in ticket #1917):

distrib/sets/lists/base/mi				patch
doc/3RDPARTY						patch
share/zoneinfo/Makefile					patch
share/zoneinfo/africa					patch
share/zoneinfo/antarctica				patch
share/zoneinfo/asia					patch
share/zoneinfo/australasia				patch
share/zoneinfo/backward					patch
share/zoneinfo/etcetera					patch
share/zoneinfo/europe					patch
share/zoneinfo/factory					patch
share/zoneinfo/iso3166.tab				patch
share/zoneinfo/leap-seconds.list			patch
share/zoneinfo/northamerica				patch
share/zoneinfo/pacificnew				patch
share/zoneinfo/southamerica				patch
share/zoneinfo/systemv					patch
share/zoneinfo/yearistype.sh				patch
share/zoneinfo/zone.tab					patch
share/zoneinfo/zone1970.tab				patch

	Update timezone database from tzdata2014c to tzdata2014f.
	This adds two new timezones (Asia/Chita and Asia/Srednekolymsk),
	updates many other timezones, and adds two new
	data files in the /usr/share/zoneinfo directory (leapseconds
	and zone1970.dat).
	[apb, ticket #1917]
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.42.12.1.2.1 2011/11/02 18:16:28 riz Exp $
d49 2
a50 3
ZONETABLES=	zone1970.tab zone.tab
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
DATA=		$(YDATA) $(NDATA) $(TABDATA) # yearistype.sh
@


1.42.12.2
log
@Apply patch (requested by apb in ticket #1684):
distrib/sets/lists/base/mi		patch
doc/3RDPARTY				patch
share/zoneinfo/africa			patch
share/zoneinfo/antarctica		patch
share/zoneinfo/asia			patch
share/zoneinfo/australasia		patch
share/zoneinfo/backward			patch
share/zoneinfo/etcetera			patch
share/zoneinfo/europe			patch
share/zoneinfo/factory			patch
share/zoneinfo/iso3166.tab		patch
share/zoneinfo/leapseconds		patch
share/zoneinfo/northamerica		patch
share/zoneinfo/pacificnew		patch
share/zoneinfo/solar87			patch
share/zoneinfo/solar88			patch
share/zoneinfo/solar89			patch
share/zoneinfo/southamerica		patch
share/zoneinfo/systemv			patch
share/zoneinfo/yearistype.sh		patch
share/zoneinfo/zone.tab			patch

	Update to tzdata2011n.
	[apb, ticket #1684]
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43 2009/04/10 16:16:12 apb Exp $
@


1.42.12.2.2.1
log
@Apply patch (requested by apb in ticket #1917):

distrib/sets/lists/base/mi				patch
doc/3RDPARTY						patch
share/zoneinfo/Makefile					patch
share/zoneinfo/africa					patch
share/zoneinfo/antarctica				patch
share/zoneinfo/asia					patch
share/zoneinfo/australasia				patch
share/zoneinfo/backward					patch
share/zoneinfo/etcetera					patch
share/zoneinfo/europe					patch
share/zoneinfo/factory					patch
share/zoneinfo/iso3166.tab				patch
share/zoneinfo/leap-seconds.list			patch
share/zoneinfo/northamerica				patch
share/zoneinfo/pacificnew				patch
share/zoneinfo/southamerica				patch
share/zoneinfo/systemv					patch
share/zoneinfo/yearistype.sh				patch
share/zoneinfo/zone.tab					patch
share/zoneinfo/zone1970.tab				patch

	Update timezone database from tzdata2014c to tzdata2014f.
	This adds two new timezones (Asia/Chita and Asia/Srednekolymsk),
	updates many other timezones, and adds two new
	data files in the /usr/share/zoneinfo directory (leapseconds
	and zone1970.dat).
	[apb, ticket #1917]
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.42.12.2 2011/11/02 18:16:03 riz Exp $
d49 2
a50 3
ZONETABLES=	zone1970.tab zone.tab
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
DATA=		$(YDATA) $(NDATA) $(TABDATA) # yearistype.sh
@


1.42.12.3
log
@share/zoneinfo/Makefile				patch
distrib/sets/lists/base/mi			patch
share/zoneinfo/solar87				delete
share/zoneinfo/solar88				delete
share/zoneinfo/solar89				delete

	Remove the the Asia/Riyadh{87,88,89} timezones, and their
	Mideast/* aliases.  These zones were removed upstream in
	tzdata2013i (December 2013).
	[apb, ticket #1907]
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.42.12.2 2011/11/02 18:16:03 riz Exp $
d47 2
a48 1
TDATA=		$(YDATA) $(NDATA)
d50 1
a50 1
DATA=		$(YDATA) $(NDATA) leapseconds # yearistype.sh
@


1.42.12.4
log
@Apply patch (requested by apb in ticket #1917):
distrib/sets/lists/base/mi				patch
doc/3RDPARTY						patch
share/zoneinfo/Makefile					patch
share/zoneinfo/africa					patch
share/zoneinfo/antarctica				patch
share/zoneinfo/asia					patch
share/zoneinfo/australasia				patch
share/zoneinfo/backward					patch
share/zoneinfo/etcetera					patch
share/zoneinfo/europe					patch
share/zoneinfo/factory					patch
share/zoneinfo/iso3166.tab				patch
share/zoneinfo/leap-seconds.list			patch
share/zoneinfo/northamerica				patch
share/zoneinfo/pacificnew				patch
share/zoneinfo/southamerica				patch
share/zoneinfo/systemv					patch
share/zoneinfo/yearistype.sh				patch
share/zoneinfo/zone.tab					patch
share/zoneinfo/zone1970.tab				patch

	Update timezone database from tzdata2014c to tzdata2014f.
	This adds two new timezones (Asia/Chita and Asia/Srednekolymsk),
	updates many other timezones, and adds two new
	data files in the /usr/share/zoneinfo directory (leapseconds
	and zone1970.dat).
	[apb, ticket #1917]
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.42.12.3 2014/05/21 22:01:08 bouyer Exp $
d48 2
a49 3
ZONETABLES=	zone1970.tab zone.tab
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
DATA=		$(YDATA) $(NDATA) $(TABDATA) # yearistype.sh
@


1.42.14.1
log
@Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43 2009/04/10 16:16:12 apb Exp $
d107 2
a108 4
			${_MKSHECHO} ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
			${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$lastfile $$destfile; \
@


1.41
log
@Use device number as well as inode to detect hardlinks.
Rename shell variable names to more accurately their purpose.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.40 2006/02/27 08:08:50 lukem Exp $
d49 1
d91 1
a91 1
afterinstall: ${DATA} ${REDO}
d120 4
@


1.41.10.1
log
@sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD$
a48 1
TABDATA=	iso3166.tab zone.tab
d90 1
a90 1
afterinstall: ${DATA} ${REDO} ${TABDATA}
a118 4
	for f in ${TABDATA}; do \
		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
			${.CURDIR}/$$f ${DESTDIR}${TZDIR}; \
	done
@


1.41.6.1
log
@Catch up to netbsd-4.0 release.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.41.4.1 2007/11/25 08:57:05 xtraeme Exp $
a48 1
TABDATA=	iso3166.tab zone.tab
d90 1
a90 1
afterinstall: ${DATA} ${REDO} ${TABDATA}
a118 4
	for f in ${TABDATA}; do \
		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
			${.CURDIR}/$$f ${DESTDIR}${TZDIR}; \
	done
@


1.41.4.1
log
@Pull up following revision(s) (requested by drochner in ticket #987):
	share/zoneinfo/Makefile: revision 1.42
	distrib/sets/lists/base/mi: revision 1.725
also install zone.tab and iso3166.tab from tzdata, some applications
(evolution, KDE) want the former at least, and other OSes install it
(as the Makefile in tzcode suggests)
@
text
@d1 1
a1 1
#	$NetBSD$
a48 1
TABDATA=	iso3166.tab zone.tab
d90 1
a90 1
afterinstall: ${DATA} ${REDO} ${TABDATA}
a118 4
	for f in ${TABDATA}; do \
		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
			${.CURDIR}/$$f ${DESTDIR}${TZDIR}; \
	done
@


1.40
log
@Deal correctly with hard-linked timezone (synonym) files during
the copy from the build directory to the DESTDIR.
/usr/share/zoneinfo is now smaller & use less inodes again.
Fixes problem I introduced in rev 1.37 on 2004/01/30.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.39 2004/08/31 00:00:31 lukem Exp $
d96 2
a97 2
	    find . -type f -print | xargs ${TOOL_STAT} -f '%i %N' | sort -n \
	| while read nlinks tzfile; do \
d99 1
a99 1
		if [ "$$nlinks" = "$$lastnlinks" ]; then \
d109 1
a109 1
			lastnlinks=$$nlinks; \
@


1.39
log
@Install zoneinfo files NONBINMODE (444) instead of BINMODE (555).
Noted by David Laight on tech-toolchain.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.38 2004/06/21 18:20:08 jmc Exp $
d95 3
a97 2
	cd ${TZBUILDDIR} && find . -type f -print | sort \
	| while read tzfile; do \
d99 19
a117 6
		cmp -s $$tzfile $$destfile > /dev/null 2>&1 && continue; \
		${_MKSHMSG_INSTALL} $$destfile; \
		${_MKSHECHO} ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
		    -m ${NONBINMODE} $$tzfile $$destfile ; \
		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
		    -m ${NONBINMODE} $$tzfile $$destfile ; \
@


1.39.4.1
log
@Pull up following revision(s) (requested by lukem in ticket #1968):
	distrib/sets/lists/base/mi: revision 1.699, 1.721, 1.725, 1.773
	share/zoneinfo/Makefile                 patch
	share/zoneinfo/africa                   patch
	share/zoneinfo/antarctica               patch
	share/zoneinfo/asia                     patch
	share/zoneinfo/australasia              patch
	share/zoneinfo/backward                 patch
	share/zoneinfo/europe                   patch
	share/zoneinfo/iso3166.tab              patch
	share/zoneinfo/leapseconds              patch
	share/zoneinfo/northamerica             patch
	share/zoneinfo/southamerica             patch
	share/zoneinfo/zone.tab                 patch
Update for tzdata2008f.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.42 2007/11/08 20:14:07 drochner Exp $
a48 1
TABDATA=	iso3166.tab zone.tab
d90 1
a90 1
afterinstall: ${DATA} ${REDO} ${TABDATA}
d95 2
a96 3
	cd ${TZBUILDDIR} && \
	    find . -type f -print | xargs ${TOOL_STAT} -qf '%d,%i %N' | sort \
	| while read devino tzfile; do \
d98 6
a103 23
		if [ "$$devino" = "$$lastdevino" ]; then \
			if  ldevino=`${TOOL_STAT} -qf '%d %i' $$lastfile` && \
			    tdevino=`${TOOL_STAT} -qf '%d %i' $$destfile` && \
			    [ "$$ldevino" = "$$tdevino" ]; then \
				continue; \
			fi; \
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_LINK} $$lastfile $$destfile; \
			${INSTALL_LINK} $$lastfile $$destfile; \
		else \
			lastdevino=$$devino; \
			lastfile=$$destfile; \
			cmp -s $$tzfile $$destfile >/dev/null 2>&1 && continue;\
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
			${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
		fi; \
	done
	for f in ${TABDATA}; do \
		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
			${.CURDIR}/$$f ${DESTDIR}${TZDIR}; \
@


1.39.6.1
log
@Pull up following revision(s) (requested by lukem in ticket #1968):
	distrib/sets/lists/base/mi: revision 1.699, 1.721, 1.725, 1.773
	share/zoneinfo/Makefile                 patch
	share/zoneinfo/africa                   patch
	share/zoneinfo/antarctica               patch
	share/zoneinfo/asia                     patch
	share/zoneinfo/australasia              patch
	share/zoneinfo/backward                 patch
	share/zoneinfo/europe                   patch
	share/zoneinfo/iso3166.tab              patch
	share/zoneinfo/leapseconds              patch
	share/zoneinfo/northamerica             patch
	share/zoneinfo/southamerica             patch
	share/zoneinfo/zone.tab                 patch
Update for tzdata2008f.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.42 2007/11/08 20:14:07 drochner Exp $
a48 1
TABDATA=	iso3166.tab zone.tab
d90 1
a90 1
afterinstall: ${DATA} ${REDO} ${TABDATA}
d95 2
a96 3
	cd ${TZBUILDDIR} && \
	    find . -type f -print | xargs ${TOOL_STAT} -qf '%d,%i %N' | sort \
	| while read devino tzfile; do \
d98 6
a103 23
		if [ "$$devino" = "$$lastdevino" ]; then \
			if  ldevino=`${TOOL_STAT} -qf '%d %i' $$lastfile` && \
			    tdevino=`${TOOL_STAT} -qf '%d %i' $$destfile` && \
			    [ "$$ldevino" = "$$tdevino" ]; then \
				continue; \
			fi; \
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_LINK} $$lastfile $$destfile; \
			${INSTALL_LINK} $$lastfile $$destfile; \
		else \
			lastdevino=$$devino; \
			lastfile=$$destfile; \
			cmp -s $$tzfile $$destfile >/dev/null 2>&1 && continue;\
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
			${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
		fi; \
	done
	for f in ${TABDATA}; do \
		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
			${.CURDIR}/$$f ${DESTDIR}${TZDIR}; \
@


1.39.2.1
log
@Pull up following revision(s) (requested by lukem in ticket #1968):
	distrib/sets/lists/base/mi: revisions 1.699, 1.721, 1.725, 1.773
	share/zoneinfo/Makefile			patch
	share/zoneinfo/africa			patch
	share/zoneinfo/antarctica		patch
	share/zoneinfo/asia			patch
	share/zoneinfo/australasia		patch
	share/zoneinfo/backward			patch
	share/zoneinfo/europe			patch
	share/zoneinfo/iso3166.tab		patch
	share/zoneinfo/leapseconds		patch
	share/zoneinfo/northamerica		patch
	share/zoneinfo/southamerica		patch
	share/zoneinfo/zone.tab			patch
Update to tzdata2008f.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.42 2007/11/08 20:14:07 drochner Exp $
a48 1
TABDATA=	iso3166.tab zone.tab
d90 1
a90 1
afterinstall: ${DATA} ${REDO} ${TABDATA}
d95 2
a96 3
	cd ${TZBUILDDIR} && \
	    find . -type f -print | xargs ${TOOL_STAT} -qf '%d,%i %N' | sort \
	| while read devino tzfile; do \
d98 6
a103 23
		if [ "$$devino" = "$$lastdevino" ]; then \
			if  ldevino=`${TOOL_STAT} -qf '%d %i' $$lastfile` && \
			    tdevino=`${TOOL_STAT} -qf '%d %i' $$destfile` && \
			    [ "$$ldevino" = "$$tdevino" ]; then \
				continue; \
			fi; \
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_LINK} $$lastfile $$destfile; \
			${INSTALL_LINK} $$lastfile $$destfile; \
		else \
			lastdevino=$$devino; \
			lastfile=$$destfile; \
			cmp -s $$tzfile $$destfile >/dev/null 2>&1 && continue;\
			${_MKSHMSG_INSTALL} $$destfile; \
			${_MKSHECHO} ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
			${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
			    -m ${NONBINMODE} $$tzfile $$destfile; \
		fi; \
	done
	for f in ${TABDATA}; do \
		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
			${.CURDIR}/$$f ${DESTDIR}${TZDIR}; \
@


1.38
log
@Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.37 2004/01/30 04:30:51 lukem Exp $
d101 1
a101 1
		    -m ${BINMODE} $$tzfile $$destfile ; \
d103 1
a103 1
		    -m ${BINMODE} $$tzfile $$destfile ; \
@


1.37
log
@Use  find . -type f | while read ... ${INSTALL} ...  instead of ${PAX}
to install the zoneinfo files.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.36 2003/10/21 10:01:20 lukem Exp $
d110 1
a110 1
	rm -rf ${TZBUILDDIR}
@


1.37.2.1
log
@Pull up revision 1.38 (requested by jmc in ticket #531):
Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
@
text
@d1 1
a1 1
#	$NetBSD$
d110 1
a110 1
	-rm -rf ${TZBUILDDIR}
@


1.36
log
@Rework how MAKEVERBOSE operates:

    *	Don't bother prefixing commands with a line of  ${_MKCMD}\
	and instead rely upon "make -s".  This is less intrusive on
	all the Makefiles than the former.  Idea from David Laight.

    *	Rename the variables use to print messages.  The scheme now is:
	    _MKMSG_FOO		Run  _MKMSG 'foo'
	    _MKTARGET_FOO	Run  _MKMSG_FOO ${.TARGET}
	From discussion with Alistair Crooks.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.35 2003/10/19 14:20:28 lukem Exp $
a52 1
TZBUILDSPEC=	${.OBJDIR}/builddir.spec
d95 10
a104 15
	cd ${TZBUILDDIR} && \
	(   find . -type d | xargs -n 1 printf \
		"%s type=dir mode=0755 uname=${BINOWN} gname=${BINGRP}\n" ; \
	    find . -type f | xargs -n 1 printf \
		"%s type=file mode=0444 uname=${BINOWN} gname=${BINGRP}\n" ; \
	) > ${TZBUILDSPEC}
	${_MKMSG_INSTALL} ${DESTDIR}${TZDIR}
	cd ${TZBUILDDIR} && \
	  ${TOOL_PAX} -O -rw ${TOOL_PAX.unpriv} -M -N ${NETBSDSRCDIR}/etc \
	  ${DESTDIR}${TZDIR} < ${TZBUILDSPEC}
.if ${MKUNPRIVED} != "no"
	sed -e "s|^\.|./${TZDIR}|g" -e "s|//|/|g" < ${TZBUILDSPEC} | \
	    ${METALOG.add}
.endif

d110 1
a110 1
	rm -rf ${TZBUILDDIR} ${TZBUILDSPEC}
@


1.35
log
@support MAKEVERBOSE and use ${HOST_SH}
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.34 2003/07/18 08:26:10 lukem Exp $
d57 1
a57 2
	${_MKMSGCREATE}
	${_MKCMD}\
a58 1
	${_MKCMD}\
d64 1
a64 2
	${_MKMSGCREATE}
	${_MKCMD}\
a65 1
	${_MKCMD}\
d71 1
a71 2
	${_MKMSGCREATE}
	${_MKCMD}\
a72 1
	${_MKCMD}\
a74 1
	${_MKCMD}\
d92 1
a92 2
	${_MKMSGCREATE.m} ${POSIXRULES}
	${_MKCMD}\
a93 1
	${_MKCMD}\
a95 1
	${_MKCMD}\
d102 1
a102 2
	${_MKMSGINSTALL.m} ${DESTDIR}${TZDIR}
	${_MKCMD}\
a106 1
	${_MKCMD}\
a115 1
	${_MKCMD}\
@


1.34
log
@Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.33 2003/07/10 10:34:39 lukem Exp $
d41 1
a41 1
YEARISTYPE=	"sh ${.CURDIR}/yearistype.sh"
d57 2
d60 1
d66 2
d69 1
d75 2
d78 1
d81 1
d99 2
d102 1
d105 1
d112 2
d118 1
d128 2
a129 1
	-rm -rf ${TZBUILDDIR} ${TZBUILDSPEC}
@


1.33
log
@Rename a large chunk of the make(1) variables which refer to a
program/tool from "FOO" to "TOOL_FOO".  The new variables are:
	TOOL_ASN1_COMPILE  TOOL_CAP_MKDB  TOOL_CAT  TOOL_CKSUM  TOOL_COMPILE_ET
	TOOL_CONFIG  TOOL_CRUNCHGEN  TOOL_CTAGS  TOOL_DB  TOOL_EQN  TOOL_FGEN
	TOOL_GENCAT  TOOL_GROFF  TOOL_HEXDUMP  TOOL_INDXBIB  TOOL_INSTALLBOOT
	TOOL_INSTALL_INFO  TOOL_M4  TOOL_MAKEFS  TOOL_MAKEINFO  TOOL_MAKEWHATIS
	TOOL_MDSETIMAGE  TOOL_MENUC  TOOL_MKCSMAPPER  TOOL_MKESDB
	TOOL_MKLOCALE  TOOL_MKMAGIC  TOOL_MKTEMP  TOOL_MSGC  TOOL_MTREE
	TOOL_PAX  TOOL_PIC  TOOL_PREPMKBOOTIMAGE  TOOL_PWD_MKDB  TOOL_REFER
	TOOL_ROFF_ASCII  TOOL_ROFF_DVI  TOOL_ROFF_HTML  TOOL_ROFF_PS
	TOOL_ROFF_RAW  TOOL_RPCGEN  TOOL_SOELIM  TOOL_SUNLABEL  TOOL_TBL
	TOOL_UUDECODE  TOOL_VGRIND  TOOL_ZIC

For each, provide default in <bsd.sys.mk> of the form:
	TOOL_FOO?=	foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
	TOOL_FOO=	${TOOLDIR}/bin/${_TOOL_PREFIX}foo

Document all of these in bsd.README.

This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.32 2002/12/23 06:52:51 lukem Exp $
d81 6
d99 1
a99 1
	  ${TOOL_PAX} -O -rw ${UNPRIVED:D:U-pe} -M -N ${NETBSDSRCDIR}/etc \
d101 1
a101 1
.if defined(UNPRIVED)
@


1.32
log
@Rework METALOG manipulation:
- add '-D ${DESTDIR}' to INSTPRIV, so install(8) removes the leading
  ${DESTDIR} from the metalogged path
- provide ${METADB.add} variable (for "${CAT} -l >> ${METALOG}"), to make
  it easier to replace manual metalog manipulation in the future.
- with manual metalog additions, don't add the leading ${DESTDIR} in the path
- in maketars, use "mtree -C ..." instead of
  "mtree -D ... | sed -e 's,\(.*\) \(\..*\),\2 \1,";

Benefits:
- maketars "Parsing METALOG" step speeds up from 29 seconds to 1.2 seconds
  on a P3-600.
  (This also benefits "make installworld" at the top level.)
- ${DESTDIR}/METALOG is easier to read without the leading "${DESTDIR}"
  on all the pathnames, and it's smaller as well.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.31 2002/12/21 15:54:51 lukem Exp $
a51 2
ZIC?=		zic

d59 1
a59 1
	    ${ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L /dev/null ${TDATA}
d65 1
a65 1
	    ${ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L leapseconds ${TDATA}
d71 1
a71 1
	    ${ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/posix -L /dev/null ${TDATA}
d73 1
a73 1
	    ${ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/right -L leapseconds ${TDATA}
d85 1
a85 1
	    ${ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -p ${POSIXRULES}
d93 1
a93 1
	  ${PAX} -O -rw ${UNPRIVED:D:U-pe} -M -N ${NETBSDSRCDIR}/etc \
@


1.31
log
@Invoke ${PAX} with '-O' so that various errors don't hang the make
or the command with an interactive question.  (This also prevents
weird problems if a directory element of '-f path' is missing and
'make -j N' is being used).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.30 2002/12/19 10:56:39 lukem Exp $
d20 1
d22 1
a22 1
TZDIR=	${DESTDIR}/usr/share/zoneinfo
d95 2
a96 2
	  ${PAX} -O -rw ${UNPRIVED:D:U-pe} -M -N ${NETBSDSRCDIR}/etc ${TZDIR} \
	  < ${TZBUILDSPEC}
d99 1
a99 1
	    ${CAT} -l >>${METALOG}
@


1.30
log
@Instead of ${ZIC}-ing to ${DESTDIR}/usr/share/zoneinfo and using chmod and
chown to frob permissions, use ${ZIC} to ${.OBJDIR}/builddir, create a
temporary mtree(8) specfile, and use "${PAX} -M -N ${NETBSDSRCDIR}/etc"
to copy to ${DESTDIR}/usr/share/zoneinfo, looking up root:wheel in
${NETBSDSRCDIR}/etc instead of the host system database.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.29 2002/06/10 18:47:12 mason Exp $
d94 2
a95 2
	    ${PAX} -rw ${UNPRIVED:D:U-pe} -M -N ${NETBSDSRCDIR}/etc ${TZDIR} \
	    < ${TZBUILDSPEC}
@


1.29
log
@Use the new cat(1) locking functionality - should solve PR toolchain/16963.
If all goes well, will submit a batch of pull-up requests for netbsd-1-6
presently to bring these additions and fixes into 1.6.
@
text
@d1 1
a1 3
#	$NetBSD: Makefile,v 1.28 2002/01/05 07:35:20 mrg Exp $

NOOBJ=	# defined
d51 4
a54 1
ZIC?=zic
d58 3
a60 1
	${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -L /dev/null ${TDATA}
d64 3
a66 1
	${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -L leapseconds ${TDATA}
d70 5
a74 2
	${ZIC} -y ${YEARISTYPE} -d ${TZDIR}/posix -L /dev/null ${TDATA}
	${ZIC} -y ${YEARISTYPE} -d ${TZDIR}/right -L leapseconds ${TDATA}
d84 15
a98 12
	${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -p ${POSIXRULES}
	find ${TZDIR} -type d | xargs chmod u=rwX,go=rX
	find ${TZDIR} -type f | xargs chmod a=r
.if !defined(UNPRIVED)
	chown -R ${BINOWN}:${BINGRP} ${TZDIR}
.else
	find ${TZDIR} -type d | xargs -n 1 printf \
		"%s type=dir mode=0755 uname=${BINOWN} gname=${BINGRP}\n" | \
		sed -e 's|^/|./|g' -e 's|//|/|g' | ${CAT} -l >> ${METALOG}
	find ${TZDIR} -type f | xargs -n 1 printf \
		"%s type=file mode=0444 uname=${BINOWN} gname=${BINGRP}\n" | \
		sed -e 's|^/|./|g' -e 's|//|/|g' | ${CAT} -l >> ${METALOG}
d100 2
a101 1
.else
d103 4
a106 1
.endif
@


1.28
log
@do not overwrite ${ZIC} if it is already set.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.27 2001/12/12 12:24:23 lukem Exp $
d84 1
a84 1
		sed -e 's|^/|./|g' -e 's|//|/|g' >>${METALOG}
d87 1
a87 1
		sed -e 's|^/|./|g' -e 's|//|/|g' >>${METALOG}
@


1.28.2.1
log
@Pull up revision 1.29 (requested by mason in ticket #248):
Use the new cat(1) locking functionality - should solve PR toolchain/16963.
If all goes well, will submit a batch of pull-up requests for netbsd-1-6
presently to bring these additions and fixes into 1.6.
@
text
@d1 1
a1 1
#	$NetBSD$
d84 1
a84 1
		sed -e 's|^/|./|g' -e 's|//|/|g' | ${CAT} -l >> ${METALOG}
d87 1
a87 1
		sed -e 's|^/|./|g' -e 's|//|/|g' | ${CAT} -l >> ${METALOG}
@


1.27
log
@Set  NOxxx=  before  <bsd.own.mk>  is pulled in (even indirectly).
Otherwise the appropriate MKxxx=no won't be defined .
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.26 2001/12/12 01:49:33 tv Exp $
d53 1
a53 1
ZIC=zic
@


1.26
log
@MKfoo=no -> NOfoo
@
text
@d1 3
a3 1
#	$NetBSD: Makefile,v 1.25 2001/11/26 15:24:20 perry Exp $
a5 2

NOOBJ=# defined
@


1.25
log
@Uncomment a bunch of seemingly unused rules. It seems several people
do indeed use them in their private builds. Pointed out by Alan Barrett.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.24 2001/11/24 21:37:23 perry Exp $
d5 1
a5 1
MKOBJ=no
@


1.24
log
@1) Synthetically generate metadata for installed files when UNPRIVED
   is set.
2) Remove the default timezone line, which noted that the
   functionality was now in src/etc/Makefile.
3) Comment out a huge swath of the file that repeated tests reveal
   never seem to be invoked -- they're apparently for generating zone
   files that include leap seconds and such. Must talk to Klaus about
   what they are for and whether we need them.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.23 2001/11/19 05:18:53 perry Exp $
d59 14
a72 16
## XXX Is any of this needed, or is it just baggage that we never use?
## XXX Commented out for now, pending an answer.
#.PHONY:	right_only
#right_only: leapseconds ${TDATA}
#	${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -L leapseconds ${TDATA}
#
#.PHONY:	other_two
#other_two: leapseconds ${TDATA}
#	${ZIC} -y ${YEARISTYPE} -d ${TZDIR}/posix -L /dev/null ${TDATA}
#	${ZIC} -y ${YEARISTYPE} -d ${TZDIR}/right -L leapseconds ${TDATA}
#
#.PHONY:	posix_right
#posix_right: posix_only other_two
#
#.PHONY:	right_posix
#right_posix: right_only other_two
@


1.23
log
@UNPRIVILEGED->UNPRIVED
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.22 1999/08/21 06:30:12 simonb Exp $
a11 3
# This line has been moved to /usr/src/etc/Makefile
LOCALTIME=	US/Pacific

d59 16
a74 14
.PHONY:	right_only
right_only: leapseconds ${TDATA}
	${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -L leapseconds ${TDATA}

.PHONY:	other_two
other_two: leapseconds ${TDATA}
	${ZIC} -y ${YEARISTYPE} -d ${TZDIR}/posix -L /dev/null ${TDATA}
	${ZIC} -y ${YEARISTYPE} -d ${TZDIR}/right -L leapseconds ${TDATA}

.PHONY:	posix_right
posix_right: posix_only other_two

.PHONY:	right_posix
right_posix: right_only other_two
d79 2
d83 7
a90 2
	find ${TZDIR} -type f | xargs chmod a=r
	find ${TZDIR} -type d | xargs chmod u=rwX,go=rX
@


1.22
log
@Don't chown installed files or directories if UNPRIVILEGED is defined.

"make build" should now work as a non-root user (tested on Alpha).
mtree spits out lots of warnings during "make distrib-dirs", but
these are non-fatal.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.21 1999/02/13 02:54:36 lukem Exp $
d80 1
a80 1
.if !defined(UNPRIVILEGED)
@


1.21
log
@convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.20 1998/09/27 17:22:10 lukem Exp $
d80 1
d82 1
d84 1
@


1.20
log
@don't install in /usr/share if NOSHARE is defined
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.19 1997/06/18 01:56:03 jtc Exp $
d3 3
a5 1
NOOBJ=
d77 1
a77 1
.if !defined(NOSHARE)
@


1.19
log
@Add NOOBJ=.  Remove (cd ${.CURDIR}; ... ).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.18 1997/06/18 01:27:43 jtc Exp $
d75 1
d80 3
@


1.18
log
@Remove datfiles subdirectory, it's a remanent from long ago.
@
text
@d1 3
a3 1
#	$NetBSD: Makefile,v 1.17 1997/05/07 16:12:00 mycroft Exp $
d58 1
a58 2
	(cd ${.CURDIR}; \
	    ${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -L /dev/null ${TDATA})
d62 1
a62 2
	(cd ${.CURDIR}; \
	    ${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -L leapseconds ${TDATA})
d66 2
a67 4
	(cd ${.CURDIR}; \
	    ${ZIC} -y ${YEARISTYPE} -d ${TZDIR}/posix -L /dev/null ${TDATA})
	(cd ${.CURDIR}; \
	    ${ZIC} -y ${YEARISTYPE} -d ${TZDIR}/right -L leapseconds ${TDATA})
d76 1
a76 2
	(cd ${.CURDIR}; \
	    ${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -p ${POSIXRULES})
@


1.17
log
@Use afterinstall, not realinstall, for data files.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.16 1997/05/07 09:43:32 mycroft Exp $
d41 1
a41 1
YEARISTYPE=	"sh ${.CURDIR}/datfiles/yearistype.sh"
d56 1
a56 1
	(cd ${.CURDIR}/datfiles; \
d61 1
a61 1
	(cd ${.CURDIR}/datfiles; \
d66 1
a66 1
	(cd ${.CURDIR}/datfiles; \
d68 1
a68 1
	(cd ${.CURDIR}/datfiles; \
d78 1
a78 1
	(cd ${.CURDIR}/datfiles; \
a82 1
.PATH:	${.CURDIR}/datfiles
@


1.16
log
@Add some missing .PHONYs.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.15 1997/01/16 21:27:22 perry Exp $
d77 1
a77 1
realinstall: ${DATA} ${REDO}
@


1.15
log
@close pr-3111 -- use sh to invoke script instead of executing
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.14 1995/04/22 12:10:17 cgd Exp $
d54 1
d59 1
d64 1
d71 1
d74 1
@


1.14
log
@explicitly set zoneinfo files to be read-only by everyone.  fixes pr 984
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.13 1995/03/11 01:27:43 jtc Exp $
d41 1
a41 1
YEARISTYPE=	${.CURDIR}/datfiles/yearistype.sh
@


1.13
log
@No longer build zic.
@
text
@d1 1
a1 1
#	$NetBSD: $
d76 1
a76 1
	find ${TZDIR} -type f | xargs chmod a-w
@


1.12
log
@specify man pages the new way.
@
text
@d1 1
a1 2
#	from: @@(#)Makefile	5.9 (Berkeley) 2/28/91
#	$Id: Makefile,v 1.11 1994/02/10 04:42:42 cgd Exp $
d40 2
a41 58
# If you're running on a System V-style system and don't want lint grief,
# add
#	-DUSG
# to the end of the "CFLAGS=" line.
#
# If you're running on a system where "strchr" is known as "index",
# (for example, a 4.[012]BSD system), add
#	-Dstrchr=index
# to the end of the "CFLAGS=" line.
#
# If you're running on a system with a "mkdir" function, feel free to add
#	-Demkdir=mkdir
# to the end of the "CFLAGS=" line
#
# If you want to use System V compatibility code, add
#	-DUSG_COMPAT
# to the end of the "CFLAGS=" line.
#
# If your system has a "GMT offset" field in its "struct tm"s
# (or if you decide to add such a field in your system's "time.h" file),
# add the name to a define such as
#	-DTM_GMTOFF=tm_gmtoff
# or
#	-DTM_GMTOFF=_tm_gmtoff
# to the end of the "CFLAGS=" line.
#
# If your system has a "GMT offset" field in its "struct tm"s
# (or if you decide to add such a field in your system's "time.h" file),
# add the name to a define such as
#	-DTM_ZONE=tm_zone
# or
#	-DTM_ZONE=_tm_zone
# to the end of the "CFLAGS=" line.
#
# If you want code inspired by certain emerging standards, add
#	-DSTD_INSPIRED
# to the end of the "CFLAGS=" line.
#
# If you want Source Code Control System ID's left out of object modules, add
#	-DNOID
# to the end of the "CFLAGS=" line.
#
# If you'll never want to handle solar-time-based time zones, add
#	-DNOSOLAR
# to the end of the "CFLAGS=" line
# (and comment out the "SDATA=" line below).
#
# If you want to allocate state structures in localtime, add
#	-DALL_STATE
# to the end of the "CFLAGS=" line.
#
# If you want an "altzone" variable (a la System V Release 3.1), add
#	-DALTZONE
# to the end of the "CFLAGS=" line.
#
# If you want a "gtime" function (a la MACH), add
#	-DCMUCS
# to the end of the "CFLAGS=" line
d43 8
a50 14
.PATH:	${.CURDIR}/datfiles
CFLAGS+=	-DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
PROG=	zic
MAN=	tzfile.5 zic.8

SRCS=	zic.c scheck.c ialloc.c

YDATA=	africa antarctica asia australasia europe northamerica \
	russia southamerica pacificnew etcetera factory
NDATA=	systemv
#SDATA=	solar87 solar88 solar89
TDATA=	${YDATA} ${NDATA} ${SDATA}
DATA=	${YDATA} ${NDATA} ${SDATA} leapseconds
USNO=	usno1988 usno1989
d52 1
a52 1
ZIC=${.OBJDIR}/zic
d56 1
a56 1
	    ${ZIC} -d ${TZDIR} -L /dev/null ${TDATA})
d60 1
a60 1
	    ${ZIC} -d ${TZDIR} -L leapseconds ${TDATA})
d64 1
a64 1
	    ${ZIC} -d ${TZDIR}/posix -L /dev/null ${TDATA})
d66 1
a66 1
	    ${ZIC} -d ${TZDIR}/right -L leapseconds ${TDATA})
d74 1
a74 1
	    ${ZIC} -d ${TZDIR} -p ${POSIXRULES})
d78 1
@


1.11
log
@dtrt with permissions
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.10 1993/12/28 12:03:24 davidb Exp $
d103 1
a103 2
MAN5=	tzfile.0
MAN8=	zic.0
@


1.10
log
@Changed to use make's new .OBJDIR
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.9 1993/09/17 23:58:57 cgd Exp $
d139 2
a140 2
	chown -R ${BINOWN}.${BINGRP} ${TZDIR}
	chmod -R a-w ${TZDIR}
@


1.9
log
@add entry for russia zone list
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.8 1993/09/02 01:10:03 cgd Exp $
d116 2
d120 1
a120 1
	    ../obj/zic -d ${TZDIR} -L /dev/null ${TDATA})
d124 1
a124 1
	    ../obj/zic -d ${TZDIR} -L leapseconds ${TDATA})
d128 1
a128 1
	    ../obj/zic -d ${TZDIR}/posix -L /dev/null ${TDATA})
d130 1
a130 1
	    ../obj/zic -d ${TZDIR}/right -L leapseconds ${TDATA})
d138 1
a138 1
	    ../obj/zic -d ${TZDIR} -p ${POSIXRULES})
@


1.8
log
@fix typo, and use "posix_only" rather than "right_only".  everything
else in the world, i.e. other UNIX boxes, and WWV, are == "posix_only"
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.7 1993/07/31 15:27:06 mycroft Exp $
d109 1
a109 1
	southamerica pacificnew etcetera factory
@


1.7
log
@Add RCS indentifiers.
@
text
@d2 1
a2 1
#	$Id: $
d39 1
a39 1
REDO=		right_only
d125 1
a125 1
	(cd ${.CURDIR}/datfiles;
@


1.6
log
@/etc/localtime is not created by "make install" here anymore. That
was just too inconvenient.
@
text
@d1 2
a2 1
#	@@(#)Makefile	5.9 (Berkeley) 2/28/91
@


1.5
log
@Define `realinstall' target, not `install', and let bsd.prog.mk do dependencies.
@
text
@d8 1
a135 2
	/bin/rm -f ${DESTDIR}/etc/localtime
	ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
@


1.4
log
@Use global value of CFLAGS for optimization.
@
text
@d132 1
a132 1
install: maninstall ${DATA} ${REDO}
@


1.3
log
@Now installs zic(8) man page
@
text
@d99 1
a99 1
CFLAGS=	-DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
@


1.2
log
@now symlinks /etc/localtime to the right thing, rather than making
a copy (or trying to).
@
text
@d102 1
@


1.1
log
@Initial revision
@
text
@d134 2
a135 2
	install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
	    ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
@


1.1.1.1
log
@initial import of 386bsd-0.1 sources
@
text
@@


1.1.1.2
log
@Import tzdata2012g from ftp://ftp.iana.org/tz/releases/tzdata2012g.tar.gz

Changes from tzdata2012f to tzdata2012g:

    Samoa fall 2012 and later.  (Thanks to Nicholas Pereira
    and Robert Elz.)

    Palestine fall 2012.  (Thanks to Steffen Thorsen.)

In addition to those changes, the tzdata distribution now includes
a copy of the Makefile from the tzcode distribution.  NetBSD's
src/share/zoneinfo/Makefile is completely different from the Makefile
that is now included in the tzdata distribution.
@
text
@d1 1
a1 6
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.

# Version numbers of the code and data distributions.
VERSION=	2012g
a6 4
# to correct things.
# Use the command
#	make zonenames
# to get a list of the values you can use for LOCALTIME.
d8 1
a8 1
LOCALTIME=	GMT
a13 4
# (When a POSIX-style environment variable is handled, the rules in the
# template file are used to determine "spring forward" and "fall back" days and
# times; the environment variable itself specifies UTC offsets of standard and
# summer time.)
a15 12
# to correct things.
# Use the command
#	make zonenames
# to get a list of the values you can use for POSIXRULES.
# If you want POSIX compatibility, use "America/New_York".

POSIXRULES=	America/New_York

# Also see TZDEFRULESTRING below, which takes effect only
# if the time zone files cannot be accessed.

# Everything gets put in subdirectories of. . .
d17 1
a17 1
TOPDIR=		/usr/local
a18 2
# "Compiled" time zone information is placed in the "TZDIR" directory
# (and subdirectories).
d21 1
a21 18
TZDIR=		$(TOPDIR)/etc/zoneinfo

# The "tzselect", "zic", and "zdump" commands get installed in. . .

ETCDIR=		$(TOPDIR)/etc

# If you "make INSTALL", the "date" command gets installed in. . .

BINDIR=		$(TOPDIR)/bin

# Manual pages go in subdirectories of. . .

MANDIR=		$(TOPDIR)/man

# Library functions are put in an archive in LIBDIR.

LIBDIR=		$(TOPDIR)/lib
TZLIB=		$(LIBDIR)/libtz.a
d25 1
a25 1
#	REDO=		posix_only
a35 2
# POSIX mandates that leap seconds not be counted; for compatibility with it,
# use either "posix_only" or "posix_right".
d37 1
a37 1
REDO=		posix_right
d39 13
a51 48
# Since "." may not be in PATH...

YEARISTYPE=	./yearistype

# Non-default libraries needed to link.
# Add -lintl if you want to use `gettext' on Solaris.
LDLIBS=

# Add the following to the end of the "CFLAGS=" line as needed.
#  -DHAVE_ADJTIME=0 if `adjtime' does not exist (SVR0?)
#  -DHAVE_GETTEXT=1 if `gettext' works (GNU, Linux, Solaris); also see LDLIBS
#  -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares
#	ctime_r and asctime_r incompatibly with the POSIX standard (Solaris 8).
#  -DHAVE_SETTIMEOFDAY=0 if settimeofday does not exist (SVR0?)
#  -DHAVE_SETTIMEOFDAY=1 if settimeofday has just 1 arg (SVR4)
#  -DHAVE_SETTIMEOFDAY=2 if settimeofday uses 2nd arg (4.3BSD)
#  -DHAVE_SETTIMEOFDAY=3 if settimeofday ignores 2nd arg (4.4BSD)
#  -DHAVE_STDINT_H=1 if you have a pre-C99 compiler with "stdint.h"
#  -DHAVE_SYMLINK=0 if your system lacks the symlink function
#  -DHAVE_SYS_STAT_H=0 if your compiler lacks a "sys/stat.h"
#  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a "sys/wait.h"
#  -DLOCALE_HOME=\"path\" if locales are in "path", not "/usr/lib/locale"
#  -DHAVE_UNISTD_H=0 if your compiler lacks a "unistd.h" (Microsoft C++ 7?)
#  -DHAVE_UTMPX_H=1 if your compiler has a "utmpx.h"
#  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
#	DST transitions if the time zone files cannot be accessed
#  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
#  -TTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
#	the default is system-supplied, typically "/usr/lib/locale"
#  $(GCC_DEBUG_FLAGS) if you are using GCC and want lots of checking
#  -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU=1
#	if you do not want run time warnings about formats that may cause
#	year 2000 grief
#  -DZIC_MAX_ABBR_LEN_WO_WARN=3
#	(or some other number) to set the maximum time zone abbreviation length
#	that zic will accept without a warning (the default is 6)
GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
	-Wall -Wextra \
	-Wbad-function-cast -Wcast-align -Wcast-qual \
	-Wformat=2 -Winit-self \
	-Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes \
	-Wnested-externs \
	-Wno-format-nonliteral -Wno-sign-compare -Wno-sign-conversion \
	-Wno-type-limits \
	-Wno-unused-parameter -Woverlength-strings -Wpointer-arith \
	-Wshadow -Wstrict-prototypes -Wsuggest-attribute=const \
	-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines \
	-Wwrite-strings
d55 1
a55 3
# to the end of the "CFLAGS=" line.  This arrange for "timezone" and "daylight"
# variables to be kept up-to-date by the time conversion functions.  Neither
# "timezone" nor "daylight" is described in X3J11's work.
a63 4
# Neither tm_gmtoff nor _tm_gmtoff is described in X3J11's work;
# in its work, use of "tm_gmtoff" is described as non-conforming.
# Both Linux and BSD have done the equivalent of defining TM_GMTOFF in
# their recent releases.
d65 1
a65 1
# If your system has a "zone abbreviation" field in its "struct tm"s
a71 4
# Neither tm_zone nor _tm_zone is described in X3J11's work;
# in its work, use of "tm_zone" is described as non-conforming.
# Both UCB and Sun have done the equivalent of defining TM_ZONE in
# their recent releases.
d73 1
a73 2
# If you want functions that were inspired by early versions of X3J11's work,
# add
d75 1
a75 18
# to the end of the "CFLAGS=" line.  This arranges for the functions
# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
# "posix2time", and "time2posix" to be added to the time conversion library.
# "tzsetwall" is like "tzset" except that it arranges for local wall clock
# time (rather than the time specified in the TZ environment variable)
# to be used.
# "offtime" is like "gmtime" except that it accepts a second (long) argument
# that gives an offset to add to the time_t when converting it.
# "timelocal" is equivalent to "mktime".
# "timegm" is like "timelocal" except that it turns a struct tm into
# a time_t using UTC (rather than local time as "timelocal" does).
# "timeoff" is like "timegm" except that it accepts a second (long) argument
# that gives an offset to use when converting to a time_t.
# "posix2time" and "time2posix" are described in an included manual page.
# X3J11's work does not describe any of these functions.
# Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0.
# These functions may well disappear in future releases of the time
# conversion package.
a84 3
# This reduces (slightly) the run-time data-space requirements of
# the time conversion functions; it may reduce the acceptability of your system
# to folks in oil- and cash-rich places.
d88 1
a88 1
# to the end of the "CFLAGS=" line.  Storage is obtained by calling malloc.
a92 1
# This variable is not described in X3J11's work.
a96 265
# This function is not described in X3J11's work.
#
# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
# out by the National Institute of Standards and Technology
# which claims to test C and Posix conformance.  If you want to pass PCTS, add
#	-DPCTS
# to the end of the "CFLAGS=" line.
#
# If you want strict compliance with XPG4 as of 1994-04-09, add
#	-DXPG4_1994_04_09
# to the end of the "CFLAGS=" line.  This causes "strftime" to always return
# 53 as a week number (rather than 52 or 53) for those days in January that
# before the first Monday in January when a "%V" format is used and January 1
# falls on a Friday, Saturday, or Sunday.

CFLAGS=

# If you want zic's -s option used when installing, uncomment the next line
# ZFLAGS=	-s

zic=		./zic
ZIC=		$(zic) $(ZFLAGS)

# The name of a Posix-compliant `awk' on your system.
AWK=		nawk

# The path where SGML DTDs are kept.
# The default is appropriate for Ubuntu.
SGML_TOPDIR= /usr
SGML_SEARCH_PATH= $(SGML_TOPDIR)/share/xml/xhtml/schema/dtd/REC-html401-19991224

# The catalog file(s) to use when validating.
SGML_CATALOG_FILES= HTML4.cat

# The name, arguments and environment of a program to validate your web pages.
# See <http://www.jclark.com/sp/> for a validator, and
# <http://validator.w3.org/source/> for a validation library.
VALIDATE = nsgmls
VALIDATE_FLAGS = -s -B -wall -wno-unused-param
VALIDATE_ENV = \
  SGML_CATALOG_FILES=$(SGML_CATALOG_FILES) \
  SGML_SEARCH_PATH=$(SGML_SEARCH_PATH) \
  SP_CHARSET_FIXED=YES \
  SP_ENCODING=UTF-8

# Flags to give 'tar' when making a distribution.
# Try to use flags appropriate for GNU tar.
GNUTARFLAGS=	--numeric-owner --owner=0 --group=0 --mode=go+u,go-w
TARFLAGS=	`if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
		 then echo $(GNUTARFLAGS); \
		 else :; \
		 fi`

# Flags to give 'gzip' when making a distribution.
GZIPFLAGS=	-9n

###############################################################################

cc=		cc
CC=		$(cc) -DTZDIR=\"$(TZDIR)\"

TZCSRCS=	zic.c localtime.c asctime.c scheck.c ialloc.c
TZCOBJS=	zic.o localtime.o asctime.o scheck.o ialloc.o
TZDSRCS=	zdump.c localtime.c ialloc.c
TZDOBJS=	zdump.o localtime.o ialloc.o
DATESRCS=	date.c localtime.c strftime.c asctime.c
DATEOBJS=	date.o localtime.o strftime.o asctime.o
LIBSRCS=	localtime.c asctime.c difftime.c
LIBOBJS=	localtime.o asctime.o difftime.o
HEADERS=	tzfile.h private.h
NONLIBSRCS=	zic.c zdump.c scheck.c ialloc.c
NEWUCBSRCS=	date.c strftime.c
SOURCES=	$(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) tzselect.ksh
MANS=		newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
			tzfile.5 tzselect.8 zic.8 zdump.8
COMMON=		Makefile
DOCS=		README Theory $(MANS) date.1
PRIMARY_YDATA=	africa antarctica asia australasia \
		europe northamerica southamerica
YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
NDATA=		systemv factory
SDATA=		solar87 solar88 solar89
TDATA=		$(YDATA) $(NDATA) $(SDATA)
TABDATA=	iso3166.tab zone.tab
DATA=		$(YDATA) $(NDATA) $(SDATA) $(TABDATA) leapseconds yearistype.sh
WEB_PAGES=	tz-art.htm tz-link.htm
MISC=		usno1988 usno1989 usno1989a usno1995 usno1997 usno1998 \
			$(WEB_PAGES) checktab.awk workman.sh \
			zoneinfo2tdf.pl
ENCHILADA=	$(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC)

# And for the benefit of csh users on systems that assume the user
# shell should be used to handle commands in Makefiles. . .

SHELL=		/bin/sh

all:		tzselect zic zdump $(LIBOBJS)

ALL:		all date

install:	all $(DATA) $(REDO) $(TZLIB) $(MANS) $(TABDATA)
		$(ZIC) -y $(YEARISTYPE) \
			-d $(TZDIR) -l $(LOCALTIME) -p $(POSIXRULES)
		-rm -f $(TZDIR)/iso3166.tab $(TZDIR)/zone.tab
		cp iso3166.tab zone.tab $(TZDIR)/.
		-mkdir $(TOPDIR) $(ETCDIR)
		cp tzselect zic zdump $(ETCDIR)/.
		-mkdir $(TOPDIR) $(MANDIR) \
			$(MANDIR)/man3 $(MANDIR)/man5 $(MANDIR)/man8
		-rm -f $(MANDIR)/man3/newctime.3 \
			$(MANDIR)/man3/newtzset.3 \
			$(MANDIR)/man5/tzfile.5 \
			$(MANDIR)/man8/tzselect.8 \
			$(MANDIR)/man8/zdump.8 \
			$(MANDIR)/man8/zic.8
		cp newctime.3 newtzset.3 $(MANDIR)/man3/.
		cp tzfile.5 $(MANDIR)/man5/.
		cp tzselect.8 zdump.8 zic.8 $(MANDIR)/man8/.

INSTALL:	ALL install date.1
		-mkdir $(TOPDIR) $(BINDIR)
		cp date $(BINDIR)/.
		-mkdir $(TOPDIR) $(MANDIR) $(MANDIR)/man1
		-rm -f $(MANDIR)/man1/date.1
		cp date.1 $(MANDIR)/man1/.

version.h:
		echo >$@@ \
		  'static char const TZVERSION[]="tz$(VERSION)";'

zdump:		$(TZDOBJS)
		$(CC) $(CFLAGS) $(LFLAGS) $(TZDOBJS) $(LDLIBS) -o $@@

zic:		$(TZCOBJS) yearistype
		$(CC) $(CFLAGS) $(LFLAGS) $(TZCOBJS) $(LDLIBS) -o $@@

yearistype:	yearistype.sh
		cp yearistype.sh yearistype
		chmod +x yearistype

posix_only:	zic $(TDATA)
		$(ZIC) -y $(YEARISTYPE) -d $(TZDIR) -L /dev/null $(TDATA)

right_only:	zic leapseconds $(TDATA)
		$(ZIC) -y $(YEARISTYPE) -d $(TZDIR) -L leapseconds $(TDATA)

# In earlier versions of this makefile, the other two directories were
# subdirectories of $(TZDIR).  However, this led to configuration errors.
# For example, with posix_right under the earlier scheme,
# TZ='right/Australia/Adelaide' got you localtime with leap seconds,
# but gmtime without leap seconds, which led to problems with applications
# like sendmail that subtract gmtime from localtime.
# Therefore, the other two directories are now siblings of $(TZDIR).
# You must replace all of $(TZDIR) to switch from not using leap seconds
# to using them, or vice versa.
other_two:	zic leapseconds $(TDATA)
		$(ZIC) -y $(YEARISTYPE) -d $(TZDIR)-posix -L /dev/null $(TDATA)
		$(ZIC) -y $(YEARISTYPE) \
			-d $(TZDIR)-leaps -L leapseconds $(TDATA)

posix_right:	posix_only other_two

right_posix:	right_only other_two

zones:		$(REDO)

$(TZLIB):	$(LIBOBJS)
		-mkdir $(TOPDIR) $(LIBDIR)
		ar ru $@@ $(LIBOBJS)
		if [ -x /usr/ucb/ranlib -o -x /usr/bin/ranlib ] ; \
			then ranlib $@@ ; fi

date:		$(DATEOBJS)
		$(CC) $(CFLAGS) date.o localtime.o asctime.o strftime.o \
			$(LDLIBS) -lc -o $@@

tzselect:	tzselect.ksh
		sed \
			-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
			-e 's|\(TZVERSION\)=.*|\1=tz$(VERSION)|' \
			<$? >$@@
		chmod +x $@@

check:		check_tables check_web

check_tables:	checktab.awk $(PRIMARY_YDATA)
		$(AWK) -f checktab.awk $(PRIMARY_YDATA)

check_web:	$(WEB_PAGES)
		$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) $(WEB_PAGES)

clean:
		rm -f core *.o *.out \
		  date tzselect version.h zdump zic yearistype

maintainer-clean: clean
		@@echo 'This command is intended for maintainers to use; it'
		@@echo 'deletes files that may need special tools to rebuild.'
		rm -f *.[1-8].txt tzcode*.tar.gz tzdata*.tar.gz

names:
		@@echo $(ENCHILADA)

# Set the time stamps to those of the git repository, if available,
# and if the files have not changed since then.
# This uses GNU 'touch' syntax 'touch -d@@N FILE',
# where N is the number of seconds since 1970.
# If git or GNU 'touch' is absent, do nothing.
set-timestamps:
		-TZ=UTC0 && export TZ && files=`git ls-files` && \
		touch -d @@1 test.out && rm -f test.out && \
		for file in $$files; do \
		  test -z "`git diff --name-only $$file`" || continue; \
		  cmd="touch -d @@`git log -1 --format='format:%ct' $$file \
			` $$file" && \
		  echo "$$cmd" && \
		  $$cmd || exit; \
		done

# The zics below ensure that each data file can stand on its own.
# We also do an all-files run to catch links to links.

public:		$(ENCHILADA) set-timestamps
		make maintainer-clean
		make "CFLAGS=$(GCC_DEBUG_FLAGS)"
		mkdir -m go-rwx /tmp/,tzpublic
		-for i in $(TDATA) ; do zic -v -d /tmp/,tzpublic $$i 2>&1 | grep -v "starting year" ; done
		for i in $(TDATA) ; do zic -d /tmp/,tzpublic $$i || exit; done
		zic -v -d /tmp/,tzpublic $(TDATA) || exit
		rm -f -r /tmp/,tzpublic
		for i in *.[1-8] ; do \
		  LC_ALL=C sh workman.sh $$i > $$i.txt && \
		  touch -r $$i $$i.txt || exit; \
		done
		$(AWK) -f checktab.awk $(PRIMARY_YDATA)
		LC_ALL=C && export LC_ALL && \
		tar $(TARFLAGS) -cf - \
		    $(COMMON) $(DOCS) $(SOURCES) $(MISC) *.[1-8].txt | \
		  gzip $(GZIPFLAGS) > tzcode$(VERSION).tar.gz
		LC_ALL=C && export LC_ALL && \
		tar $(TARFLAGS) -cf - $(COMMON) $(DATA) | \
		  gzip $(GZIPFLAGS) > tzdata$(VERSION).tar.gz

typecheck:
		make clean
		for i in "long long" unsigned double; \
		do \
			make CFLAGS="-DTYPECHECK -D_TIME_T \"-Dtime_t=$$i\"" ; \
			./zdump -v Europe/Rome ; \
			make clean ; \
		done

zonenames:	$(TDATA)
		@@$(AWK) '/^Zone/ { print $$2 } /^Link/ { print $$3 }' $(TDATA)

asctime.o:	private.h tzfile.h
date.o:		private.h
difftime.o:	private.h
ialloc.o:	private.h
localtime.o:	private.h tzfile.h
scheck.o:	private.h
strftime.o:	tzfile.h
zdump.o:	version.h
zic.o:		private.h tzfile.h version.h
d98 42
a139 1
.KEEP_STATE:
@


1.1.1.3
log
@Import tzdata2012g from ftp://ftp.iana.org/tz/releases/tzdata2012h.tar.gz

Changes from tzdata2012g to tzdata2012h:

  Bahia no longer has DST.  (Thanks to Kelley Cook.)

  Tocantins has DST.  (Thanks to Rodrigo Severo.)

  Israel has new DST rules next year.  (Thanks to Ephraim Silverberg.)

  Jordan stays on DST this winter.  (Thanks to Steffen Thorsen.)

  Web page updates.
@
text
@d6 1
a6 1
VERSION=	2012h
d458 1
a458 1
			make CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
@


1.1.1.4
log
@Import tzdata2012i from ftp://ftp.iana.org/tz/releases/tzdata2012i.tar.gz

Changes from tzdata2012h to tzdata2012i:

  Cuba switches from DST on 4 Nov 2012 at 01:00.  (Thanks to Steffen Thorsen.)
@
text
@d6 1
a6 1
VERSION=	2012i
a226 5
# Linker flags.  Default to $(LFLAGS) for backwards compatibility
# to tzcode2012h and earlier.

LDFLAGS=	$(LFLAGS)

d234 1
a234 5
AWK=		awk

# The full path name of a Posix-compliant shell that supports the Korn shell's
# 'select' statement, as an extension.  These days, Bash is the most popular.
KSHELL=		/bin/bash
d341 1
a341 1
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)
d344 1
a344 1
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
d379 1
a379 1
		if [ -x /usr/ucb/ranlib ] || [ -x /usr/bin/ranlib ]; \
d383 2
a384 1
		$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)
a387 1
			-e 's|#!/bin/bash|#!$(KSHELL)|g' \
a413 2
public:		check check_public set-timestamps tarballs signatures

d433 1
a433 1
check_public:	$(ENCHILADA)
d437 1
a437 3
		-for i in $(TDATA) ; do \
		  zic -v -d /tmp/,tzpublic $$i 2>&1 | grep -v "starting year" ; \
		done
a440 4

tarballs:	tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz

tzcode$(VERSION).tar.gz: $(COMMON) $(DOCS) $(SOURCES) $(MISC)
d445 1
d449 1
a449 3
		  gzip $(GZIPFLAGS) > $@@

tzdata$(VERSION).tar.gz: $(COMMON) $(DATA)
d452 1
a452 9
		  gzip $(GZIPFLAGS) > $@@

signatures:	tzcode$(VERSION).tar.gz.sign tzdata$(VERSION).tar.gz.sign

tzcode$(VERSION).tar.gz.sign: tzcode$(VERSION).tar.gz
		gpg --armor --detach-sign -o $@@ $?

tzdata$(VERSION).tar.gz.sign: tzdata$(VERSION).tar.gz
		gpg --armor --detach-sign -o $@@ $?
@


1.1.1.5
log
@Import tzdata2012j from ftp://ftp.iana.org/tz/releases/tzdata2012j.tar.gz

Changes from tzdata2012i to tzdata2012j:

  Libya moved to CET this weekend, but with DST planned next year.
  (Thanks to Even Scharning, Steffen Thorsen, and Tim Parenti.)

  Various fixes to documentation and commentary.
@
text
@a4 3
# Package name for the code distribution.
PACKAGE=	tzcode

d6 1
a6 1
VERSION=	2012j
d232 3
d346 2
a347 2
		(echo 'static char const PKGVERSION[]="($(PACKAGE)) ";' && \
		 echo 'static char const TZVERSION[]="$(VERSION)";') >$@@
a397 1
			-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
d399 1
a399 1
			-e 's|\(TZVERSION\)=.*|\1=$(VERSION)|' \
a413 1
		rm -f -r tzpublic
d418 1
a418 1
		rm -f *.[1-8].txt *.asc *.tar.gz
d447 3
a449 3
		mkdir tzpublic
		for i in $(TDATA) ; do \
		  $(zic) -v -d tzpublic $$i 2>&1 || exit; \
d451 3
a453 2
		$(zic) -v -d tzpublic $(TDATA)
		rm -f -r tzpublic
d472 1
a472 1
signatures:	tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc
d474 2
a475 2
tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
		gpg --armor --detach-sign $?
d477 2
a478 2
tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
		gpg --armor --detach-sign $?
@


1.1.1.6
log
@Import tzdata2013a from ftp://ftp.iana.org/tz/releases/tzdata2013a.tar.gz

Changes from tzdata2012j to tzdata2013a:

   Change affecting binary data format:

     The zone offset at the end of version-2-format zone files is now
     allowed to be 24:00, as per POSIX.1-2008.  (Thanks to Arthor David Olson.)

   Changes affecting current and future time stamps:

     Chile's 2013 rules, and we guess rules for 2014 and later, will be
     the same as 2012, namely Apr Sun>=23 03:00 UTC to Sep Sun>=2 04:00 UTC.
     (Thanks to Steffen Thorsen and Robert Elz.)

     New Zones Asia/Khandyga, Asia/Ust-Nera, Europe/Busingen.
     (Thanks to Tobias Conradi and Arthur David Olson.)

   Many changes affect historical time stamps before 1940.
   These were deduced from: Milne J. Civil time. Geogr J. 1899
   Feb;13(2):173-94 <http://www.jstor.org/stable/1774359>.
@
text
@d9 1
a9 4
VERSION=	2013a

# Email address for bug reports.
BUGEMAIL=	tz@@iana.org
d246 1
a246 1
# The default is appropriate for Ubuntu 12.10.
d248 1
a248 2
SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
a263 11
# INVALID_CHAR is a regular expression that matches invalid characters in
# distributed files.  For now, stick to a safe subset of ASCII.
# The caller must set the shell variable 'sharp' to the character '#',
# since Makefile macros cannot contain '#'.
# TAB_CHAR is a single tab character, in single quotes.
TAB_CHAR=	'	'
INVALID_CHAR1=	$(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@@'
INVALID_CHAR2=	'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
INVALID_CHAR3=	'abcdefghijklmnopqrstuvwxyz{|}~'
INVALID_CHAR=	'[^]'$(INVALID_CHAR1)$(INVALID_CHAR2)$(INVALID_CHAR3)'-]'

d347 1
a347 2
		 echo 'static char const TZVERSION[]="$(VERSION)";' && \
		 echo 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";') >$@@
a398 1
			-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
d404 1
a404 4
check:		check_character_set check_tables check_web

check_character_set: $(ENCHILADA)
		sharp='#'; ! grep -n $(INVALID_CHAR) $(ENCHILADA)
@


1.1.1.7
log
@Import tzdata2013b from ftp://ftp.iana.org/tz/releases/tzdata2013b.tar.gz

Changes from tzdata2013a to tzdata2013b:

  Changes affecting current and future time stamps:

    Haiti uses US daylight-saving rules this year, and presumably future years.
    This changes time stamps starting today.  (Thanks to Steffen Thorsen.)

    Paraguay will end DST on March 24 this year.
    (Thanks to Steffen Thorsen.)  For now, assume it's just this year.

    Morocco does not observe DST during Ramadan;
    try to predict Ramadan in Morocco as best we can.
    (Thanks to Erik Homoet for the heads-up.)

  Changes affecting commentary:

    Update URLs in tz-link page.  Add URLs for webOS, BB10, iOS.
    Update URL for Solaris.  Mention Internet RFC 6557.
    Update Internet RFCs 2445->5545, 2822->5322.
    Switch from FTP to HTTP for Internet RFCs.
@
text
@d9 1
a9 1
VERSION=	2013b
@


1.1.1.8
log
@Import tzdata2013c from ftp://ftp.iana.org/tz/releases/tzdata2013c.tar.gz

Summary of changes from tzdata2013b to tzdata2013c:

  Changes affecting current and future time stamps:

    Palestine observed DST starting March 29, 2013.
    From 2013 on, Gaza and Hebron both observe DST.
    Assume that the recent change to Paraguay's DST rules is permanent.

  Changes affecting past time stamps:

    Fix some historical data for Palestine.
    Fix times of habitation for Macquarie.

  Changing affecting metadata only:

    Macquarie Island is politically part of Australia, not Antarctica.
    Sort Macquarie more-consistently with other parts of Australia.
@
text
@d9 1
a9 1
VERSION=	2013c
@


1.1.1.9
log
@Import tzdata2013d from ftp://ftp.iana.org/tz/releases/tzdata2013d.tar.gz

Summary of changes from tzdata2013c to tzdata2013d:

  Changes affecting current and future time stamps:

    Morocco's midsummer transitions this year are July 7 and August 10,
    not July 9 and August 8.  (Thanks to Andrew Paprocki.)

    Israel now falls back on the last Sunday of October.
    (Thanks to Ephraim Silverberg.)

  Changes affecting past time stamps:

    Specify Jerusalem's location more precisely; this changes the pre-1880
    times by 2 s.

  Changing affecting metadata only:

    Fix typos in the entries for country codes BQ and SX.

  Changes affecting documentation and commentary:

    Deemphasize the significance of national borders.

    Update the zdump man page.

    Remove obsolete NOID comment (thanks to Denis Excoffier).

    Update several URLs and comments in the web pages.

    Spelling fixes (thanks to Kevin Lyda and Jonathan Leffler).

    Update URL for CLDR Zone->Tzid table (thanks to Yoshito Umaoka).
@
text
@d9 1
a9 1
VERSION=	2013d
a55 3
# Types to try, as an alternative to time_t.  int64_t should be first.
TIME_T_ALTERNATIVES= int64_t int32_t uint32_t uint64_t

a100 1
#  -DHAVE_DOS_FILE_NAMES if file names have drive specifiers etc. (MS-DOS)
a103 1
#  -DHAVE_INTTYPES_H=1 if you have a pre-C99 compiler with "inttypes.h"
d112 1
d115 6
a120 1
#  -DLOCALE_HOME=\"path\" if locales are in "path", not "/usr/lib/locale"
a123 7
#  -DTIME_T_FLOATING=1 if your time_t (or time_tz) is floating point
#  -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
#  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
#  -TTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
#	the default is system-supplied, typically "/usr/lib/locale"
#  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
#	DST transitions if the time zone files cannot be accessed
a126 1
#  $(GCC_DEBUG_FLAGS) if you are using GCC and want lots of checking
d192 4
d432 1
a432 1
clean_misc:
a434 1
clean:		clean_misc
d445 1
a445 2
public:		check check_public check_time_t_alternatives \
		set-timestamps tarballs signatures
a475 29
# Check that the code works under various alternative
# implementations of time_t.
check_time_t_alternatives:
		mkdir tzpublic
		zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone.tab` && \
		for type in $(TIME_T_ALTERNATIVES); do \
		  mkdir tzpublic/$$type && \
		  make clean_misc && \
		  make TOPDIR=`pwd`/tzpublic/$$type \
		    CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
		    install && \
		  diff -qr tzpublic/int64_t/etc/zoneinfo tzpublic/$$type/etc/zoneinfo && \
		  case $$type in \
		  int32_t) range=-2147483648,2147483647;; \
		  uint32_t) range=0,4294967296;; \
		  int64_t) continue;; \
		  *u*) range=0,10000000000;; \
		  *) range=-10000000000,10000000000;; \
		  esac && \
		  echo checking $$type zones ... && \
		  tzpublic/int64_t/etc/zdump -V -t $$range $$zones \
		      >tzpublic/int64_t.out && \
		  tzpublic/$$type/etc/zdump -V -t $$range $$zones \
		      >tzpublic/$$type.out && \
		  diff -u tzpublic/int64_t.out tzpublic/$$type.out \
		    || exit; \
		done
		rm -f -r tzpublic

@


1.1.1.10
log
@Import tzdata2013i from ftp://ftp.iana.org/tz/releases/tzdata2013i.tar.gz.

Major changes from tzdata2013d to tzdata2013e:

  Fiji (Pacific/Fiji) DST in 2013 starts on October 27, not October 20.

  Several zones have been turned into links, either to correct errors,
  or where the differences were in older data (before 1943) that was
  thought to be unreliable.

  Some time zone abbreviations have been changed.

Major changes from tzdata2013e to tzdata2013f:

  Tocantins, Brazil (America/Araguaina) DST will not start in September
  2013.

  Jordan (Asia/Amman) moves to permanent UTC+3 (instead of UTC+2 with
  permanent DST since 2012).

  Palestine (Asia/Hebron and Asia/Gaza) will end DST at 00:00, not
  01:00, as from September 2013.

Major changes from tzdata2013f to tzdata2013g:

  Morocco (Africa/Casablanca) now observes DST from the last Sunday
  in March to the last Sunday in October, not April to September.
  respectively.

Major changes from tzdata2013g to tzdata2013h:

  Libya (Africa/Tripoli) has switched its time zone back to UTC+2
  without DST, instead of UTC+1 with DST.

  Western Sahara (Africa/El_Aaiun) uses Morocco's DST rules.

  Acre, Brazil (America/Rio_Branco) and (we guess) western Amazonas,
  Brazil (America/Eirunepe), will switch from UTC-4 to UTC-5 on
  2013-11-10.

  Add entries for DST transitions in Morocco in the year 2038.  This
  avoids some year-2038 glitches introduced in 2013g.

Major changes from tzdata2013h to tzdata2013i:

  Jordan (Asia/Amman) switches back to UTC+2 standard time at 00:00 on
  December 20, 2013.  The 2006-2011 DST transition schedule is planned
  to resume in 2014.  The switch to permanent UTC+3 is cancelled.

  In 2004, Cuba (America/Havana) began DST on March 28, not April 4.

  The files solar87, solar88, and solar89 are no longer distributed.
  The zones built from those files (Asia/Riyadh{87,88,89}) and
  Mideast/Riyadh{87,88,89}) are no longer installed.  They were a
  negative experiment -- that is, a demonstration that tz data can
  represent solar time only with some difficulty and error.  Their
  presence in the distribution caused confusion, as Riyadh civil time
  was generally not solar time in those years.
@
text
@d9 1
a9 1
VERSION=	2013i
d31 1
a31 1
# times; the environment variable itself specifies UT offsets of standard and
d54 1
a54 2
TZDIR_BASENAME=	zoneinfo
TZDIR=		$(TOPDIR)/etc/$(TZDIR_BASENAME)
d74 1
a108 1
#  -DHAVE_LINK=0 if your system lacks a link function
d123 1
d190 1
a190 1
# a time_t using UT (rather than local time as "timelocal" does).
d199 8
a243 2
ZFLAGS=

d247 2
a248 6
# The full path name of a Posix-compliant shell, preferably one that supports
# the Korn shell's 'select' statement as an extension.
# These days, Bash is the most popular.
# It should be OK to set this to /bin/sh, on platforms where /bin/sh
# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
# is typically nicer if it works.
d298 1
a298 5
AR=		ar

# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib.
RANLIB=		:

d300 3
a302 1
TZDOBJS=	zdump.o localtime.o ialloc.o asctime.o
d312 2
a313 6
MANTXTS=	newctime.3.txt newstrftime.3.txt newtzset.3.txt \
			time2posix.3.txt \
			tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
			date.1.txt
COMMON=		Makefile README
DOCS=		NEWS Theory $(MANS) date.1 $(MANTXTS)
d318 4
a321 5
TDATA=		$(YDATA) $(NDATA)
TABDATA=	iso3166.tab zone.tab leapseconds
LEAP_DEPS=	leapseconds.awk leap-seconds.list
DATA=		$(YDATA) $(NDATA) $(TABDATA) \
			$(LEAP_DEPS) yearistype.sh
a322 1
AWK_SCRIPTS=	checktab.awk leapseconds.awk
d324 1
a324 1
			$(WEB_PAGES) $(AWK_SCRIPTS) workman.sh \
d333 1
a333 1
all:		tzselect zic zdump libtz.a $(TABDATA)
d337 1
a337 5
install:	all $(DATA) $(REDO) $(MANS)
		mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \
			$(DESTDIR)$(LIBDIR) \
			$(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \
			$(DESTDIR)$(MANDIR)/man8
d339 16
a354 8
			-d $(DESTDIR)$(TZDIR) -l $(LOCALTIME) -p $(POSIXRULES)
		cp -f iso3166.tab zone.tab $(DESTDIR)$(TZDIR)/.
		cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/.
		cp libtz.a $(DESTDIR)$(LIBDIR)/.
		$(RANLIB) $(DESTDIR)$(LIBDIR)/libtz.a
		cp -f newctime.3 newtzset.3 $(DESTDIR)$(MANDIR)/man3/.
		cp -f tzfile.5 $(DESTDIR)$(MANDIR)/man5/.
		cp -f tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/.
d357 5
a361 3
		mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
		cp date $(DESTDIR)$(BINDIR)/.
		cp -f date.1 $(DESTDIR)$(MANDIR)/man1/.
a377 3
leapseconds:	$(LEAP_DEPS)
		$(AWK) -f leapseconds.awk leap-seconds.list >$@@

d379 1
a379 2
		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) \
			-L /dev/null $(TDATA)
d382 1
a382 2
		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) \
			-L leapseconds $(TDATA)
d393 8
a400 15
right_posix:	right_only leapseconds
		rm -fr $(DESTDIR)$(TZDIR)-leaps
		ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-leaps || \
		  $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-leaps \
			-L leapseconds $(TDATA)
		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-posix \
			-L /dev/null $(TDATA)

posix_right:	posix_only leapseconds
		rm -fr $(DESTDIR)$(TZDIR)-posix
		ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-posix || \
		  $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-posix \
			-L /dev/null $(TDATA)
		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-leaps \
			-L leapseconds $(TDATA)
d404 5
a408 3
libtz.a:	$(LIBOBJS)
		$(AR) ru $@@ $(LIBOBJS)
		$(RANLIB) $@@
d439 1
a439 1
		rm -fr tzpublic
d444 1
a444 1
		rm -f leapseconds $(MANTXTS) *.asc *.tar.gz
d450 1
a450 14
		tarballs signatures

date.1.txt:	date.1
newctime.3.txt:	newctime.3
newstrftime.3.txt: newstrftime.3
newtzset.3.txt:	newtzset.3
time2posix.3.txt: time2posix.3
tzfile.5.txt:	tzfile.5
tzselect.8.txt:	tzselect.8
zdump.8.txt:	zdump.8
zic.8.txt:	zic.8

$(MANTXTS):	workman.sh
		LC_ALL=C sh workman.sh `expr $@@ : '\(.*\)\.txt$$'` >$@@
d456 10
a465 21
# If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
# Also, set the timestamp of each prebuilt file like 'leapseconds'
# to be the maximum of the files it depends on.
set-timestamps.out: $(ENCHILADA)
		rm -f $@@
		if files=`git ls-files $(ENCHILADA)` && \
		   touch -md @@1 test.out; then \
		  rm -f test.out && \
		  for file in $$files; do \
		    if git diff --quiet $$file; then \
		      time=`git log -1 --format='tformat:%ct' $$file` && \
		      touch -cmd @@$$time $$file; \
		    else \
		      echo >&2 "$$file: warning: does not match repository"; \
		    fi || exit; \
		  done; \
		fi
		touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds
		for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \
		  touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
		    exit; \
a466 1
		touch $@@
d473 1
a473 1
		make "CFLAGS=$(GCC_DEBUG_FLAGS)" $(ENCHILADA) all
d479 1
a479 1
		rm -fr tzpublic
d484 1
d487 1
a487 1
		  mkdir -p tzpublic/$$type && \
d508 1
a508 1
		rm -fr tzpublic
d512 5
a516 1
tzcode$(VERSION).tar.gz: set-timestamps.out
d519 1
a519 1
		    $(COMMON) $(DOCS) $(SOURCES) $(MISC) | \
d522 1
a522 1
tzdata$(VERSION).tar.gz: set-timestamps.out
d537 1
a537 1
		for i in "long long" unsigned; \
@


1.1.1.11
log
@Import tzdata2014c from ftp://ftp.iana.org/tz/releases/tzcode2014c.tar.gz

Changes from tzdata2013i to tzdata2014a:

     Turkey begins DST on 2014-03-31, not 03-30.

     Fiji ended DST on 2014-01-19 at 02:00, not 03:00.

     Ukraine switched from Moscow to Eastern European time on 1990-07-01
     (not 1992-01-01), and observed DST during the entire next winter.

     In 1988 Israel observed DST from 04-10 to 09-04, not 04-09 to
     09-03.

     Also some changes affecting commentary and documentation

Changes from tzdata2014a to tzdata2014b:

     Crimea switches to Moscow time on 2014-03-30 at 02:00 local time.

     New entry for Troll station, Antarctica.

     Also some changes affecting commentary and documentation

Changes from tzdata2014b to tzdata2014c:

     Egypt observes DST starting 2014-05-15 at 24:00.
     Guess that DST will stop during the same Ramadan dates as Morocco,
     and make some other guesses.

     Also some changes affecting commentary and documentation
@
text
@d9 1
a9 1
VERSION=	2014c
d139 1
a139 1
	-Wnested-externs -Wno-address -Wno-cast-qual \
d249 2
a250 2
# The path where SGML DTDs are kept and the catalog file(s) to use when
# validating.  The default is appropriate for Ubuntu 13.10.
d254 3
a256 2
SGML_CATALOG_FILES= \
  $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat
d447 1
a447 1
		  date tzselect version.h zdump zic yearistype libtz.a
@


1.1.1.12
log
@Import tzdata2014e from ftp://ftp.iana.org/tz/releases/tzdata2014e.tar.gz

Summary of changes in tzdata2014e (2014-06-12 21:53:52 -0700):
  * Egypt's 2014 Ramadan-based transitions are June 26 and July 31 at 24:00.
    (Thanks to Imed Chihi.)  Guess that from 2015 on Egypt will temporarily
    switch to standard time at 24:00 the last Thursday before Ramadan, and
    back to DST at 00:00 the first Friday after Ramadan.
  * Similarly, Morocco's are June 28 at 03:00 and August 2 at 02:00.  (Thanks
    to Milamber Space Network.)  Guess that from 2015 on Morocco will
    temporarily switch to standard time at 03:00 the last Saturday before
    Ramadan, and back to DST at 02:00 the first Saturday after Ramadan.
  * The abbreviation "MSM" (Moscow Midsummer Time) is now used instead of
    "MSD" for Moscow's double daylight time in summer 1921.  Also, a typo
    "VLASST" has been repaired to be "VLAST" for Vladivostok summer time
    in 1991.  (Thanks to Hank W. for reporting the problems.)
  * Changes affecting commentary.

Summary of changes in tzdata2014d (2014-05-27 21:34:40 -0700):
  * Changes affecting documentation.
@
text
@d9 1
a9 1
VERSION=	2014e
a102 1
#  -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
@


1.1.1.13
log
@Import tzdata2014f from ftp://ftp.iana.org/tz/releases/tzdata2014f.tar.gz

Summary of changes in tzdata2014f (2014-08-05 17:42:36 -0700):
  * Russia will subtract an hour from most of its time zones on 2014-10-26
    at 02:00 local time.  There are some exception.
  * The following new zones are added to deal with changes in Russia:
    Asia/Chita and Asia/Srednekolymsk.
  * Australian eastern time zone abbreviations are now AEST/AEDT not EST,
    and similarly for the other Australian zones.
  * Asia/Novokuznetsk shifts from NOVT to KRAT (remaining on UTC+7)
    effective 2014-10-26 at 02:00 local time.
  * The time zone abbreviation for Xinjiang Time (observed in Ürümqi)
    has been changed from URUT to XJT.
  * Prefer MSK/MSD for Moscow time in Russia, even in other cities.
  * Change time zone abbreviations in (western) Samoa to use "ST" and
    "DT" suffixes, as this is more likely to match common practice.
  * America/Metlakatla now uses PST, not MeST, to abbreviate its time zone.
  * Time zone abbreviations have been updated for Japan's two time
    zones used 1896-1937.
  * China's five zones have been simplified to two, since the post-1970
    differences in the other three seem to have been imaginary.  The
    zones Asia/Harbin, Asia/Chongqing, and Asia/Kashgar have been
    removed; backwards-compatibility links still work, albeit with
    different behaviors for time stamps before May 1980.  Asia/Urumqi's
    1980 transition to UTC+8 has been removed, so that it is now at
    UTC+6 and not UTC+8.
  * Some zones have been turned into links, when they differed from existing
    zones only for older UTC offsets where the data were likely invented.
    The affected zones are: Africa/Bamako, Africa/Banjul,
    Africa/Conakry, Africa/Dakar, Africa/Freetown, Africa/Lome,
    Africa/Nouakchott, Africa/Ouagadougou, Africa/Sao_Tome, and
    Atlantic/St_Helena.  This also affects the backwards-compatibility
    link Africa/Timbuktu.
  * Asia/Shanghai's pre-standard-time UT offset has been changed from
    8:05:57 to 8:05:43, the location of Xujiahui Observatory.  Its
    transition to standard time has been changed from 1928 to 1901.
  * Asia/Taipei switched to JWST on 1896-01-01, then to JST on 1937-10-01,
    then to CST on 1945-09-21 at 01:00, and did not observe DST in 1945.
    In 1946 it observed DST from 05-15 through 09-30; in 1947
    from 04-15 through 10-31; and in 1979 from 07-01 through 09-30.
  * Asia/Riyadh's transition to standard time is now 1947-03-14, not 1950.
  * Europe/Helsinki's 1942 fall-back transition was 1942-10-04 at 01:00, not
    1942-10-03 at 00:00.
  * Pacific/Pago_Pago has been changed from UTC-11:30 to UTC-11 for the period
    from 1911 to 1950.
  * Pacific/Chatham has been changed to New Zealand standard time plus
    45 minutes for the period before 1957, reflecting a 1956 remark in
    the New Zealand parliament.
  * Europe/Budapest has several pre-1946 corrections.
  * Africa/Accra is now assumed to have observed DST from 1920 through 1935.
  * Time in Russia before 1927 or so has been corrected by a few seconds in
    the following zones: Europe/Moscow, Asia/Irkutsk, Asia/Tbilisi,
    Asia/Tashkent, Asia/Vladivostok, Asia/Yekaterinburg, Europe/Helsinki, and
    Europe/Riga.
  * A new file 'zone1970.tab' supersedes 'zone.tab' in the installed data.
    The new file's extended format allows multiple country codes per zone.
    The older file is still installed but is deprecated; its format is
    not changing and it will still be distributed for a while, but new
    applications should use the new file.
  * The file 'iso3166.tab' is planned to switch from ASCII to UTF-8.
    It is still ASCII now, but commentary about the switch has been added.
  * Changes affecting documentation and commentary.
@
text
@d1 1
d9 1
a9 1
VERSION=	2014f
d99 1
a99 1
# Add -lintl if you want to use 'gettext' on Solaris.
d104 1
a104 1
#  -DHAVE_ADJTIME=0 if 'adjtime' does not exist (SVR0?)
d106 1
a106 1
#  -DHAVE_GETTEXT=1 if 'gettext' works (GNU, Linux, Solaris); also see LDLIBS
d127 1
a127 1
#  -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
d138 1
a138 2
	-Wdeclaration-after-statement \
	-Wformat=2 -Winit-self -Wjump-misses-init \
d145 1
a145 2
	-Wsuggest-attribute=format -Wsuggest-attribute=noreturn \
	-Wsuggest-attribute=pure -Wtrampolines \
d239 1
a239 1
# The name of a Posix-compliant 'awk' on your system.
d269 2
a270 4
# SAFE_CHAR is a regular expression that matches a safe character.
# Some parts of this distribution are limited to safe characters;
# others can use any UTF-8 character.
# For now, the safe characters are a safe subset of ASCII.
d275 4
a278 20
SAFE_CHARSET1=	$(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@@'
SAFE_CHARSET2=	'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
SAFE_CHARSET3=	'abcdefghijklmnopqrstuvwxyz{|}~'
SAFE_CHARSET=	]$(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)-
SAFE_CHAR=	'['$(SAFE_CHARSET)']'
# NONSYM_CHAR is a regular expression that matches any character
# except for a small number of symbols, where we prefer to stick with
# ASCII renderings for the convenience of maintainers whose text editors
# mishandle UTF-8 by default (e.g., XEmacs 21.4.22).
NONSYM_CHAR=	'[^–—°′″≈≠≤≥±−×÷∞←→↔·•§¶«»‘’‚‛“”„‟‹›「」『』〝〞〟]'

# SAFE_LINE matches a line of safe characters.
# SAFE_SHARP_LINE is similar, except any character can follow '#';
# this is so that comments can contain non-ASCII characters.
# NONSYM_LINE matches a line of non-symbols.
# VALID_LINE matches a line of any validly-encoded characters.
SAFE_LINE=	'^'$(SAFE_CHAR)'*$$'
SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(NONSYM_CHAR)'*)?$$'
NONSYM_LINE=	'^'$(NONSYM_CHAR)'*$$'
VALID_LINE=	'^.*$$'
d301 1
a301 1
TZCOBJS=	zic.o scheck.o ialloc.o
d317 1
a317 2
WEB_PAGES=	tz-art.htm tz-link.htm
DOCS=		NEWS Theory $(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
d323 1
a323 2
ZONETABLES=	zone1970.tab zone.tab
TABDATA=	iso3166.tab leapseconds $(ZONETABLES)
d327 1
d329 3
a331 1
MISC=		$(AWK_SCRIPTS) workman.sh zoneinfo2tdf.pl
d350 1
a350 1
		cp -f iso3166.tab $(ZONETABLES) $(DESTDIR)$(TZDIR)/.
d437 4
a440 16
		LC_ALL=en_US.utf8 && export LC_ALL && \
		sharp='#' && \
		! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
			$(MISC) $(SOURCES) $(WEB_PAGES) && \
		! grep -Env $(SAFE_SHARP_LINE) $(YDATA) $(NDATA) iso3166.tab \
			zone.tab leapseconds $(LEAP_DEPS) yearistype.sh && \
		test $$(grep -Ecv $(SAFE_SHARP_LINE) Makefile) -eq 1 && \
		! grep -Env $(NONSYM_LINE) README NEWS Theory $(MANS) date.1 \
			zone1970.tab && \
		! grep -Env $(VALID_LINE) $(ENCHILADA)

check_tables:	checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
		for tab in $(ZONETABLES); do \
		  $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
		    || exit; \
		done
d519 1
a519 1
		zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
a587 7

.PHONY: ALL INSTALL all
.PHONY: check check_character_set check_public check_tables
.PHONY: check_time_t_alternatives check_web clean clean_misc
.PHONY: install maintainer-clean names posix_only posix_right
.PHONY: public right_only right_posix signatures tarballs typecheck
.PHONY: zonenames zones
@


