Remove distribute variable from Makefiles
[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 extra-objs := scheck.o ialloc.o
24
25 others  := zdump zic
26 tests   := test-tz tst-timezone
27
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)
35
36 generated := $(addprefix z.,$(tzfiles))
37 install-sbin := zic zdump
38
39 generated-dirs = testdata
40
41 all: # Make this the default target; it will be defined in Rules.
42
43 include ../Makeconfig   # Get objpfx defined so we can use it below.
44
45 CPPFLAGS-zic = -DNOT_IN_libc
46
47 ifeq ($(have-ksh),yes)
48 install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
49 install-bin-script = tzselect
50 generated += tzselect
51 endif
52
53 include ../Rules
54
55
56 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
57
58 tz-cflags = -DTZDIR='"$(zonedir)"' \
59             -DTZDEFAULT='"$(localtime-file)"' \
60             -DTZDEFRULES='"$(posixrules-file)"' \
61             -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
62
63 CFLAGS-zdump.c = -fwrapv -Wno-strict-prototypes -DNOID $(tz-cflags) \
64                  -DHAVE_GETTEXT
65 CFLAGS-zic.c = -Wno-strict-prototypes -DNOID $(tz-cflags) -DHAVE_GETTEXT
66 CFLAGS-ialloc.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
67 CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
68
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 testdata = $(objpfx)testdata
73 define build-testdata
74 GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
75   $(built-program-cmd) -d $(testdata) -y ./yearistype $<
76 endef
77
78 $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
79 $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
80                                        Europe/Berlin Universal \
81                                        Australia/Melbourne \
82                                        America/Sao_Paulo Asia/Tokyo \
83                                        Europe/London)
84
85 test-tz-ENV = TZDIR=$(testdata)
86 tst-timezone-ENV = TZDIR=$(testdata)
87
88 # Note this must come second in the deps list for $(built-program-cmd) to work.
89 zic-deps = $(objpfx)zic $(leapseconds) yearistype
90
91 $(testdata)/America/New_York: northamerica $(zic-deps)
92         $(build-testdata)
93 $(testdata)/Etc/UTC: etcetera $(zic-deps)
94         $(build-testdata)
95 # Use a pattern rule to indicate the command produces both targets at once.
96 # Two separate targets built separately can collide if in parallel.
97 %/UTC %/Universal: simplebackw $(zic-deps) %/Etc/UTC
98         $(build-testdata)
99 $(testdata)/%/Berlin $(testdata)/%/London: europe $(zic-deps)
100         $(build-testdata)
101 $(testdata)/Australia/Melbourne: australasia $(zic-deps)
102         $(build-testdata)
103 $(testdata)/America/Sao_Paulo: southamerica $(zic-deps)
104         $(build-testdata)
105 $(testdata)/Asia/Tokyo: asia $(zic-deps)
106         $(build-testdata)
107
108
109 $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
110         sed -e 's%@KSH@%$(KSH)%g' \
111             -e 's%@TZDIR@%$(zonedir)%g' < $< > $@.new
112         chmod 555 $@.new
113         mv -f $@.new $@
114
115 $(addprefix $(inst_zonedir)/,iso3166.tab zone.tab): \
116     $(inst_zonedir)/%: % $(+force)
117         $(do-install)