forked from unicode-org/icu-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (73 loc) · 2.96 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html#License
# Copyright (C) 2006-2015 IBM and Others. All Rights Reserved.
all:
@echo
@echo You are in a maze of twisty subdirectories, all alike.
@echo You see:
@echo ' A moldy scroll labeled "readme.txt"'
@echo
ICU_CONFIG=icu-config
FETCH=wget -nc -nd
-include Makefile.local
TZSRC=$(ICU_SRC)/tools/tzcode
ENDIAN_LIST=be le ee
ICUVER=44
update-mirror:
ifndef TZDBVER
$(error TZDBVER is not defined.)
endif
cd mirror && ${FETCH} 'ftp://ftp.iana.org/tz/releases/tzdata${TZDBVER}.tar.gz'
cd mirror && ${FETCH} 'ftp://ftp.iana.org/tz/releases/tzcode${TZDBVER}.tar.gz'
update-icu:
@echo 'Processing ${TZDBVER}'
$(MAKE) icunew/${TZDBVER}/zoneinfo64.txt
icunew/%/zoneinfo64.txt: mirror/tzdata%.tar.gz mirror/tzcode%.tar.gz
@test ! -f $@ || (echo Remove $(@D) and $@ manually - will not overwrite. ; touch $@ ; false)
@test ! -d $(@D) || (echo Remove $(@D) manually - will not overwrite. ; false)
@echo "#" building $(@D) .. results are in ./$(shell basename $(@D)).log
@$(MAKE) -C $(TZSRC) dataclean 2> $(shell basename $(@D)).log > $(shell basename $(@D)).log
@rm -f $(TZSRC)/tzdata*.tar.gz 2>> $(shell basename $(@D)).log >> $(shell basename $(@D)).log
@cp $^ $(TZSRC)
@echo "## Building all in $(TZSRC)"
@$(MAKE) -C $(TZSRC) all 2>> $(shell basename $(@D)).log >> $(shell basename $(@D)).log
@echo "## Rebuilding icu data in $(ICU_SRC)/data"
@$(MAKE) -C $(ICU_SRC)/data 2>> $(shell basename $(@D)).log >> $(shell basename $(@D)).log
@echo "## Testing icu data against tz algorithm"
@$(MAKE) -C $(TZSRC) check-dump 2>> $(shell basename $(@D)).log >> $(shell basename $(@D)).log || \
if [ $$? -eq 0 ]; then \
echo "### Test passed"; \
else \
echo "### !!! WARNING !!! zdump output comparison failure. Please review the log."; \
fi
@echo "## Building resource bundles for all ICU versions"
@mkdir $(@D)
@mkdir $(@D)/${ICUVER}
@for endian in $(ENDIAN_LIST); do \
mkdir $(@D)/$(ICUVER)/$$endian; \
done
@LOGFILE=`basename $(@D)`.log ; \
GENRBOPT="--formatVersion 2" ; \
TXTFILES="$(TZSRC)/zoneinfo64.txt supplemental/metaZones.txt supplemental/windowsZones.txt supplemental/timezoneTypes.txt" ; \
for srctxt in $$TXTFILES; do \
cp $$srctxt $(@D)/$(ICUVER) ; \
$(shell icu-config --invoke=genrb) $$GENRBOPT -d $(@D)/$(ICUVER) $$srctxt 2>> $$LOGFILE >> $$LOGFILE ; \
RESFILE=`basename $$srctxt .txt`.res; \
for endian in $(ENDIAN_LIST); do \
echo "### Source: $$srctxt Endian: $$endian" ; \
if [ $$endian = "be" ]; then \
ENDIANARG="-tb" ; \
elif [ $$endian = "le" ]; then \
ENDIANARG="-tl" ; \
else \
ENDIANARG="-te" ; \
fi ; \
$(shell icu-config --invoke=icupkg) $$ENDIANARG -s $(@D)/$(ICUVER) $$RESFILE $(@D)/$(ICUVER)/$$endian/$$RESFILE 2>> $$LOGFILE >> $$LOGFILE ; \
done ; \
rm $(@D)/$(ICUVER)/$$RESFILE ; \
done
@find $(@D)/* -type f
@echo "## Build OK."
update: update-mirror update-icu
clean:
-rm -f ./*.log