Fix missing newline in test output
[platform/upstream/glibc.git] / timezone / Makefile
index 00bfba6..6e008bc 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2000,2002,2005,2007,2012 Free Software Foundation, Inc.
+# Copyright (C) 1998-2014 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,8 @@
 #
 subdir := timezone
 
+include ../Makeconfig
+
 extra-objs := scheck.o ialloc.o
 
 others := zdump zic
@@ -33,28 +35,36 @@ tzbases := africa antarctica asia australasia europe northamerica \
 tzlinks := backward systemv
 tzfiles := $(tzbases) $(tzlinks)
 
-generated := $(addprefix z.,$(tzfiles))
+generated += $(addprefix z.,$(tzfiles))
 install-sbin := zic zdump
 
-generated-dirs = testdata
-
-all: # Make this the default target; it will be defined in Rules.
-
-include ../Makeconfig  # Get objpfx defined so we can use it below.
+generated-dirs += testdata
 
 CPPFLAGS-zic = -DNOT_IN_libc
 
-ifeq ($(have-ksh),yes)
-install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
 install-bin-script = tzselect
 generated += tzselect
-endif
+
+testdata = $(objpfx)testdata
+
+# List zones generated by separate commands running zic on the host.
+# Each such zic run counts as a separate test.
+test-zones := America/New_York Etc/UTC UTC Europe/Berlin \
+             Australia/Melbourne America/Sao_Paulo Asia/Tokyo
+tests-special += $(addprefix $(testdata)/, $(test-zones))
 
 include ../Rules
 
 
 $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
 
+$(objpfx)zic.o $(objpfx)zdump.o: $(objpfx)version.h
+
+$(objpfx)version.h: $(common-objpfx)config.make
+       echo 'static char const TZVERSION[]="$(version)";' \
+           > $@.new
+       mv -f $@.new $@
+
 tz-cflags = -DTZDIR='"$(zonedir)"' \
            -DTZDEFAULT='"$(localtime-file)"' \
            -DTZDEFRULES='"$(posixrules-file)"' \
@@ -69,10 +79,9 @@ CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
 # We have to make sure the data for testing the tz functions is available.
 # Don't add leapseconds here since test-tz made checks that work only without
 # leapseconds.
-testdata = $(objpfx)testdata
 define build-testdata
-GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
-  $(built-program-cmd) -d $(testdata) -y ./yearistype $<
+$(built-program-cmd) -d $(testdata) -y ./yearistype $<; \
+$(evaluate-test)
 endef
 
 $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
@@ -107,11 +116,11 @@ $(testdata)/Asia/Tokyo: asia $(zic-deps)
 
 
 $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
-       sed -e 's%@KSH@%$(KSH)%g' \
-           -e 's%@TZDIR@%$(zonedir)%g' < $< > $@.new
+       sed -e 's|/bin/bash|$(BASH)|' \
+           -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
+           -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
+           -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
+           -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
+           < $< > $@.new
        chmod 555 $@.new
        mv -f $@.new $@
-
-$(addprefix $(inst_zonedir)/,iso3166.tab zone.tab): \
-    $(inst_zonedir)/%: % $(+force)
-       $(do-install)