Meaningless ChangeLog cleanup to trigger buildbot.
[glibc.git] / timezone / Makefile
blob81d4a3e0b52bb762fe90e35e5aef568dce470a46
1 # Copyright (C) 1998-2015 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 # <http://www.gnu.org/licenses/>.
19 # Makefile for timezone information
21 subdir := timezone
23 include ../Makeconfig
25 extra-objs := scheck.o ialloc.o
27 others := zdump zic
28 tests := test-tz tst-timezone tst-tzset
30 install-sbin := zic zdump
32 generated-dirs += testdata
34 install-bin-script = tzselect
35 generated += tzselect
37 testdata = $(objpfx)testdata
39 ifeq ($(run-built-tests),yes)
40 # List zones generated by separate commands running zic on the host.
41 # Each such zic run counts as a separate test.
42 test-zones := America/New_York Etc/UTC UTC Europe/Berlin \
43 Australia/Melbourne America/Sao_Paulo Asia/Tokyo
44 tests-special += $(addprefix $(testdata)/, $(test-zones))
45 endif
47 include ../Rules
50 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
52 $(objpfx)zic.o $(objpfx)zdump.o: $(objpfx)version.h
54 $(objpfx)version.h: $(common-objpfx)config.make
55 echo 'static char const TZVERSION[]="$(version)";' \
56 > $@.new
57 mv -f $@.new $@
59 tz-cflags = -DTZDIR='"$(zonedir)"' \
60 -DTZDEFAULT='"$(localtime-file)"' \
61 -DTZDEFRULES='"$(posixrules-file)"' \
62 -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
64 CFLAGS-zdump.c = -fwrapv -DNOID $(tz-cflags) -DHAVE_GETTEXT
65 CFLAGS-zic.c = -DNOID $(tz-cflags) -DHAVE_GETTEXT
66 CFLAGS-ialloc.c = -DNOID -DHAVE_GETTEXT
67 CFLAGS-scheck.c = -DNOID -DHAVE_GETTEXT
69 # We have to make sure the data for testing the tz functions is available.
70 # Don't add leapseconds here since test-tz made checks that work only without
71 # leapseconds.
72 define build-testdata
73 $(built-program-cmd) -d $(testdata) -y ./yearistype $<; \
74 $(evaluate-test)
75 endef
77 $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
78 $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
79 Europe/Berlin Universal \
80 Australia/Melbourne \
81 America/Sao_Paulo Asia/Tokyo \
82 Europe/London)
83 $(objpfx)tst-tzset.out: $(addprefix $(testdata)/XT, 1 2 3 4)
85 test-tz-ENV = TZDIR=$(testdata)
86 tst-timezone-ENV = TZDIR=$(testdata)
87 tst-tzset-ENV = TZDIR=$(testdata)
89 # Note this must come second in the deps list for $(built-program-cmd) to work.
90 zic-deps = $(objpfx)zic $(leapseconds) yearistype
92 $(testdata)/America/New_York: northamerica $(zic-deps)
93 $(build-testdata)
94 $(testdata)/Etc/UTC: etcetera $(zic-deps)
95 $(build-testdata)
96 # Use a pattern rule to indicate the command produces both targets at once.
97 # Two separate targets built separately can collide if in parallel.
98 %/UTC %/Universal: simplebackw $(zic-deps) %/Etc/UTC
99 $(build-testdata)
100 { test -r $(@D)/Universal.test-result \
101 && cp $(@D)/Universal.test-result $(@D)/UTC.test-result \
102 && sed -i 's/Universal/UTC/' $(@D)/UTC.test-result ; exit 0; }
103 { test -r $(@D)/UTC.test-result \
104 && cp $(@D)/UTC.test-result $(@D)/Universal.test-result \
105 && sed -i 's/UTC/Universal/' $(@D)/Universal.test-result ; exit 0; }
106 $(testdata)/%/Berlin $(testdata)/%/London: europe $(zic-deps)
107 $(build-testdata)
108 $(testdata)/Australia/Melbourne: australasia $(zic-deps)
109 $(build-testdata)
110 $(testdata)/America/Sao_Paulo: southamerica $(zic-deps)
111 $(build-testdata)
112 $(testdata)/Asia/Tokyo: asia $(zic-deps)
113 $(build-testdata)
115 $(testdata)/XT%: testdata/XT%
116 cp $< $@
118 $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
119 sed -e 's|/bin/bash|$(BASH)|' \
120 -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
121 -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
122 -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
123 -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
124 < $< > $@.new
125 chmod 555 $@.new
126 mv -f $@.new $@