]>
Commit | Line | Data |
---|---|---|
d4697bc9 | 1 | # Copyright (C) 1998-2014 Free Software Foundation, Inc. |
14ea22e9 UD |
2 | # This file is part of the GNU C Library. |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
5 | # modify it under the terms of the GNU Lesser General Public |
6 | # License as published by the Free Software Foundation; either | |
7 | # version 2.1 of the License, or (at your option) any later version. | |
14ea22e9 UD |
8 | |
9 | # The GNU C Library is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
14ea22e9 | 13 | |
41bdb6e2 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
15 | # License along with the GNU C Library; if not, see |
16 | # <http://www.gnu.org/licenses/>. | |
14ea22e9 UD |
17 | |
18 | # | |
19 | # Makefile for timezone information | |
20 | # | |
21 | subdir := timezone | |
22 | ||
a5f891ac JM |
23 | include ../Makeconfig |
24 | ||
14ea22e9 UD |
25 | extra-objs := scheck.o ialloc.o |
26 | ||
27 | others := zdump zic | |
ff152e3f | 28 | tests := test-tz tst-timezone |
14ea22e9 | 29 | |
a4300c7a UD |
30 | # pacificnew doesn't compile; if it is to be used, it should be included in |
31 | # northamerica. | |
14ea22e9 | 32 | tzbases := africa antarctica asia australasia europe northamerica \ |
bdff0a44 | 33 | southamerica etcetera factory \ |
14ea22e9 | 34 | solar87 solar88 solar89 |
bdff0a44 | 35 | tzlinks := backward systemv |
14ea22e9 | 36 | tzfiles := $(tzbases) $(tzlinks) |
14ea22e9 | 37 | |
f08e9a26 | 38 | generated += $(addprefix z.,$(tzfiles)) |
14ea22e9 UD |
39 | install-sbin := zic zdump |
40 | ||
f08e9a26 | 41 | generated-dirs += testdata |
14ea22e9 | 42 | |
3ba06713 UD |
43 | CPPFLAGS-zic = -DNOT_IN_libc |
44 | ||
6c3ebebd | 45 | install-bin-script = tzselect |
14ea22e9 | 46 | generated += tzselect |
14ea22e9 | 47 | |
6f99f280 JM |
48 | testdata = $(objpfx)testdata |
49 | ||
50 | # List zones generated by separate commands running zic on the host. | |
51 | # Each such zic run counts as a separate test. | |
52 | test-zones := America/New_York Etc/UTC UTC Europe/Berlin \ | |
53 | Australia/Melbourne America/Sao_Paulo Asia/Tokyo | |
54 | tests-special += $(addprefix $(testdata)/, $(test-zones)) | |
55 | ||
14ea22e9 UD |
56 | include ../Rules |
57 | ||
58 | ||
14ea22e9 UD |
59 | $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o |
60 | ||
9ec6f8bd JM |
61 | $(objpfx)zic.o $(objpfx)zdump.o: $(objpfx)version.h |
62 | ||
63 | $(objpfx)version.h: $(common-objpfx)config.make | |
e27d476a | 64 | echo 'static char const TZVERSION[]="$(version)";' \ |
9ec6f8bd JM |
65 | > $@.new |
66 | mv -f $@.new $@ | |
67 | ||
14ea22e9 UD |
68 | tz-cflags = -DTZDIR='"$(zonedir)"' \ |
69 | -DTZDEFAULT='"$(localtime-file)"' \ | |
a709dd43 UD |
70 | -DTZDEFRULES='"$(posixrules-file)"' \ |
71 | -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone | |
14ea22e9 | 72 | |
701666b7 UD |
73 | CFLAGS-zdump.c = -fwrapv -Wno-strict-prototypes -DNOID $(tz-cflags) \ |
74 | -DHAVE_GETTEXT | |
db49e90c UD |
75 | CFLAGS-zic.c = -Wno-strict-prototypes -DNOID $(tz-cflags) -DHAVE_GETTEXT |
76 | CFLAGS-ialloc.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT | |
77 | CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT | |
14ea22e9 UD |
78 | |
79 | # We have to make sure the data for testing the tz functions is available. | |
07435eb4 UD |
80 | # Don't add leapseconds here since test-tz made checks that work only without |
81 | # leapseconds. | |
298f2566 | 82 | define build-testdata |
71d82dbe | 83 | GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \ |
6f99f280 JM |
84 | $(built-program-cmd) -d $(testdata) -y ./yearistype $<; \ |
85 | $(evaluate-test) | |
298f2566 | 86 | endef |
14ea22e9 | 87 | |
298f2566 UD |
88 | $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC) |
89 | $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \ | |
90 | Europe/Berlin Universal \ | |
91 | Australia/Melbourne \ | |
390955cb UD |
92 | America/Sao_Paulo Asia/Tokyo \ |
93 | Europe/London) | |
298f2566 UD |
94 | |
95 | test-tz-ENV = TZDIR=$(testdata) | |
96 | tst-timezone-ENV = TZDIR=$(testdata) | |
97 | ||
21cee297 RM |
98 | # Note this must come second in the deps list for $(built-program-cmd) to work. |
99 | zic-deps = $(objpfx)zic $(leapseconds) yearistype | |
100 | ||
101 | $(testdata)/America/New_York: northamerica $(zic-deps) | |
298f2566 | 102 | $(build-testdata) |
21cee297 | 103 | $(testdata)/Etc/UTC: etcetera $(zic-deps) |
298f2566 | 104 | $(build-testdata) |
21cee297 RM |
105 | # Use a pattern rule to indicate the command produces both targets at once. |
106 | # Two separate targets built separately can collide if in parallel. | |
107 | %/UTC %/Universal: simplebackw $(zic-deps) %/Etc/UTC | |
298f2566 | 108 | $(build-testdata) |
21cee297 | 109 | $(testdata)/%/Berlin $(testdata)/%/London: europe $(zic-deps) |
298f2566 | 110 | $(build-testdata) |
21cee297 | 111 | $(testdata)/Australia/Melbourne: australasia $(zic-deps) |
298f2566 | 112 | $(build-testdata) |
21cee297 | 113 | $(testdata)/America/Sao_Paulo: southamerica $(zic-deps) |
90865aa8 | 114 | $(build-testdata) |
21cee297 | 115 | $(testdata)/Asia/Tokyo: asia $(zic-deps) |
a3e0e9ae | 116 | $(build-testdata) |
14ea22e9 UD |
117 | |
118 | ||
119 | $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make | |
73f79bb7 | 120 | sed -e 's|/bin/bash|$(BASH)|' \ |
c72399fb | 121 | -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \ |
e27d476a JM |
122 | -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \ |
123 | -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \ | |
124 | -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \ | |
0aa8f8a1 | 125 | < $< > $@.new |
14ea22e9 UD |
126 | chmod 555 $@.new |
127 | mv -f $@.new $@ |