| 1 |
#------------------------------------------------------------------------- |
| 2 |
# |
| 3 |
# Makefile |
| 4 |
# Makefile for the timezone library |
| 5 |
|
| 6 |
# IDENTIFICATION |
| 7 |
# src/timezone/Makefile |
| 8 |
# |
| 9 |
#------------------------------------------------------------------------- |
| 10 |
|
| 11 |
PGFILEDESC = "zic - time zone compiler" |
| 12 |
PGAPPICON = win32 |
| 13 |
|
| 14 |
subdir = src/timezone |
| 15 |
top_builddir = ../.. |
| 16 |
include $(top_builddir)/src/Makefile.global |
| 17 |
|
| 18 |
# files to build into backend |
| 19 |
OBJS = \ |
| 20 |
localtime.o \ |
| 21 |
pgtz.o \ |
| 22 |
strftime.o |
| 23 |
|
| 24 |
# files needed to build zic utility program |
| 25 |
ZICOBJS = \ |
| 26 |
$(WIN32RES) \ |
| 27 |
zic.o |
| 28 |
|
| 29 |
# we now distribute the timezone data as a single file |
| 30 |
TZDATAFILES = $(srcdir)/data/tzdata.zi |
| 31 |
|
| 32 |
# any custom options you might want to pass to zic while installing data files |
| 33 |
ZIC_OPTIONS = |
| 34 |
|
| 35 |
# use system timezone data? |
| 36 |
ifneq (,$(with_system_tzdata)) |
| 37 |
override CPPFLAGS += '-DSYSTEMTZDIR="$(with_system_tzdata)"' |
| 38 |
endif |
| 39 |
|
| 40 |
include $(top_srcdir)/src/backend/common.mk |
| 41 |
|
| 42 |
ifeq (,$(with_system_tzdata)) |
| 43 |
all: zic |
| 44 |
endif |
| 45 |
|
| 46 |
# We could do this test in the action section: |
| 47 |
# $(if $(ZIC),$(ZIC),./zic) |
| 48 |
# but GNU make versions <= 3.78.1 or perhaps later have a bug |
| 49 |
# that causes a segfault; GNU make 3.81 or later fixes this. |
| 50 |
ifeq (,$(ZIC)) |
| 51 |
ZIC= ./zic |
| 52 |
endif |
| 53 |
|
| 54 |
zic: $(ZICOBJS) | submake-libpgport |
| 55 |
$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) |
| 56 |
|
| 57 |
install: all installdirs |
| 58 |
ifeq (,$(with_system_tzdata)) |
| 59 |
$(ZIC) -d '$(DESTDIR)$(datadir)/timezone' $(ZIC_OPTIONS) $(TZDATAFILES) |
| 60 |
endif |
| 61 |
$(MAKE) -C tznames $@ |
| 62 |
|
| 63 |
# Note: -P code currently depends on '-b fat'. Not worth fixing right now. |
| 64 |
abbrevs.txt: zic $(TZDATAFILES) |
| 65 |
mkdir junkdir |
| 66 |
$(ZIC) -P -b fat -d junkdir $(TZDATAFILES) | LANG=C sort | uniq >abbrevs.txt |
| 67 |
rm -rf junkdir |
| 68 |
|
| 69 |
installdirs: |
| 70 |
$(MKDIR_P) '$(DESTDIR)$(datadir)' |
| 71 |
|
| 72 |
uninstall: |
| 73 |
ifeq (,$(with_system_tzdata)) |
| 74 |
rm -rf '$(DESTDIR)$(datadir)/timezone' |
| 75 |
endif |
| 76 |
$(MAKE) -C tznames $@ |
| 77 |
|
| 78 |
clean distclean: |
| 79 |
rm -f zic$(X) $(ZICOBJS) abbrevs.txt |