1 # Copyright (C) 1998-2014 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 extra-objs
:= scheck.o ialloc.o
26 tests
:= test-tz tst-timezone
28 # pacificnew doesn't compile; if it is to be used, it should be included in
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
55 $(objpfx
)zic
: $(objpfx
)scheck.o
$(objpfx
)ialloc.o
57 $(objpfx
)zic.o
$(objpfx
)zdump.o
: $(objpfx
)version.h
59 $(objpfx
)version.h
: $(common-objpfx
)config.make
60 echo
'static char const TZVERSION[]="$(version)";' \
64 tz-cflags
= -DTZDIR
='"$(zonedir)"' \
65 -DTZDEFAULT
='"$(localtime-file)"' \
66 -DTZDEFRULES
='"$(posixrules-file)"' \
67 -DTM_GMTOFF
=tm_gmtoff
-DTM_ZONE
=tm_zone
69 CFLAGS-zdump.c
= -fwrapv
-Wno-strict-prototypes
-DNOID
$(tz-cflags
) \
71 CFLAGS-zic.c
= -Wno-strict-prototypes
-DNOID
$(tz-cflags
) -DHAVE_GETTEXT
72 CFLAGS-ialloc.c
= -Wno-strict-prototypes
-DNOID
-DHAVE_GETTEXT
73 CFLAGS-scheck.c
= -Wno-strict-prototypes
-DNOID
-DHAVE_GETTEXT
75 # We have to make sure the data for testing the tz functions is available.
76 # Don't add leapseconds here since test-tz made checks that work only without
78 testdata
= $(objpfx
)testdata
80 GCONV_PATH
=${common-objpfx
}iconvdata LANGUAGE
=C LC_ALL
=C \
81 $(built-program-cmd
) -d
$(testdata
) -y .
/yearistype
$<
84 $(objpfx
)test-tz.out
: $(addprefix $(testdata
)/, America
/New_York Etc
/UTC UTC
)
85 $(objpfx
)tst-timezone.out
: $(addprefix $(testdata
)/, \
86 Europe
/Berlin Universal \
88 America
/Sao_Paulo Asia
/Tokyo \
91 test-tz-ENV
= TZDIR
=$(testdata
)
92 tst-timezone-ENV
= TZDIR
=$(testdata
)
94 # Note this must come second in the deps list for $(built-program-cmd) to work.
95 zic-deps
= $(objpfx
)zic
$(leapseconds
) yearistype
97 $(testdata
)/America
/New_York
: northamerica
$(zic-deps
)
99 $(testdata
)/Etc
/UTC
: etcetera
$(zic-deps
)
101 # Use a pattern rule to indicate the command produces both targets at once.
102 # Two separate targets built separately can collide if in parallel.
103 %/UTC
%/Universal
: simplebackw
$(zic-deps
) %/Etc
/UTC
105 $(testdata
)/%/Berlin
$(testdata
)/%/London
: europe
$(zic-deps
)
107 $(testdata
)/Australia
/Melbourne
: australasia
$(zic-deps
)
109 $(testdata
)/America
/Sao_Paulo
: southamerica
$(zic-deps
)
111 $(testdata
)/Asia
/Tokyo
: asia
$(zic-deps
)
115 $(objpfx
)tzselect
: tzselect.ksh
$(common-objpfx
)config.make
116 sed
-e
's|/bin/bash|$(KSH)|g' \
117 -e
'/TZDIR=/s|\$$(pwd)|$(zonedir)|' \
118 -e
'/TZVERSION=/s|see_Makefile|"$(version)"|' \
119 -e
'/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
120 -e
'/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \