1 #-------------------------------------------------------------------------
4 # Makefile for the timezone library
7 # src/timezone/Makefile
9 #-------------------------------------------------------------------------
11 PGFILEDESC = "zic - time zone compiler"
16 include $(top_builddir)/src/Makefile.global
18 # files to build into backend
19 OBJS= localtime.o strftime.o pgtz.o
21 # files needed to build zic utility program
22 ZICOBJS= zic.o $(WIN32RES)
24 # we now distribute the timezone data as a single file
25 TZDATAFILES = $(srcdir)/data/tzdata.zi
27 # which zone should determine the DST rules (not the specific UTC offset!)
28 # for POSIX-style timezone specs
29 POSIXRULES = US/Eastern
31 # any custom options you might want to pass to zic while installing data files
34 # use system timezone data?
35 ifneq (,$(with_system_tzdata))
36 override CPPFLAGS += '-DSYSTEMTZDIR="$(with_system_tzdata)"'
39 include $(top_srcdir)/src/backend/common.mk
41 ifeq (,$(with_system_tzdata))
45 # We could do this test in the action section:
46 # $(if $(ZIC),$(ZIC),./zic)
47 # but GNU make versions <= 3.78.1 or perhaps later have a bug
48 # that causes a segfault; GNU make 3.81 or later fixes this.
53 zic: $(ZICOBJS) | submake-libpgport
54 $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
56 install: all installdirs
57 ifeq (,$(with_system_tzdata))
58 $(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' -b slim $(ZIC_OPTIONS) $(TZDATAFILES)
62 abbrevs.txt: zic $(TZDATAFILES)
64 $(ZIC) -P -d junkdir -p '$(POSIXRULES)' $(TZDATAFILES) | LANG=C sort | uniq >abbrevs.txt
68 $(MKDIR_P) '$(DESTDIR)$(datadir)'
71 ifeq (,$(with_system_tzdata))
72 rm -rf '$(DESTDIR)$(datadir)/timezone'
76 clean distclean maintainer-clean:
77 rm -f zic$(X) $(ZICOBJS) abbrevs.txt