diff options
| author | Bruce Momjian <bruce@momjian.us> | 2004-10-04 13:43:59 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2004-10-04 13:43:59 +0000 |
| commit | 24201b4bc60e46e8de031fb5911af32bdb412d43 (patch) | |
| tree | a92e5c74b3cbb31f8d0a993bd182577526bd2205 /src/port/Makefile | |
| parent | 3da69bd18c48f298068405be0748bb2ae7cd6359 (diff) | |
| download | postgresql-24201b4bc60e46e8de031fb5911af32bdb412d43.tar.gz | |
Make libpgport be front-end only and make libpgport_srv be a backend
library that uses palloc, ereport, etc. This simplifies the makefiles
for client applications.
Diffstat (limited to 'src/port/Makefile')
| -rw-r--r-- | src/port/Makefile | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/src/port/Makefile b/src/port/Makefile index a5cc24c386..c9c66b9129 100644 --- a/src/port/Makefile +++ b/src/port/Makefile @@ -1,13 +1,21 @@ #------------------------------------------------------------------------- # -# Makefile-- +# Makefile # Makefile for the port-specific subsystem of the backend # # These files are used in other directories for portability on systems -# with broken/missing library files. - +# with broken/missing library files, and for common code sharing. +# +# This makefile generates two outputs: +# +# libpgport.a - contains object files with FRONTEND defined, +# for use by client application and libraries +# +# libpgport_srv.a - contains object files without FRONTEND defined, +# for use only by the backend binaries +# # IDENTIFICATION -# $PostgreSQL: pgsql/src/port/Makefile,v 1.18 2004/08/28 22:55:06 momjian Exp $ +# $PostgreSQL: pgsql/src/port/Makefile,v 1.19 2004/10/04 13:43:58 momjian Exp $ # #------------------------------------------------------------------------- @@ -15,10 +23,17 @@ subdir = src/port top_builddir = ../.. include $(top_builddir)/src/Makefile.global -override CPPFLAGS := -I$(top_builddir)/src/port $(CPPFLAGS) +override CPPFLAGS := -I$(top_builddir)/src/port -DFRONTEND $(CPPFLAGS) LIBS += $(PTHREAD_LIBS) -all: libpgport.a +# 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)) + +all: libpgport.a libpgport_srv.a # libpgport is needed by some contrib install-all-headers: @@ -35,6 +50,26 @@ thread.o: thread.c path.o: path.c pg_config_paths.h +# +# Server versions of object files +# + +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 + $(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@ + +# No thread flags for server version +thread_srv.o: thread.c + $(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@ + # Dependency is to ensure that path changes propagate pg_config_paths.h: $(top_builddir)/src/Makefile.global echo "#define PGBINDIR \"$(bindir)\"" >$@ @@ -48,4 +83,4 @@ pg_config_paths.h: $(top_builddir)/src/Makefile.global echo "#define LOCALEDIR \"$(localedir)\"" >>$@ clean distclean maintainer-clean: - rm -f libpgport.a $(LIBOBJS) pg_config_paths.h + rm -f libpgport.a libpgport_srv.a $(LIBOBJS) $(LIBOBJS_SRV) pg_config_paths.h |
