Stop io/ftwtest deleting its own output.
[glibc.git] / timezone / Makefile
blob6c640fd1447fd9d680d47f54c0d655700e38cec3
1 # Copyright (C) 1998-2014 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 extra-objs := scheck.o ialloc.o
25 others := zdump zic
26 tests := test-tz tst-timezone
28 # pacificnew doesn't compile; if it is to be used, it should be included in
29 # northamerica.
30 tzbases := africa antarctica asia australasia europe northamerica \
31 southamerica etcetera factory \
32 solar87 solar88 solar89
33 tzlinks := backward systemv
34 tzfiles := $(tzbases) $(tzlinks)
36 generated := $(addprefix z.,$(tzfiles))
37 install-sbin := zic zdump
39 generated-dirs = testdata
41 all: # Make this the default target; it will be defined in Rules.
43 include ../Makeconfig # Get objpfx defined so we can use it below.
45 CPPFLAGS-zic = -DNOT_IN_libc
47 install-bin-script = tzselect
48 generated += tzselect
50 include ../Rules
53 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
55 $(objpfx)zic.o $(objpfx)zdump.o: $(objpfx)version.h
57 $(objpfx)version.h: $(common-objpfx)config.make
58 echo 'static char const TZVERSION[]="$(version)";' \
59 > $@.new
60 mv -f $@.new $@
62 tz-cflags = -DTZDIR='"$(zonedir)"' \
63 -DTZDEFAULT='"$(localtime-file)"' \
64 -DTZDEFRULES='"$(posixrules-file)"' \
65 -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
67 CFLAGS-zdump.c = -fwrapv -Wno-strict-prototypes -DNOID $(tz-cflags) \
68 -DHAVE_GETTEXT
69 CFLAGS-zic.c = -Wno-strict-prototypes -DNOID $(tz-cflags) -DHAVE_GETTEXT
70 CFLAGS-ialloc.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
71 CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
73 # We have to make sure the data for testing the tz functions is available.
74 # Don't add leapseconds here since test-tz made checks that work only without
75 # leapseconds.
76 testdata = $(objpfx)testdata
77 define build-testdata
78 GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
79 $(built-program-cmd) -d $(testdata) -y ./yearistype $<
80 endef
82 $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
83 $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
84 Europe/Berlin Universal \
85 Australia/Melbourne \
86 America/Sao_Paulo Asia/Tokyo \
87 Europe/London)
89 test-tz-ENV = TZDIR=$(testdata)
90 tst-timezone-ENV = TZDIR=$(testdata)
92 # Note this must come second in the deps list for $(built-program-cmd) to work.
93 zic-deps = $(objpfx)zic $(leapseconds) yearistype
95 $(testdata)/America/New_York: northamerica $(zic-deps)
96 $(build-testdata)
97 $(testdata)/Etc/UTC: etcetera $(zic-deps)
98 $(build-testdata)
99 # Use a pattern rule to indicate the command produces both targets at once.
100 # Two separate targets built separately can collide if in parallel.
101 %/UTC %/Universal: simplebackw $(zic-deps) %/Etc/UTC
102 $(build-testdata)
103 $(testdata)/%/Berlin $(testdata)/%/London: europe $(zic-deps)
104 $(build-testdata)
105 $(testdata)/Australia/Melbourne: australasia $(zic-deps)
106 $(build-testdata)
107 $(testdata)/America/Sao_Paulo: southamerica $(zic-deps)
108 $(build-testdata)
109 $(testdata)/Asia/Tokyo: asia $(zic-deps)
110 $(build-testdata)
113 $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
114 sed -e 's|/bin/bash|$(BASH)|' \
115 -e '/TZDIR=/s|\$$(pwd)|$(zonedir)|' \
116 -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
117 -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
118 -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
119 < $< > $@.new
120 chmod 555 $@.new
121 mv -f $@.new $@