2004-04-30 06:09:23 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2004-10-04 15:43:59 +02:00
|
|
|
# Makefile
|
2004-04-30 06:09:23 +02:00
|
|
|
# Makefile for the timezone library
|
|
|
|
|
|
|
|
# IDENTIFICATION
|
2010-09-20 22:08:53 +02:00
|
|
|
# src/timezone/Makefile
|
2004-04-30 06:09:23 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2014-08-19 04:59:53 +02:00
|
|
|
PGFILEDESC = "zic - time zone compiler"
|
|
|
|
PGAPPICON = win32
|
|
|
|
|
2004-04-30 16:24:14 +02:00
|
|
|
subdir = src/timezone
|
2004-04-30 06:31:52 +02:00
|
|
|
top_builddir = ../..
|
2004-04-30 06:09:23 +02:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
|
|
|
|
2004-05-21 07:08:06 +02:00
|
|
|
# files to build into backend
|
2019-11-05 23:41:07 +01:00
|
|
|
OBJS = \
|
|
|
|
localtime.o \
|
|
|
|
pgtz.o \
|
|
|
|
strftime.o
|
2004-04-30 06:09:23 +02:00
|
|
|
|
2004-05-21 07:08:06 +02:00
|
|
|
# files needed to build zic utility program
|
2019-11-05 23:41:07 +01:00
|
|
|
ZICOBJS = \
|
|
|
|
$(WIN32RES) \
|
|
|
|
zic.o
|
2004-05-21 07:08:06 +02:00
|
|
|
|
2017-11-25 21:30:11 +01:00
|
|
|
# we now distribute the timezone data as a single file
|
|
|
|
TZDATAFILES = $(srcdir)/data/tzdata.zi
|
2004-04-30 06:09:23 +02:00
|
|
|
|
2019-04-27 01:46:26 +02:00
|
|
|
# any custom options you might want to pass to zic while installing data files
|
|
|
|
ZIC_OPTIONS =
|
|
|
|
|
2007-08-25 22:29:25 +02:00
|
|
|
# use system timezone data?
|
|
|
|
ifneq (,$(with_system_tzdata))
|
|
|
|
override CPPFLAGS += '-DSYSTEMTZDIR="$(with_system_tzdata)"'
|
|
|
|
endif
|
|
|
|
|
2008-02-19 16:29:58 +01:00
|
|
|
include $(top_srcdir)/src/backend/common.mk
|
2007-08-25 22:29:25 +02:00
|
|
|
|
|
|
|
ifeq (,$(with_system_tzdata))
|
2010-11-12 21:15:16 +01:00
|
|
|
all: zic
|
2007-08-25 22:29:25 +02:00
|
|
|
endif
|
2004-04-30 06:09:23 +02:00
|
|
|
|
2009-01-06 03:25:29 +01:00
|
|
|
# We could do this test in the action section:
|
|
|
|
# $(if $(ZIC),$(ZIC),./zic)
|
2014-02-12 23:29:19 +01:00
|
|
|
# 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.
|
2009-01-06 03:25:29 +01:00
|
|
|
ifeq (,$(ZIC))
|
|
|
|
ZIC= ./zic
|
|
|
|
endif
|
|
|
|
|
2010-11-12 21:15:16 +01:00
|
|
|
zic: $(ZICOBJS) | submake-libpgport
|
2010-07-05 20:54:38 +02:00
|
|
|
$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
2004-04-30 06:09:23 +02:00
|
|
|
|
2004-05-18 06:10:33 +02:00
|
|
|
install: all installdirs
|
2007-08-20 10:53:12 +02:00
|
|
|
ifeq (,$(with_system_tzdata))
|
2020-10-17 03:40:16 +02:00
|
|
|
$(ZIC) -d '$(DESTDIR)$(datadir)/timezone' $(ZIC_OPTIONS) $(TZDATAFILES)
|
2007-08-20 10:53:12 +02:00
|
|
|
endif
|
2006-07-25 05:51:23 +02:00
|
|
|
$(MAKE) -C tznames $@
|
2004-04-30 06:09:23 +02:00
|
|
|
|
Update time zone data files to tzdata release 2021a.
DST law changes in Russia (Volgograd zone) and South Sudan.
Historical corrections for Australia, Bahamas, Belize, Bermuda,
Ghana, Israel, Kenya, Nigeria, Palestine, Seychelles, and Vanuatu.
Notably, the Australia/Currie zone has been corrected to the point
where it is identical to Australia/Hobart.
2021-01-24 22:29:47 +01:00
|
|
|
# Note: -P code currently depends on '-b fat'. Not worth fixing right now.
|
2013-03-23 23:47:22 +01:00
|
|
|
abbrevs.txt: zic $(TZDATAFILES)
|
|
|
|
mkdir junkdir
|
Update time zone data files to tzdata release 2021a.
DST law changes in Russia (Volgograd zone) and South Sudan.
Historical corrections for Australia, Bahamas, Belize, Bermuda,
Ghana, Israel, Kenya, Nigeria, Palestine, Seychelles, and Vanuatu.
Notably, the Australia/Currie zone has been corrected to the point
where it is identical to Australia/Hobart.
2021-01-24 22:29:47 +01:00
|
|
|
$(ZIC) -P -b fat -d junkdir $(TZDATAFILES) | LANG=C sort | uniq >abbrevs.txt
|
2013-03-23 23:47:22 +01:00
|
|
|
rm -rf junkdir
|
|
|
|
|
2004-05-28 05:53:33 +02:00
|
|
|
installdirs:
|
2009-08-27 00:24:44 +02:00
|
|
|
$(MKDIR_P) '$(DESTDIR)$(datadir)'
|
2005-12-09 22:19:36 +01:00
|
|
|
|
|
|
|
uninstall:
|
2007-08-25 22:29:25 +02:00
|
|
|
ifeq (,$(with_system_tzdata))
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -rf '$(DESTDIR)$(datadir)/timezone'
|
2007-08-25 22:29:25 +02:00
|
|
|
endif
|
2006-07-25 05:51:23 +02:00
|
|
|
$(MAKE) -C tznames $@
|
2004-05-28 05:53:33 +02:00
|
|
|
|
Remove distprep
A PostgreSQL release tarball contains a number of prebuilt files, in
particular files produced by bison, flex, perl, and well as html and
man documentation. We have done this consistent with established
practice at the time to not require these tools for building from a
tarball. Some of these tools were hard to get, or get the right
version of, from time to time, and shipping the prebuilt output was a
convenience to users.
Now this has at least two problems:
One, we have to make the build system(s) work in two modes: Building
from a git checkout and building from a tarball. This is pretty
complicated, but it works so far for autoconf/make. It does not
currently work for meson; you can currently only build with meson from
a git checkout. Making meson builds work from a tarball seems very
difficult or impossible. One particular problem is that since meson
requires a separate build directory, we cannot make the build update
files like gram.h in the source tree. So if you were to build from a
tarball and update gram.y, you will have a gram.h in the source tree
and one in the build tree, but the way things work is that the
compiler will always use the one in the source tree. So you cannot,
for example, make any gram.y changes when building from a tarball.
This seems impossible to fix in a non-horrible way.
Second, there is increased interest nowadays in precisely tracking the
origin of software. We can reasonably track contributions into the
git tree, and users can reasonably track the path from a tarball to
packages and downloads and installs. But what happens between the git
tree and the tarball is obscure and in some cases non-reproducible.
The solution for both of these issues is to get rid of the step that
adds prebuilt files to the tarball. The tarball now only contains
what is in the git tree (*). Getting the additional build
dependencies is no longer a problem nowadays, and the complications to
keep these dual build modes working are significant. And of course we
want to get the meson build system working universally.
This commit removes the make distprep target altogether. The make
dist target continues to do its job, it just doesn't call distprep
anymore.
(*) - The tarball also contains the INSTALL file that is built at make
dist time, but not by distprep. This is unchanged for now.
The make maintainer-clean target, whose job it is to remove the
prebuilt files in addition to what make distclean does, is now just an
alias to make distprep. (In practice, it is probably obsolete given
that git clean is available.)
The following programs are now hard build requirements in configure
(they were already required by meson.build):
- bison
- flex
- perl
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/flat/e07408d9-e5f2-d9fd-5672-f53354e9305e@eisentraut.org
2023-11-06 14:51:52 +01:00
|
|
|
clean distclean:
|
2013-03-23 23:47:22 +01:00
|
|
|
rm -f zic$(X) $(ZICOBJS) abbrevs.txt
|