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