mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 15:16:29 +00:00
Move out string operations to another file, and introduce a frontend to snprintf for various situations. This change is important for catching and eliminating sprintf overflows, which are as of now many times silently corrupting memory. Signed-off-by: Dan Farina <drfarina@acm.org> Signed-off-by: Peter van Hardenberg <pvh@heroku.com>
50 lines
1.2 KiB
Makefile
50 lines
1.2 KiB
Makefile
#
|
|
# Makefile
|
|
#
|
|
# Copyright (c) 2ndQuadrant, 2010
|
|
# Copyright (c) Heroku, 2010
|
|
|
|
repmgrd_OBJS = dbutils.o config.o repmgrd.o strutil.o
|
|
repmgr_OBJS = dbutils.o check_dir.o config.o repmgr.o strutil.o
|
|
|
|
DATA = repmgr.sql uninstall_repmgr.sql
|
|
|
|
PG_CPPFLAGS = -I$(libpq_srcdir)
|
|
PG_LIBS = $(libpq_pgport)
|
|
|
|
all: repmgrd repmgr
|
|
|
|
repmgrd: $(repmgrd_OBJS)
|
|
$(CC) $(CFLAGS) $(repmgrd_OBJS) $(PG_LIBS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o repmgrd
|
|
|
|
repmgr: $(repmgr_OBJS)
|
|
$(CC) $(CFLAGS) $(repmgr_OBJS) $(PG_LIBS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o repmgr
|
|
|
|
ifdef USE_PGXS
|
|
PGXS := $(shell pg_config --pgxs)
|
|
include $(PGXS)
|
|
else
|
|
subdir = contrib/repmgr
|
|
top_builddir = ../..
|
|
include $(top_builddir)/src/Makefile.global
|
|
include $(top_srcdir)/contrib/contrib-global.mk
|
|
endif
|
|
|
|
# XXX: Try to use PROGRAM construct (see pgxs.mk) someday. Right now
|
|
# is overriding pgxs install.
|
|
install:
|
|
$(INSTALL_PROGRAM) repmgrd$(X) '$(DESTDIR)$(bindir)'
|
|
$(INSTALL_PROGRAM) repmgr$(X) '$(DESTDIR)$(bindir)'
|
|
|
|
ifneq (,$(DATA)$(DATA_built))
|
|
@for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built); do \
|
|
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'"; \
|
|
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'; \
|
|
done
|
|
endif
|
|
|
|
clean:
|
|
rm -f *.o
|
|
rm -f repmgrd
|
|
rm -f repmgr
|