From 49d37ecd3e9b04030dfe97380dd180cb9a942425 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 13 Jan 2016 22:47:49 +0900 Subject: [PATCH] Rework Makefile and remove incoherent definitions -DFRONTEND should be overridden as part of CPPFLAGS and it is not really necessary to have the source list. The definition of pg_arman.h was rather obscure as well. --- Makefile | 39 ++++++++++++++++++--------------------- pgut/pgut.c | 1 - 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 0cf5fe92..c3233a47 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,21 @@ PROGRAM = pg_arman -SRCS = \ - backup.c \ - catalog.c \ - data.c \ - delete.c \ - dir.c \ - fetch.c \ - init.c \ - parray.c \ - pg_arman.c \ - restore.c \ - show.c \ - status.c \ - util.c \ - validate.c \ - xlog.c \ - pgut/pgut.c \ - pgut/pgut-port.c -OBJS = $(SRCS:.c=.o) +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 \ + xlog.o \ + pgut/pgut.o \ + pgut/pgut-port.o DOCS = doc/pg_arman.txt @@ -32,6 +30,7 @@ endif # XMLTO endif # ASCIIDOC PG_CPPFLAGS = -I$(libpq_srcdir) +override CPPFLAGS := -DFRONTEND $(CPPFLAGS) PG_LIBS = $(libpq_pgport) REGRESS = init option show delete backup restore @@ -40,8 +39,6 @@ PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) -$(OBJS): pg_arman.h - # Part related to documentation # Compile documentation as well is ASCIIDOC and XMLTO are defined ifneq ($(ASCIIDOC),) diff --git a/pgut/pgut.c b/pgut/pgut.c index 7a3e5025..71b8bb83 100644 --- a/pgut/pgut.c +++ b/pgut/pgut.c @@ -7,7 +7,6 @@ *------------------------------------------------------------------------- */ -#define FRONTEND #include "postgres_fe.h" #include "libpq/pqsignal.h"