2014-01-27 06:02:56 +03:00
|
|
|
PROGRAM = pg_arman
|
2016-01-13 15:47:49 +02:00
|
|
|
OBJS = backup.o \
|
|
|
|
catalog.o \
|
|
|
|
data.o \
|
|
|
|
delete.o \
|
|
|
|
dir.o \
|
|
|
|
fetch.o \
|
|
|
|
init.o \
|
|
|
|
parray.o \
|
|
|
|
pg_arman.o \
|
|
|
|
restore.o \
|
|
|
|
show.o \
|
|
|
|
status.o \
|
|
|
|
util.o \
|
|
|
|
validate.o \
|
2016-01-15 16:47:38 +02:00
|
|
|
datapagemap.o \
|
|
|
|
parsexlog.o \
|
|
|
|
xlogreader.o \
|
2016-01-13 15:47:49 +02:00
|
|
|
pgut/pgut.o \
|
|
|
|
pgut/pgut-port.o
|
2009-12-08 02:21:28 +02:00
|
|
|
|
2014-01-27 06:02:56 +03:00
|
|
|
DOCS = doc/pg_arman.txt
|
2014-01-11 21:03:30 +03:00
|
|
|
|
2016-01-15 16:47:38 +02:00
|
|
|
EXTRA_CLEAN = datapagemap.c datapagemap.h xlogreader.c
|
|
|
|
|
2014-01-11 21:03:30 +03:00
|
|
|
# asciidoc and xmlto are present, so install the html documentation and man
|
|
|
|
# pages as well. html is part of the vanilla documentation. Man pages need a
|
|
|
|
# special handling at installation.
|
|
|
|
ifneq ($(ASCIIDOC),)
|
|
|
|
ifneq ($(XMLTO),)
|
2014-01-27 06:02:56 +03:00
|
|
|
man_DOCS = doc/pg_arman.1
|
|
|
|
DOCS += doc/pg_arman.html doc/README.html
|
2014-01-11 21:03:30 +03:00
|
|
|
endif # XMLTO
|
|
|
|
endif # ASCIIDOC
|
2013-12-24 21:48:36 +03:00
|
|
|
|
2016-02-29 19:23:48 +02:00
|
|
|
PG_CPPFLAGS = -I$(libpq_srcdir) ${PTHREAD_CFLAGS}
|
|
|
|
override CPPFLAGS := -DFRONTEND $(CPPFLAGS)
|
|
|
|
PG_LIBS = $(libpq_pgport) ${PTHREAD_LIBS} ${PTHREAD_CFLAGS}
|
2009-12-08 02:21:28 +02:00
|
|
|
|
2016-01-13 07:57:51 +02:00
|
|
|
REGRESS = init option show delete backup restore
|
2009-12-08 02:21:28 +02:00
|
|
|
|
2016-01-15 16:47:38 +02:00
|
|
|
all: checksrcdir docs datapagemap.h pg_arman
|
|
|
|
|
|
|
|
# This rule's only purpose is to give the user instructions on how to pass
|
|
|
|
# the path to PostgreSQL source tree to the makefile.
|
|
|
|
.PHONY: checksrcdir
|
|
|
|
checksrcdir:
|
|
|
|
ifndef top_srcdir
|
|
|
|
@echo "You must have PostgreSQL source tree available to compile."
|
|
|
|
@echo "Pass the path to the PostgreSQL source tree to make, in the top_srcdir"
|
|
|
|
@echo "variable: \"make top_srcdir=<path to PostgreSQL source tree>\""
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Those files are symlinked from the PostgreSQL sources.
|
|
|
|
xlogreader.c: % : $(top_srcdir)/src/backend/access/transam/%
|
|
|
|
rm -f $@ && $(LN_S) $< .
|
|
|
|
datapagemap.c: % : $(top_srcdir)/src/bin/pg_rewind/%
|
|
|
|
rm -f $@ && $(LN_S) $< .
|
|
|
|
datapagemap.h: % : $(top_srcdir)/src/bin/pg_rewind/%
|
|
|
|
rm -f && $(LN_S) $< .
|
2016-04-26 14:24:59 +02:00
|
|
|
receivelog.c: % : $(top_srcdir)/src/bin/pg_basebackup/%
|
|
|
|
rm -f && $(LN_S) $< .
|
|
|
|
receivelog.h: % : $(top_srcdir)/src/bin/pg_basebackup/%
|
|
|
|
rm -f && $(LN_S) $< .
|
|
|
|
streamutil.c: % : $(top_srcdir)/src/bin/pg_basebackup/%
|
|
|
|
rm -f && $(LN_S) $< .
|
|
|
|
streamutil.h: % : $(top_srcdir)/src/bin/pg_basebackup/%
|
|
|
|
rm -f && $(LN_S) $< .
|
2016-01-15 16:47:38 +02:00
|
|
|
|
2009-12-08 02:21:28 +02:00
|
|
|
PG_CONFIG = pg_config
|
|
|
|
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
|
|
|
include $(PGXS)
|
|
|
|
|
2014-01-11 21:03:30 +03:00
|
|
|
# Part related to documentation
|
|
|
|
# Compile documentation as well is ASCIIDOC and XMLTO are defined
|
|
|
|
ifneq ($(ASCIIDOC),)
|
|
|
|
ifneq ($(XMLTO),)
|
|
|
|
docs:
|
|
|
|
$(MAKE) -C doc/
|
|
|
|
|
|
|
|
# Special handling for man pages, they need to be in a dedicated folder
|
|
|
|
install: install-man
|
|
|
|
|
|
|
|
install-man:
|
2014-01-13 13:41:59 +03:00
|
|
|
$(MKDIR_P) '$(DESTDIR)$(mandir)/man1/'
|
|
|
|
$(INSTALL_DATA) $(man_DOCS) '$(DESTDIR)$(mandir)/man1/'
|
2016-01-15 16:47:38 +02:00
|
|
|
else
|
|
|
|
docs:
|
|
|
|
@echo "No docs to build"
|
2014-01-11 21:03:30 +03:00
|
|
|
endif # XMLTO
|
2016-01-15 16:47:38 +02:00
|
|
|
else
|
|
|
|
docs:
|
|
|
|
@echo "No docs to build"
|
2014-01-11 21:03:30 +03:00
|
|
|
endif # ASCIIDOC
|
|
|
|
|
|
|
|
# Clean up documentation as well
|
|
|
|
clean: clean-docs
|
|
|
|
clean-docs:
|
|
|
|
$(MAKE) -C doc/ clean
|