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
23 distribute := tzfile.h private.h scheck.c ialloc.c yearistype \
24 iso3166.tab zone.tab tzselect.ksh checktab.awk \
27 extra-objs := scheck.o ialloc.o
30 tests := test-tz tst-timezone
32 tzbases := africa antarctica asia australasia europe northamerica \
33 southamerica etcetera factory \
34 solar87 solar88 solar89
35 tzlinks := backward systemv
36 tzfiles := $(tzbases) $(tzlinks)
37 # pacificnew doesn't compile; if it is to be used, it should be included in
39 distribute += $(tzfiles) leapseconds pacificnew simplebackw
41 generated := $(addprefix z.,$(tzfiles))
42 install-sbin := zic zdump
44 generated-dirs = testdata
46 all: # Make this the default target; it will be defined in Rules.
48 include ../Makeconfig # Get objpfx defined so we can use it below.
50 CPPFLAGS-zic = -DNOT_IN_libc
52 ifeq ($(have-ksh),yes)
53 install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
54 install-bin-script = tzselect
61 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
63 tz-cflags = -DTZDIR='"$(zonedir)"' \
64 -DTZDEFAULT='"$(localtime-file)"' \
65 -DTZDEFRULES='"$(posixrules-file)"' \
66 -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
68 CFLAGS-zdump.c = -fwrapv -Wno-strict-prototypes -DNOID $(tz-cflags) \
70 CFLAGS-zic.c = -Wno-strict-prototypes -DNOID $(tz-cflags) -DHAVE_GETTEXT
71 CFLAGS-ialloc.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
72 CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
74 # We have to make sure the data for testing the tz functions is available.
75 # Don't add leapseconds here since test-tz made checks that work only without
77 testdata = $(objpfx)testdata
79 GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
80 $(built-program-cmd) -d $(testdata) -y ./yearistype $<
83 $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
84 $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
85 Europe/Berlin Universal \
87 America/Sao_Paulo Asia/Tokyo \
90 test-tz-ENV = TZDIR=$(testdata)
91 tst-timezone-ENV = TZDIR=$(testdata)
93 # Note this must come second in the deps list for $(built-program-cmd) to work.
94 zic-deps = $(objpfx)zic $(leapseconds) yearistype
96 $(testdata)/America/New_York: northamerica $(zic-deps)
98 $(testdata)/Etc/UTC: etcetera $(zic-deps)
100 # Use a pattern rule to indicate the command produces both targets at once.
101 # Two separate targets built separately can collide if in parallel.
102 %/UTC %/Universal: simplebackw $(zic-deps) %/Etc/UTC
104 $(testdata)/%/Berlin $(testdata)/%/London: europe $(zic-deps)
106 $(testdata)/Australia/Melbourne: australasia $(zic-deps)
108 $(testdata)/America/Sao_Paulo: southamerica $(zic-deps)
110 $(testdata)/Asia/Tokyo: asia $(zic-deps)
114 $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
115 sed -e 's%@KSH@%$(KSH)%g' \
116 -e 's%@TZDIR@%$(zonedir)%g' < $< > $@.new
120 $(addprefix $(inst_zonedir)/,iso3166.tab zone.tab): \
121 $(inst_zonedir)/%: % $(+force)