@@ -24,27 +24,27 @@ ifneq ($(PORTNAME), win32)
2424override CFLAGS += $(PTHREAD_CFLAGS )
2525endif
2626
27- # Need to recompile any libpgport object files because we need these
28- # object files to use the same compile flags as libpq; some
29- # platforms require special flags for all libpq object files .
27+ # Need to recompile any external C files because we need
28+ # all object files to use the same compile flags as libpq; some
29+ # platforms require special flags.
3030LIBS := $(LIBS:-lpgport= )
3131
32- # external object files that are always used by libpq
33- BACKEND_LIBPQ = md5 ip
34- UTILS_MB = encnames wchar
35- PERM_PGPORT = inet_net_ntop noblock pgstrcasecmp thread
32+ # libpgport C files that are always used by libpq
33+ PGPORT = inet_net_ntop noblock pgstrcasecmp thread
3634ifeq ($(PORTNAME ) , win32)
37- PERM_PGPORT += pgsleep
35+ PGPORT += pgsleep
3836endif
37+ # libpgport C files are used by libpq if identified by configure
38+ PGPORT += $(basename $(filter $(addsuffix .o, crypt getaddrinfo inet_aton open snprintf strerror strlcpy win32error) , $(LIBOBJS ) ) )
3939
40-
41- # pgport object files are used by libpq if identified by configure
42- OPT_PGPORT = $( basename $( filter $( addsuffix .o, crypt getaddrinfo inet_aton open snprintf strerror strlcpy win32error) , $( LIBOBJS ) ) )
40+ # other external C files
41+ BACKEND_LIBPQ = md5 ip
42+ UTILS_MB = encnames wchar
4343
4444OBJS = fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
4545 fe-protocol2.o fe-protocol3.o pqexpbuffer.o pqsignal.o fe-secure.o \
4646 libpq-events.o \
47- $(addsuffix .o, $(PERM_PGPORT ) $( OPT_PGPORT ) $(BACKEND_LIBPQ ) $(UTILS_MB ) )
47+ $(addsuffix .o, $(PGPORT ) $(BACKEND_LIBPQ ) $(UTILS_MB ) )
4848
4949ifeq ($(PORTNAME ) , cygwin)
5050override shlib = cyg$(NAME )$(DLSUFFIX )
@@ -88,7 +88,7 @@ backend_src = $(top_srcdir)/src/backend
8888# necessarily use the same object files as the backend uses. Instead,
8989# we symlink the source files in here and build our own object files.
9090
91- $(addsuffix .c, $(PERM_PGPORT ) $( OPT_PGPORT ) ) : % : $(top_srcdir ) /src/port/%
91+ $(addsuffix .c, $(PGPORT ) ) : % : $(top_srcdir ) /src/port/%
9292 rm -f $@ && $(LN_S ) $< .
9393
9494$(addsuffix .c, $(BACKEND_LIBPQ ) ) : % : $(backend_src ) /libpq/%
@@ -131,7 +131,7 @@ uninstall: uninstall-lib
131131 rm -f ' $(DESTDIR)$(datadir)/pg_service.conf.sample'
132132
133133clean distclean : clean-lib
134- rm -f $(OBJS ) pg_config_paths.h pthread.h libpq.rc $(addsuffix .c, $(BACKEND_LIBPQ ) $(UTILS_MB ) $(PERM_PGPORT ) $( OPT_PGPORT ) )
134+ rm -f $(OBJS ) pg_config_paths.h pthread.h libpq.rc $(addsuffix .c, $(PGPORT ) $(BACKEND_LIBPQ ) $(UTILS_MB ) )
135135# Might be left over from a Win32 client-only build
136136 rm -f pg_config_paths.h
137137
0 commit comments