# for use only by the backend binaries
#
# IDENTIFICATION
-# $PostgreSQL: pgsql/src/port/Makefile,v 1.30 2005/12/09 21:19:36 petere Exp $
+# $PostgreSQL: pgsql/src/port/Makefile,v 1.31 2006/05/08 02:18:50 momjian Exp $
#
#-------------------------------------------------------------------------
override CPPFLAGS := -I$(top_builddir)/src/port -DFRONTEND $(CPPFLAGS)
LIBS += $(PTHREAD_LIBS)
-# Replace object files that use FRONTEND define
-LIBOBJS_SRV := $(LIBOBJS)
-LIBOBJS_SRV := $(patsubst dirmod.o,dirmod_srv.o, $(LIBOBJS_SRV))
-LIBOBJS_SRV := $(patsubst exec.o,exec_srv.o, $(LIBOBJS_SRV))
-LIBOBJS_SRV := $(patsubst getaddrinfo.o,getaddrinfo_srv.o, $(LIBOBJS_SRV))
-LIBOBJS_SRV := $(patsubst thread.o,thread_srv.o, $(LIBOBJS_SRV))
+# Replace all object files so they use FRONTEND define
+LIBOBJS_SRV := $(LIBOBJS:%.o=%_srv.o)
all: libpgport.a libpgport_srv.a
libpgport_srv.a: $(LIBOBJS_SRV)
$(AR) $(AROPT) $@ $^
-dirmod_srv.o: dirmod.c
- $(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@
-
-exec_srv.o: exec.c
- $(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@
-
-getaddrinfo_srv.o: getaddrinfo.c
+%_srv.o: %.c
$(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@
# No thread flags for server version