Files
openGauss-server/src/bin/pg_ctl/Makefile
2020-06-30 17:38:27 +08:00

73 lines
2.7 KiB
Makefile
Executable File

#-------------------------------------------------------------------------
#
# Makefile for src/bin/pg_ctl
#
# Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# src/bin/pg_ctl/Makefile
#
#-------------------------------------------------------------------------
PGFILEDESC = "gs_ctl - starts/stops/restarts the PostgreSQL server"
PGAPPICON=win32
subdir = src/bin/pg_ctl
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -I$(libpq_srcdir) -I$(ZLIB_INCLUDE_PATH) -I$(LZ4_INCLUDE_PATH) $(CPPFLAGS) -DHAVE_LIBZ -DFRONTEND -I$(top_builddir)/src/bin/pg_rewind
LDFLAGS += -L$(LZ4_LIB_PATH)
LIBS += -lgssapi_krb5_gauss -lgssrpc_gauss -lkrb5_gauss -lkrb5support_gauss -lk5crypto_gauss -lcom_err_gauss -llz4
ifneq "$(MAKECMDGOALS)" "clean"
ifneq "$(MAKECMDGOALS)" "distclean"
ifneq "$(shell which g++ |grep hutaf_llt |wc -l)" "1"
-include $(DEPEND)
endif
endif
endif
OBJS= pg_ctl.o pg_build.o fetchmot.o backup.o receivelog.o streamutil.o xlogreader.o xlogreader_common.o $(WIN32RES) $(top_builddir)/src/lib/elog/elog.a $(top_builddir)/src/lib/build_query/libbuildquery.a \
$(top_builddir)/src/bin/pg_rewind/pg_rewind.a $(top_builddir)/src/lib/pgcommon/libpgcommon.a \
$(top_builddir)/src/lib/hotpatch/client/libhotpatchclient.a
all: gs_ctl
gs_ctl: $(OBJS) | submake-libpq submake-libpgport
$(CC) -fPIC $(CXXFLAGS) $(OBJS) $(LIBS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) -o $@$(X)
ctla: $(OBJS)
$(CC) -fPIC -shared $(CXXFLAGS) $(OBJS) $(LIBS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) -o lib$@.so
mv lib$@.so $(top_builddir)/src/test/ut/lib
xlogreader.cpp: % : $(top_srcdir)/src/gausskernel/storage/access/transam/%
rm -f $@ && $(LN_S) $< .
xlogreader_common.cpp: % : $(top_srcdir)/src/gausskernel/storage/access/redo/%
rm -f $@ && $(LN_S) $< .
install: all installdirs
$(INSTALL_PROGRAM) gs_ctl$(X) '$(DESTDIR)$(bindir)/gs_ctl$(X)'
installdirs:
$(MKDIR_P) '$(DESTDIR)$(bindir)'
uninstall:
rm -f '$(DESTDIR)$(bindir)/gs_ctl$(X)'
clean distclean maintainer-clean:
rm -f gs_ctl$(X) $(OBJS) *.depend
# Be sure that the necessary archives are compiled
$(top_builddir)/src/lib/build_query/libbuildquery.a:
$(MAKE) -C $(top_builddir)/src/lib/build_query libbuildquery.a
$(top_builddir)/src/lib/elog/elog.a:
$(MAKE) -C $(top_builddir)/src/lib/elog elog.a
$(top_builddir)/src/lib/pgcommon/libpgcommon.a:
$(MAKE) -C $(top_builddir)/src/lib/pgcommon libpgcommon.a
$(top_builddir)/src/bin/pg_rewind/pg_rewind.a:
$(MAKE) -C $(top_builddir)/src/bin/pg_rewind pg_rewind.a
$(top_builddir)/src/lib/hotpatch/client/libhotpatchclient.a:
$(MAKE) -C $(top_builddir)/src/lib/hotpatch/client libhotpatchclient.a