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 ialloc.o scheck.o localtime.o $(WIN32RES)
25 TZDATA = africa antarctica asia australasia europe northamerica southamerica \
26 pacificnew etcetera factory backward systemv
27 TZDATAFILES = $(TZDATA:%=$(srcdir)/data/%)
29 # which zone should determine the DST rules (not the specific UTC offset!)
30 # for POSIX-style timezone specs
31 POSIXRULES = US/Eastern
33 # use system timezone data?
34 ifneq (,$(with_system_tzdata))
35 override CPPFLAGS += '-DSYSTEMTZDIR="$(with_system_tzdata)"'
38 include $(top_srcdir)/src/backend/common.mk
40 ifeq (,$(with_system_tzdata))
44 # We could do this test in the action section:
45 # $(if $(ZIC),$(ZIC),./zic)
46 # but GNU make versions <= 3.78.1 or perhaps later have a bug
47 # that causes a segfault; GNU make 3.81 or later fixes this.
52 zic: $(ZICOBJS) | submake-libpgport
53 $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
55 install: all installdirs
56 ifeq (,$(with_system_tzdata))
57 $(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(TZDATAFILES)
61 abbrevs.txt: zic $(TZDATAFILES)
63 $(ZIC) -P -d junkdir -p '$(POSIXRULES)' $(TZDATAFILES) | LANG=C sort | uniq >abbrevs.txt
67 $(MKDIR_P) '$(DESTDIR)$(datadir)'
70 ifeq (,$(with_system_tzdata))
71 rm -rf '$(DESTDIR)$(datadir)/timezone'
75 clean distclean maintainer-clean:
76 rm -f zic$(X) $(ZICOBJS) abbrevs.txt