Don't install timezone rule files
[platform/upstream/glibc.git] / timezone / Makefile
1 # Copyright (C) 1998-2000,2002,2005,2007,2012 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
3
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.
8
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.
13
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/>.
17
18 #
19 #       Makefile for timezone information
20 #
21 subdir  := timezone
22
23 distribute := tzfile.h private.h scheck.c ialloc.c yearistype   \
24               iso3166.tab zone.tab tzselect.ksh checktab.awk    \
25               README
26
27 extra-objs := scheck.o ialloc.o
28
29 others  := zdump zic
30 tests   := test-tz tst-timezone
31
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
38 # northamerica.
39 distribute += $(tzfiles) leapseconds pacificnew simplebackw
40
41 generated := $(addprefix z.,$(tzfiles))
42 install-sbin := zic zdump
43
44 generated-dirs = testdata
45
46 all: # Make this the default target; it will be defined in Rules.
47
48 include ../Makeconfig   # Get objpfx defined so we can use it below.
49
50 CPPFLAGS-zic = -DNOT_IN_libc
51
52 ifeq ($(have-ksh),yes)
53 install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
54 install-bin-script = tzselect
55 generated += tzselect
56 endif
57
58 include ../Rules
59
60
61 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
62
63 tz-cflags = -DTZDIR='"$(zonedir)"' \
64             -DTZDEFAULT='"$(localtime-file)"' \
65             -DTZDEFRULES='"$(posixrules-file)"' \
66             -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
67
68 CFLAGS-zdump.c = -fwrapv -Wno-strict-prototypes -DNOID $(tz-cflags) \
69                  -DHAVE_GETTEXT
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
73
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
76 # leapseconds.
77 testdata = $(objpfx)testdata
78 define build-testdata
79 GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
80   $(built-program-cmd) -d $(testdata) -y ./yearistype $<
81 endef
82
83 $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
84 $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
85                                        Europe/Berlin Universal \
86                                        Australia/Melbourne \
87                                        America/Sao_Paulo Asia/Tokyo \
88                                        Europe/London)
89
90 test-tz-ENV = TZDIR=$(testdata)
91 tst-timezone-ENV = TZDIR=$(testdata)
92
93 # Note this must come second in the deps list for $(built-program-cmd) to work.
94 zic-deps = $(objpfx)zic $(leapseconds) yearistype
95
96 $(testdata)/America/New_York: northamerica $(zic-deps)
97         $(build-testdata)
98 $(testdata)/Etc/UTC: etcetera $(zic-deps)
99         $(build-testdata)
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
103         $(build-testdata)
104 $(testdata)/%/Berlin $(testdata)/%/London: europe $(zic-deps)
105         $(build-testdata)
106 $(testdata)/Australia/Melbourne: australasia $(zic-deps)
107         $(build-testdata)
108 $(testdata)/America/Sao_Paulo: southamerica $(zic-deps)
109         $(build-testdata)
110 $(testdata)/Asia/Tokyo: asia $(zic-deps)
111         $(build-testdata)
112
113
114 $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
115         sed -e 's%@KSH@%$(KSH)%g' \
116             -e 's%@TZDIR@%$(zonedir)%g' < $< > $@.new
117         chmod 555 $@.new
118         mv -f $@.new $@
119
120 $(addprefix $(inst_zonedir)/,iso3166.tab zone.tab): \
121     $(inst_zonedir)/%: % $(+force)
122         $(do-install)