1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-26 18:17:33 +03:00
postgres/src/timezone/Makefile
Tom Lane 097b24cea6 Replace raw timezone source data with IANA's new compact format.
Traditionally IANA has distributed their timezone data in pure source
form, replete with extensive historical comments.  As of release 2017c,
they've added a compact single-file format that omits comments and
abbreviates command keywords.  This form is way shorter than the pure
source, even before considering its allegedly better compressibility.
Hence, let's distribute the data in that form rather than pure source.

I'm pushing this now, rather than at the next timezone database update,
so that it's easy to confirm that this data file produces compiled zic
output that's identical to what we were getting before.

Discussion: https://postgr.es/m/1915.1511210334@sss.pgh.pa.us
2017-11-25 15:30:27 -05:00

75 lines
1.8 KiB
Makefile

#-------------------------------------------------------------------------
#
# Makefile
# Makefile for the timezone library
# IDENTIFICATION
# src/timezone/Makefile
#
#-------------------------------------------------------------------------
PGFILEDESC = "zic - time zone compiler"
PGAPPICON = win32
subdir = src/timezone
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
# files to build into backend
OBJS= localtime.o strftime.o pgtz.o
# files needed to build zic utility program
ZICOBJS= zic.o $(WIN32RES)
# we now distribute the timezone data as a single file
TZDATAFILES = $(srcdir)/data/tzdata.zi
# which zone should determine the DST rules (not the specific UTC offset!)
# for POSIX-style timezone specs
POSIXRULES = US/Eastern
# use system timezone data?
ifneq (,$(with_system_tzdata))
override CPPFLAGS += '-DSYSTEMTZDIR="$(with_system_tzdata)"'
endif
include $(top_srcdir)/src/backend/common.mk
ifeq (,$(with_system_tzdata))
all: zic
endif
# We could do this test in the action section:
# $(if $(ZIC),$(ZIC),./zic)
# but GNU make versions <= 3.78.1 or perhaps later have a bug
# that causes a segfault; GNU make 3.81 or later fixes this.
ifeq (,$(ZIC))
ZIC= ./zic
endif
zic: $(ZICOBJS) | submake-libpgport
$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs
ifeq (,$(with_system_tzdata))
$(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(TZDATAFILES)
endif
$(MAKE) -C tznames $@
abbrevs.txt: zic $(TZDATAFILES)
mkdir junkdir
$(ZIC) -P -d junkdir -p '$(POSIXRULES)' $(TZDATAFILES) | LANG=C sort | uniq >abbrevs.txt
rm -rf junkdir
installdirs:
$(MKDIR_P) '$(DESTDIR)$(datadir)'
uninstall:
ifeq (,$(with_system_tzdata))
rm -rf '$(DESTDIR)$(datadir)/timezone'
endif
$(MAKE) -C tznames $@
clean distclean maintainer-clean:
rm -f zic$(X) $(ZICOBJS) abbrevs.txt