]>
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 | ||
14ea22e9 UD |
23 | extra-objs := scheck.o ialloc.o |
24 | ||
25 | others := zdump zic | |
ff152e3f | 26 | tests := test-tz tst-timezone |
14ea22e9 | 27 | |
a4300c7a UD |
28 | # pacificnew doesn't compile; if it is to be used, it should be included in |
29 | # northamerica. | |
14ea22e9 | 30 | tzbases := africa antarctica asia australasia europe northamerica \ |
bdff0a44 | 31 | southamerica etcetera factory \ |
14ea22e9 | 32 | solar87 solar88 solar89 |
bdff0a44 | 33 | tzlinks := backward systemv |
14ea22e9 | 34 | tzfiles := $(tzbases) $(tzlinks) |
14ea22e9 | 35 | |
7551a1e5 | 36 | generated := $(addprefix z.,$(tzfiles)) |
14ea22e9 UD |
37 | install-sbin := zic zdump |
38 | ||
39 | generated-dirs = testdata | |
40 | ||
41 | all: # Make this the default target; it will be defined in Rules. | |
42 | ||
43 | include ../Makeconfig # Get objpfx defined so we can use it below. | |
44 | ||
3ba06713 UD |
45 | CPPFLAGS-zic = -DNOT_IN_libc |
46 | ||
14ea22e9 | 47 | ifeq ($(have-ksh),yes) |
6c3ebebd | 48 | install-bin-script = tzselect |
14ea22e9 UD |
49 | generated += tzselect |
50 | endif | |
51 | ||
52 | include ../Rules | |
53 | ||
54 | ||
14ea22e9 UD |
55 | $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o |
56 | ||
9ec6f8bd JM |
57 | $(objpfx)zic.o $(objpfx)zdump.o: $(objpfx)version.h |
58 | ||
59 | $(objpfx)version.h: $(common-objpfx)config.make | |
e27d476a | 60 | echo 'static char const TZVERSION[]="$(version)";' \ |
9ec6f8bd JM |
61 | > $@.new |
62 | mv -f $@.new $@ | |
63 | ||
14ea22e9 UD |
64 | tz-cflags = -DTZDIR='"$(zonedir)"' \ |
65 | -DTZDEFAULT='"$(localtime-file)"' \ | |
a709dd43 UD |
66 | -DTZDEFRULES='"$(posixrules-file)"' \ |
67 | -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone | |
14ea22e9 | 68 | |
701666b7 UD |
69 | CFLAGS-zdump.c = -fwrapv -Wno-strict-prototypes -DNOID $(tz-cflags) \ |
70 | -DHAVE_GETTEXT | |
db49e90c UD |
71 | CFLAGS-zic.c = -Wno-strict-prototypes -DNOID $(tz-cflags) -DHAVE_GETTEXT |
72 | CFLAGS-ialloc.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT | |
73 | CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT | |
14ea22e9 UD |
74 | |
75 | # We have to make sure the data for testing the tz functions is available. | |
07435eb4 UD |
76 | # Don't add leapseconds here since test-tz made checks that work only without |
77 | # leapseconds. | |
298f2566 UD |
78 | testdata = $(objpfx)testdata |
79 | define build-testdata | |
71d82dbe | 80 | GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \ |
55985355 | 81 | $(built-program-cmd) -d $(testdata) -y ./yearistype $< |
298f2566 | 82 | endef |
14ea22e9 | 83 | |
298f2566 UD |
84 | $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC) |
85 | $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \ | |
86 | Europe/Berlin Universal \ | |
87 | Australia/Melbourne \ | |
390955cb UD |
88 | America/Sao_Paulo Asia/Tokyo \ |
89 | Europe/London) | |
298f2566 UD |
90 | |
91 | test-tz-ENV = TZDIR=$(testdata) | |
92 | tst-timezone-ENV = TZDIR=$(testdata) | |
93 | ||
21cee297 RM |
94 | # Note this must come second in the deps list for $(built-program-cmd) to work. |
95 | zic-deps = $(objpfx)zic $(leapseconds) yearistype | |
96 | ||
97 | $(testdata)/America/New_York: northamerica $(zic-deps) | |
298f2566 | 98 | $(build-testdata) |
21cee297 | 99 | $(testdata)/Etc/UTC: etcetera $(zic-deps) |
298f2566 | 100 | $(build-testdata) |
21cee297 RM |
101 | # Use a pattern rule to indicate the command produces both targets at once. |
102 | # Two separate targets built separately can collide if in parallel. | |
103 | %/UTC %/Universal: simplebackw $(zic-deps) %/Etc/UTC | |
298f2566 | 104 | $(build-testdata) |
21cee297 | 105 | $(testdata)/%/Berlin $(testdata)/%/London: europe $(zic-deps) |
298f2566 | 106 | $(build-testdata) |
21cee297 | 107 | $(testdata)/Australia/Melbourne: australasia $(zic-deps) |
298f2566 | 108 | $(build-testdata) |
21cee297 | 109 | $(testdata)/America/Sao_Paulo: southamerica $(zic-deps) |
90865aa8 | 110 | $(build-testdata) |
21cee297 | 111 | $(testdata)/Asia/Tokyo: asia $(zic-deps) |
a3e0e9ae | 112 | $(build-testdata) |
14ea22e9 UD |
113 | |
114 | ||
115 | $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make | |
0aa8f8a1 JM |
116 | sed -e 's|/bin/bash|$(KSH)|g' \ |
117 | -e '/TZDIR=/s|\$$(pwd)|$(zonedir)|' \ | |
e27d476a JM |
118 | -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \ |
119 | -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \ | |
120 | -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \ | |
0aa8f8a1 | 121 | < $< > $@.new |
14ea22e9 UD |
122 | chmod 555 $@.new |
123 | mv -f $@.new $@ |