Skip to content

Commit a880b91

Browse files
committed
[PBCKP-232] makefile simplification
1 parent 5ed469d commit a880b91

File tree

2 files changed

+6
-56
lines changed

2 files changed

+6
-56
lines changed

Makefile

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,17 @@
1717
# git clone https://github.com/postgrespro/pg_probackup postgresql/contrib/pg_probackup
1818
# cd postgresql
1919
# ./configure ... && make
20-
# make --no-print-directory -C contrib/pg_probackup
20+
# make -C contrib/pg_probackup
2121
#
2222
# 4. out of PG source and without PGXS
2323
# git clone https://git.postgresql.org/git/postgresql.git postgresql-src
2424
# git clone https://github.com/postgrespro/pg_probackup postgresql-src/contrib/pg_probackup
2525
# mkdir postgresql-build && cd postgresql-build
2626
# ../postgresql-src/configure ... && make
27-
# make --no-print-directory -C contrib/pg_probackup
27+
# make -C contrib/pg_probackup
2828
#
2929
top_pbk_srcdir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
3030

31-
# get postgres version
32-
PG_MAJORVER != $(MAKE) USE_PGXS=$(USE_PGXS) PG_CONFIG=$(PG_CONFIG) --silent --makefile=$(top_pbk_srcdir)get_pg_version.mk
33-
#$(info Making with PG_MAJORVER=$(PG_MAJORVER))
34-
3531
PROGRAM := pg_probackup
3632

3733
# pg_probackup sources
@@ -47,18 +43,14 @@ OBJS += src/archive.o src/backup.o src/catalog.o src/checkdb.o src/configure.o s
4743
BORROWED_H_SRC := \
4844
src/include/portability/instr_time.h \
4945
src/bin/pg_basebackup/receivelog.h \
50-
src/bin/pg_basebackup/streamutil.h
46+
src/bin/pg_basebackup/streamutil.h \
47+
src/bin/pg_basebackup/walmethods.h
5148
BORROWED_C_SRC := \
5249
src/backend/access/transam/xlogreader.c \
5350
src/backend/utils/hash/pg_crc.c \
5451
src/bin/pg_basebackup/receivelog.c \
55-
src/bin/pg_basebackup/streamutil.c
56-
ifneq ($(PG_MAJORVER), $(findstring $(PG_MAJORVER), 9.5 9.6))
57-
BORROWED_H_SRC += \
58-
src/bin/pg_basebackup/walmethods.h
59-
BORROWED_C_SRC += \
52+
src/bin/pg_basebackup/streamutil.c \
6053
src/bin/pg_basebackup/walmethods.c
61-
endif
6254

6355
BORROW_DIR := src/borrowed
6456
BORROWED_H := $(addprefix $(BORROW_DIR)/, $(notdir $(BORROWED_H_SRC)))
@@ -84,9 +76,6 @@ include $(top_builddir)/src/Makefile.global
8476
include $(top_srcdir)/contrib/contrib-global.mk
8577
endif
8678

87-
# now we can use standard MAJORVERSION variable instead of calculated PG_MAJORVER
88-
undefine PG_MAJORVER
89-
9079
#
9180
PG_CPPFLAGS = -I$(libpq_srcdir) ${PTHREAD_CFLAGS} -I$(top_pbk_srcdir)src -I$(BORROW_DIR)
9281
PG_CPPFLAGS += -I$(top_pbk_srcdir)src/fu_util -Wno-declaration-after-statement
@@ -99,11 +88,8 @@ PG_LIBS_INTERNAL = $(libpq_pgport) ${PTHREAD_CFLAGS}
9988
# additional dependencies on borrowed files
10089
src/archive.o: $(BORROW_DIR)/instr_time.h
10190
src/backup.o src/catchup.o src/pg_probackup.o: $(BORROW_DIR)/streamutil.h
102-
src/stream.o $(BORROW_DIR)/receivelog.o $(BORROW_DIR)/streamutil.o: $(BORROW_DIR)/receivelog.h
103-
ifneq ($(MAJORVERSION), $(findstring $(MAJORVERSION), 9.5 9.6))
91+
src/stream.o $(BORROW_DIR)/receivelog.o $(BORROW_DIR)/streamutil.o $(BORROW_DIR)/walmethods.o: $(BORROW_DIR)/receivelog.h
10492
$(BORROW_DIR)/receivelog.h: $(BORROW_DIR)/walmethods.h
105-
$(BORROW_DIR)/walmethods.o: $(BORROW_DIR)/receivelog.h
106-
endif
10793

10894
# generate separate makefile to handle borrowed files
10995
borrowed.mk: $(firstword $(MAKEFILE_LIST))

get_pg_version.mk

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)