powerpc: Fix __fesetround_inline_nocheck on POWER9+ (BZ 31682)
[glibc.git] / timezone / Makefile
blobcf4ef3bf7e31b4b2aa204c09b6c3c7aef47e9fdb
1 # Copyright (C) 1998-2024 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
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.
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
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
19 # Makefile for timezone information
21 subdir := timezone
23 include ../Makeconfig
25 others := zdump zic
26 tests := test-tz tst-timezone tst-tzset tst-bz28707 tst-bz29951
28 generated-dirs += testdata
30 generated += tzselect
32 testdata = $(objpfx)testdata
34 ifeq ($(enable-timezone-tools),yes)
35 install-sbin := zic
36 install-bin := zdump
37 install-bin-script = tzselect
38 endif
40 ifeq ($(run-built-tests),yes)
41 # List zones generated by separate commands running zic on the host.
42 # Each such zic run counts as a separate test.
43 test-zones := America/New_York Etc/UTC UTC Europe/Berlin \
44 Australia/Melbourne America/Sao_Paulo Asia/Tokyo \
45 $(posixrules-file)
46 tests-special += $(addprefix $(testdata)/, $(test-zones))
47 endif
49 include ../Rules
52 $(objpfx)zic.o: $(objpfx)tzdir.h
54 # In glibc this file is an empty placeholder,
55 # as tz-cflags defines TZDEFAULT and TZDIR.
56 $(objpfx)tzdir.h:
57 > $@
59 $(objpfx)zic.o $(objpfx)zdump.o: $(objpfx)version.h
61 $(objpfx)version.h: $(common-objpfx)config.make
62 echo 'static char const TZVERSION[]="$(version)";' \
63 > $@.new
64 mv -f $@.new $@
66 tz-cflags = -DTZDIR='"$(zonedir)"' \
67 -DTZDEFAULT='"$(localtime-file)"' \
68 -DTZDEFRULES='"$(posixrules-file)"' \
69 -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone \
70 -DHAVE_GETTEXT -DUSE_LTZ=0 -D_ISOMAC -DTZ_DOMAIN='"libc"' \
71 -include $(common-objpfx)config.h -Wno-maybe-uninitialized
73 # The -Wno-unused-variable flag is used to prevent GCC 6
74 # from warning about time_t_min and time_t_max which are
75 # defined in private.h but not used.
76 CFLAGS-zdump.c += $(tz-cflags)
77 CFLAGS-zic.c += $(tz-cflags) -Wno-unused-variable
79 # We have to make sure the data for testing the tz functions is available.
80 # Don't add leapseconds here since test-tz made checks that work only without
81 # leapseconds.
82 define build-testdata
83 $(built-program-cmd) -d $(testdata) -y ./yearistype $<; \
84 $(evaluate-test)
85 endef
87 $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
88 $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
89 Europe/Berlin Universal \
90 Australia/Melbourne \
91 America/New_York \
92 America/Sao_Paulo Asia/Tokyo \
93 Europe/London)
94 $(objpfx)tst-tzset.out: $(addprefix $(testdata)/XT, 1 2 3 4)
95 $(objpfx)tst-bz28707.out: $(testdata)/XT5
96 $(objpfx)tst-bz29951.out: $(testdata)/XT6
98 test-tz-ENV = TZDIR=$(testdata)
99 tst-timezone-ENV = TZDIR=$(testdata)
100 tst-tzset-ENV = TZDIR=$(testdata)
101 tst-bz28707-ENV = TZDIR=$(testdata)
102 tst-bz29951-ENV = TZDIR=$(testdata)
104 # Note this must come second in the deps list for $(built-program-cmd) to work.
105 zic-deps = $(objpfx)zic $(leapseconds) yearistype
107 $(testdata)/America/New_York: northamerica $(zic-deps)
108 $(build-testdata)
109 $(testdata)/$(posixrules-file): $(testdata)/America/New_York
110 $(make-link); $(evaluate-test)
111 $(testdata)/Etc/UTC: etcetera $(zic-deps)
112 $(build-testdata)
113 # Use a pattern rule to indicate the command produces both targets at once.
114 # Two separate targets built separately can collide if in parallel.
115 %/UTC %/Universal: simplebackw $(zic-deps) %/Etc/UTC
116 $(build-testdata)
117 { test -r $(@D)/Universal.test-result \
118 && cp $(@D)/Universal.test-result $(@D)/UTC.test-result \
119 && sed -i 's/Universal/UTC/' $(@D)/UTC.test-result ; exit 0; }
120 { test -r $(@D)/UTC.test-result \
121 && cp $(@D)/UTC.test-result $(@D)/Universal.test-result \
122 && sed -i 's/UTC/Universal/' $(@D)/Universal.test-result ; exit 0; }
123 $(testdata)/%/Berlin $(testdata)/%/London: europe $(zic-deps)
124 $(build-testdata)
125 $(testdata)/Australia/Melbourne: australasia $(zic-deps)
126 $(build-testdata)
127 $(testdata)/America/Sao_Paulo: southamerica $(zic-deps)
128 $(build-testdata)
129 $(testdata)/Asia/Tokyo: asia $(zic-deps)
130 $(build-testdata)
132 $(testdata)/XT%: testdata/XT%
133 $(make-target-directory)
134 cp $< $@
136 $(testdata)/XT5: testdata/gen-XT5.sh
137 $(make-target-directory)
138 $(SHELL) $< > $@.tmp
139 mv $@.tmp $@
141 $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
142 sed -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
143 -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
144 -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
145 -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
146 < $< > $@.new
147 chmod 555 $@.new
148 mv -f $@.new $@