Update copyright years
[glibc.git] / timezone / Makefile
blob9e55a6ac54aba289a0fbc5a14858ba120c0b9eeb
1 # Copyright (C) 1998-2000,2002,2005,2007,2012 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 ifeq ($(have-ksh),yes)
48 install-bin-script = tzselect
49 generated += tzselect
50 endif
52 include ../Rules
55 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
57 tz-cflags = -DTZDIR='"$(zonedir)"' \
58 -DTZDEFAULT='"$(localtime-file)"' \
59 -DTZDEFRULES='"$(posixrules-file)"' \
60 -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
62 CFLAGS-zdump.c = -fwrapv -Wno-strict-prototypes -DNOID $(tz-cflags) \
63 -DHAVE_GETTEXT
64 CFLAGS-zic.c = -Wno-strict-prototypes -DNOID $(tz-cflags) -DHAVE_GETTEXT
65 CFLAGS-ialloc.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
66 CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
68 # We have to make sure the data for testing the tz functions is available.
69 # Don't add leapseconds here since test-tz made checks that work only without
70 # leapseconds.
71 testdata = $(objpfx)testdata
72 define build-testdata
73 GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
74 $(built-program-cmd) -d $(testdata) -y ./yearistype $<
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)
84 test-tz-ENV = TZDIR=$(testdata)
85 tst-timezone-ENV = TZDIR=$(testdata)
87 # Note this must come second in the deps list for $(built-program-cmd) to work.
88 zic-deps = $(objpfx)zic $(leapseconds) yearistype
90 $(testdata)/America/New_York: northamerica $(zic-deps)
91 $(build-testdata)
92 $(testdata)/Etc/UTC: etcetera $(zic-deps)
93 $(build-testdata)
94 # Use a pattern rule to indicate the command produces both targets at once.
95 # Two separate targets built separately can collide if in parallel.
96 %/UTC %/Universal: simplebackw $(zic-deps) %/Etc/UTC
97 $(build-testdata)
98 $(testdata)/%/Berlin $(testdata)/%/London: europe $(zic-deps)
99 $(build-testdata)
100 $(testdata)/Australia/Melbourne: australasia $(zic-deps)
101 $(build-testdata)
102 $(testdata)/America/Sao_Paulo: southamerica $(zic-deps)
103 $(build-testdata)
104 $(testdata)/Asia/Tokyo: asia $(zic-deps)
105 $(build-testdata)
108 $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
109 sed -e 's%@KSH@%$(KSH)%g' \
110 -e 's%@TZDIR@%$(zonedir)%g' < $< > $@.new
111 chmod 555 $@.new
112 mv -f $@.new $@