Commit 24201b4b authored by Bruce Momjian's avatar Bruce Momjian

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.
parent 3da69bd1
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.104 2004/08/01 18:07:42 tgl Exp $ # $PostgreSQL: pgsql/src/backend/Makefile,v 1.105 2004/10/04 13:43:54 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -26,6 +26,8 @@ ifeq ($(PORTNAME), qnx4) ...@@ -26,6 +26,8 @@ ifeq ($(PORTNAME), qnx4)
OBJS+= bootstrap/bootstrap.o OBJS+= bootstrap/bootstrap.o
endif endif
# Use server version of port library
LIBS := $(patsubst -lpgport,-lpgport_srv, $(LIBS))
########################################################################## ##########################################################################
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.44 2004/08/29 04:13:01 momjian Exp $ # $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.45 2004/10/04 13:43:55 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -13,21 +13,15 @@ subdir = src/bin/initdb ...@@ -13,21 +13,15 @@ subdir = src/bin/initdb
top_builddir = ../../.. top_builddir = ../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS) override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
OBJS= initdb.o dirmod.o exec.o OBJS= initdb.o
all: submake-libpq submake-libpgport initdb all: submake-libpq submake-libpgport initdb
initdb: $(OBJS) $(libpq_builddir)/libpq.a initdb: $(OBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
dirmod.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
exec.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
install: all installdirs install: all installdirs
$(INSTALL_PROGRAM) initdb$(X) $(DESTDIR)$(bindir)/initdb$(X) $(INSTALL_PROGRAM) initdb$(X) $(DESTDIR)$(bindir)/initdb$(X)
...@@ -38,7 +32,7 @@ uninstall: ...@@ -38,7 +32,7 @@ uninstall:
rm -f $(DESTDIR)$(bindir)/initdb$(X) rm -f $(DESTDIR)$(bindir)/initdb$(X)
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f initdb$(X) $(OBJS) dirmod.c exec.c rm -f initdb$(X) $(OBJS)
# ensure that changes in datadir propagate into object file # ensure that changes in datadir propagate into object file
......
# $PostgreSQL: pgsql/src/bin/pg_config/Makefile,v 1.8 2004/08/01 06:56:38 momjian Exp $ #-------------------------------------------------------------------------
#
# Makefile for src/bin/pg_controldata
#
# Copyright (c) 1998-2002, PostgreSQL Global Development Group
#
# $PostgreSQL: pgsql/src/bin/pg_config/Makefile,v 1.9 2004/10/04 13:43:55 momjian Exp $
#
#-------------------------------------------------------------------------
subdir = src/bin/pg_config subdir = src/bin/pg_config
top_builddir = ../../.. top_builddir = ../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
OBJS= pg_config.o exec.o OBJS= pg_config.o
override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) -DVAL_CONFIGURE="\"$(configure_args)\"" $(CPPFLAGS) override CPPFLAGS := -I$(libpq_srcdir) -DVAL_CONFIGURE="\"$(configure_args)\"" $(CPPFLAGS)
all: submake-libpgport pg_config all: submake-libpgport pg_config
exec.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
pg_config: $(OBJS) pg_config: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $@$(X)
...@@ -26,4 +31,4 @@ uninstall: ...@@ -26,4 +31,4 @@ uninstall:
rm -f $(DESTDIR)$(bindir)/pg_config rm -f $(DESTDIR)$(bindir)/pg_config
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f pg_config$(X) $(OBJS) exec.c rm -f pg_config$(X) $(OBJS)
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1998-2002, PostgreSQL Global Development Group # Copyright (c) 1998-2002, PostgreSQL Global Development Group
# #
# $PostgreSQL: pgsql/src/bin/pg_controldata/Makefile,v 1.9 2004/05/26 17:24:01 tgl Exp $ # $PostgreSQL: pgsql/src/bin/pg_controldata/Makefile,v 1.10 2004/10/04 13:43:55 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -14,7 +14,7 @@ include $(top_builddir)/src/Makefile.global ...@@ -14,7 +14,7 @@ include $(top_builddir)/src/Makefile.global
override CPPFLAGS += -DFRONTEND override CPPFLAGS += -DFRONTEND
OBJS= pg_controldata.o pg_crc.o exec.o OBJS= pg_controldata.o pg_crc.o
all: submake-libpgport pg_controldata all: submake-libpgport pg_controldata
...@@ -24,9 +24,6 @@ pg_controldata: $(OBJS) ...@@ -24,9 +24,6 @@ pg_controldata: $(OBJS)
pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c
rm -f $@ && $(LN_S) $< . rm -f $@ && $(LN_S) $< .
exec.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
install: all installdirs install: all installdirs
$(INSTALL_PROGRAM) pg_controldata$(X) $(DESTDIR)$(bindir)/pg_controldata$(X) $(INSTALL_PROGRAM) pg_controldata$(X) $(DESTDIR)$(bindir)/pg_controldata$(X)
...@@ -37,4 +34,4 @@ uninstall: ...@@ -37,4 +34,4 @@ uninstall:
rm -f $(DESTDIR)$(bindir)/pg_controldata$(X) rm -f $(DESTDIR)$(bindir)/pg_controldata$(X)
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f pg_controldata$(X) $(OBJS) pg_crc.c exec.c rm -f pg_controldata$(X) $(OBJS) pg_crc.c
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.15 2004/08/29 04:13:01 momjian Exp $ # $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.16 2004/10/04 13:43:56 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -13,18 +13,15 @@ subdir = src/bin/pg_ctl ...@@ -13,18 +13,15 @@ subdir = src/bin/pg_ctl
top_builddir = ../../.. top_builddir = ../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -DFRONTEND -DDEF_PGPORT=$(DEF_PGPORT) -I$(libpq_srcdir) $(CPPFLAGS) override CPPFLAGS := -DDEF_PGPORT=$(DEF_PGPORT) -I$(libpq_srcdir) $(CPPFLAGS)
OBJS= pg_ctl.o exec.o OBJS= pg_ctl.o
all: submake-libpq submake-libpgport pg_ctl all: submake-libpq submake-libpgport pg_ctl
pg_ctl: $(OBJS) $(libpq_builddir)/libpq.a pg_ctl: $(OBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
exec.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
install: all installdirs install: all installdirs
$(INSTALL_PROGRAM) pg_ctl$(X) $(DESTDIR)$(bindir)/pg_ctl$(X) $(INSTALL_PROGRAM) pg_ctl$(X) $(DESTDIR)$(bindir)/pg_ctl$(X)
...@@ -35,7 +32,7 @@ uninstall: ...@@ -35,7 +32,7 @@ uninstall:
rm -f $(DESTDIR)$(bindir)/pg_ctl$(X) rm -f $(DESTDIR)$(bindir)/pg_ctl$(X)
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f pg_ctl$(X) $(OBJS) exec.c rm -f pg_ctl$(X) $(OBJS)
# ensure that changes in DEF_PGPORT propagate into object file # ensure that changes in DEF_PGPORT propagate into object file
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.52 2004/05/25 01:00:24 momjian Exp $ # $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.53 2004/10/04 13:43:56 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -13,11 +13,11 @@ subdir = src/bin/pg_dump ...@@ -13,11 +13,11 @@ subdir = src/bin/pg_dump
top_builddir = ../../.. top_builddir = ../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -DFRONTEND override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o \ OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o \
pg_backup_files.o pg_backup_null.o pg_backup_tar.o \ pg_backup_files.o pg_backup_null.o pg_backup_tar.o \
dumputils.o exec.o dumputils.o
EXTRA_OBJS = $(top_builddir)/src/backend/parser/keywords.o EXTRA_OBJS = $(top_builddir)/src/backend/parser/keywords.o
...@@ -30,12 +30,8 @@ pg_dump: pg_dump.o common.o pg_dump_sort.o $(OBJS) $(libpq_builddir)/libpq.a ...@@ -30,12 +30,8 @@ pg_dump: pg_dump.o common.o pg_dump_sort.o $(OBJS) $(libpq_builddir)/libpq.a
pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) pg_restore.o $(OBJS) $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) pg_restore.o $(OBJS) $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
pg_dumpall: pg_dumpall.o dumputils.o exec.o $(libpq_builddir)/libpq.a pg_dumpall: pg_dumpall.o dumputils.o $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) pg_dumpall.o dumputils.o exec.o $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) pg_dumpall.o dumputils.o $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
# We need our own build of exec.c so it gets made with -DFRONTEND
exec.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
.PHONY: submake-backend .PHONY: submake-backend
submake-backend: submake-backend:
...@@ -54,4 +50,4 @@ uninstall: ...@@ -54,4 +50,4 @@ uninstall:
rm -f $(addprefix $(DESTDIR)$(bindir)/, pg_dump$(X) pg_restore$(X) pg_dumpall$(X)) rm -f $(addprefix $(DESTDIR)$(bindir)/, pg_dump$(X) pg_restore$(X) pg_dumpall$(X))
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f pg_dump$(X) pg_restore$(X) pg_dumpall$(X) $(OBJS) pg_dump.o common.o pg_dump_sort.o pg_restore.o pg_dumpall.o exec.c rm -f pg_dump$(X) pg_restore$(X) pg_dumpall$(X) $(OBJS) pg_dump.o common.o pg_dump_sort.o pg_restore.o pg_dumpall.o
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1998-2002, PostgreSQL Global Development Group # Copyright (c) 1998-2002, PostgreSQL Global Development Group
# #
# $PostgreSQL: pgsql/src/bin/pg_resetxlog/Makefile,v 1.11 2004/08/01 06:22:38 momjian Exp $ # $PostgreSQL: pgsql/src/bin/pg_resetxlog/Makefile,v 1.12 2004/10/04 13:43:57 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -14,22 +14,16 @@ include $(top_builddir)/src/Makefile.global ...@@ -14,22 +14,16 @@ include $(top_builddir)/src/Makefile.global
override CPPFLAGS += -DFRONTEND override CPPFLAGS += -DFRONTEND
OBJS= pg_resetxlog.o pg_crc.o dirmod.o exec.o OBJS= pg_resetxlog.o pg_crc.o
all: submake-libpgport pg_resetxlog all: submake-libpgport pg_resetxlog
pg_resetxlog: $(OBJS) pg_resetxlog: $(OBJS)
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@$(X)
dirmod.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c
rm -f $@ && $(LN_S) $< . rm -f $@ && $(LN_S) $< .
exec.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
install: all installdirs install: all installdirs
$(INSTALL_PROGRAM) pg_resetxlog$(X) $(DESTDIR)$(bindir)/pg_resetxlog$(X) $(INSTALL_PROGRAM) pg_resetxlog$(X) $(DESTDIR)$(bindir)/pg_resetxlog$(X)
...@@ -40,4 +34,4 @@ uninstall: ...@@ -40,4 +34,4 @@ uninstall:
rm -f $(DESTDIR)$(bindir)/pg_resetxlog$(X) rm -f $(DESTDIR)$(bindir)/pg_resetxlog$(X)
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f pg_resetxlog$(X) $(OBJS) pg_crc.c dirmod.c exec.c rm -f pg_resetxlog$(X) $(OBJS) pg_crc.c
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.47 2004/05/24 01:01:37 momjian Exp $ # $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.48 2004/10/04 13:43:57 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -19,7 +19,7 @@ override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -DFRONTEND ...@@ -19,7 +19,7 @@ override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -DFRONTEND
OBJS= command.o common.o help.o input.o stringutils.o mainloop.o copy.o \ OBJS= command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
startup.o prompt.o variables.o large_obj.o print.o describe.o \ startup.o prompt.o variables.o large_obj.o print.o describe.o \
psqlscan.o tab-complete.o mbprint.o exec.o psqlscan.o tab-complete.o mbprint.o
FLEXFLAGS = -Cfe FLEXFLAGS = -Cfe
...@@ -29,9 +29,6 @@ all: submake-libpq submake-libpgport psql ...@@ -29,9 +29,6 @@ all: submake-libpq submake-libpgport psql
psql: $(OBJS) $(libpq_builddir)/libpq.a psql: $(OBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
exec.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
help.o: $(srcdir)/sql_help.h help.o: $(srcdir)/sql_help.h
ifdef PERL ifdef PERL
...@@ -63,7 +60,7 @@ uninstall: ...@@ -63,7 +60,7 @@ uninstall:
# psqlscan.c is in the distribution tarball, so is not cleaned here # psqlscan.c is in the distribution tarball, so is not cleaned here
clean distclean: clean distclean:
rm -f psql$(X) $(OBJS) exec.c rm -f psql$(X) $(OBJS)
maintainer-clean: distclean maintainer-clean: distclean
rm -f $(srcdir)/sql_help.h $(srcdir)/psqlscan.c rm -f $(srcdir)/sql_help.h $(srcdir)/psqlscan.c
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.28 2004/05/26 17:24:05 tgl Exp $ # $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.29 2004/10/04 13:43:57 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -15,28 +15,25 @@ include $(top_builddir)/src/Makefile.global ...@@ -15,28 +15,25 @@ include $(top_builddir)/src/Makefile.global
PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vacuumdb PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vacuumdb
override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS) override CPPFLAGS := -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS)
all: submake-libpq submake-backend $(PROGRAMS) all: submake-libpq submake-backend $(PROGRAMS)
%: %.o %: %.o
$(CC) $(CFLAGS) $^ $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $^ $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
createdb: createdb.o common.o exec.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o createdb: createdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
createlang: createlang.o common.o exec.o print.o mbprint.o createlang: createlang.o common.o print.o mbprint.o
createuser: createuser.o common.o exec.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o createuser: createuser.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
dropdb: dropdb.o common.o exec.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o dropdb: dropdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
droplang: droplang.o common.o exec.o print.o mbprint.o droplang: droplang.o common.o print.o mbprint.o
dropuser: dropuser.o common.o exec.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o dropuser: dropuser.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
clusterdb: clusterdb.o common.o exec.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o clusterdb: clusterdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
vacuumdb: vacuumdb.o common.o exec.o vacuumdb: vacuumdb.o common.o
dumputils.c: % : $(top_srcdir)/src/bin/pg_dump/% dumputils.c: % : $(top_srcdir)/src/bin/pg_dump/%
rm -f $@ && $(LN_S) $< . rm -f $@ && $(LN_S) $< .
exec.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
print.c mbprint.c : % : $(top_srcdir)/src/bin/psql/% print.c mbprint.c : % : $(top_srcdir)/src/bin/psql/%
rm -f $@ && $(LN_S) $< . rm -f $@ && $(LN_S) $< .
...@@ -64,5 +61,5 @@ uninstall: ...@@ -64,5 +61,5 @@ uninstall:
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f $(addsuffix $(X), $(PROGRAMS)) $(addsuffix .o, $(PROGRAMS)) rm -f $(addsuffix $(X), $(PROGRAMS)) $(addsuffix .o, $(PROGRAMS))
rm -f common.o dumputils.o exec.o print.o mbprint.o rm -f common.o dumputils.o print.o mbprint.o
rm -f dumputils.c exec.c print.c mbprint.c rm -f dumputils.c print.c mbprint.c
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.107 2004/05/24 01:01:38 momjian Exp $ #-------------------------------------------------------------------------
#
# Makefile for src/interfaces/ecpg/preproc
#
# Copyright (c) 1998-2002, PostgreSQL Global Development Group
#
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.108 2004/10/04 13:43:58 momjian Exp $
#
#-------------------------------------------------------------------------
subdir = src/interfaces/ecpg/preproc subdir = src/interfaces/ecpg/preproc
top_builddir = ../../../.. top_builddir = ../../../..
...@@ -10,8 +18,7 @@ PATCHLEVEL=0 ...@@ -10,8 +18,7 @@ PATCHLEVEL=0
override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) \ override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) \
-DMAJOR_VERSION=$(MAJOR_VERSION) \ -DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL)
-DFRONTEND
ifeq ($(GCC), yes) ifeq ($(GCC), yes)
override CFLAGS += -Wno-error override CFLAGS += -Wno-error
...@@ -19,17 +26,13 @@ endif ...@@ -19,17 +26,13 @@ endif
override CFLAGS += $(PTHREAD_CFLAGS) override CFLAGS += $(PTHREAD_CFLAGS)
OBJS= preproc.o type.o ecpg.o ecpg_keywords.o output.o\ OBJS= preproc.o type.o ecpg.o ecpg_keywords.o output.o\
keywords.o c_keywords.o ../ecpglib/typename.o descriptor.o variable.o \ keywords.o c_keywords.o ../ecpglib/typename.o descriptor.o variable.o
exec.o
all: submake-libpgport ecpg all: submake-libpgport ecpg
ecpg: $(OBJS) ecpg: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) $(PTHREAD_LIBS) -o $@$(X) $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) $(PTHREAD_LIBS) -o $@$(X)
exec.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
# pgc is compiled as part of preproc # pgc is compiled as part of preproc
preproc.o: $(srcdir)/pgc.c preproc.o: $(srcdir)/pgc.c
...@@ -66,7 +69,7 @@ uninstall: ...@@ -66,7 +69,7 @@ uninstall:
rm -f $(DESTDIR)$(bindir)/ecpg$(X) rm -f $(DESTDIR)$(bindir)/ecpg$(X)
clean distclean: clean distclean:
rm -f *.o ecpg$(X) exec.c rm -f *.o ecpg$(X)
# garbage from partial builds # garbage from partial builds
@rm -f y.tab.c y.tab.h @rm -f y.tab.c y.tab.h
# garbage from development # garbage from development
......
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile-- # Makefile
# Makefile for the port-specific subsystem of the backend # Makefile for the port-specific subsystem of the backend
# #
# These files are used in other directories for portability on systems # 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 # 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 ...@@ -15,10 +23,17 @@ subdir = src/port
top_builddir = ../.. top_builddir = ../..
include $(top_builddir)/src/Makefile.global 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) 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 # libpgport is needed by some contrib
install-all-headers: install-all-headers:
...@@ -35,6 +50,26 @@ thread.o: thread.c ...@@ -35,6 +50,26 @@ thread.o: thread.c
path.o: path.c pg_config_paths.h 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 # Dependency is to ensure that path changes propagate
pg_config_paths.h: $(top_builddir)/src/Makefile.global pg_config_paths.h: $(top_builddir)/src/Makefile.global
echo "#define PGBINDIR \"$(bindir)\"" >$@ echo "#define PGBINDIR \"$(bindir)\"" >$@
...@@ -48,4 +83,4 @@ pg_config_paths.h: $(top_builddir)/src/Makefile.global ...@@ -48,4 +83,4 @@ pg_config_paths.h: $(top_builddir)/src/Makefile.global
echo "#define LOCALEDIR \"$(localedir)\"" >>$@ echo "#define LOCALEDIR \"$(localedir)\"" >>$@
clean distclean maintainer-clean: 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
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile-- # Makefile
# Makefile for the timezone library # Makefile for the timezone library
# IDENTIFICATION # IDENTIFICATION
# $PostgreSQL: pgsql/src/timezone/Makefile,v 1.15 2004/08/08 05:19:44 momjian Exp $ # $PostgreSQL: pgsql/src/timezone/Makefile,v 1.16 2004/10/04 13:43:59 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -12,13 +12,13 @@ subdir = src/timezone ...@@ -12,13 +12,13 @@ subdir = src/timezone
top_builddir = ../.. top_builddir = ../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -DFRONTEND $(CPPFLAGS) override CPPFLAGS := $(CPPFLAGS)
# files to build into backend # files to build into backend
OBJS= localtime.o strftime.o pgtz.o OBJS= localtime.o strftime.o pgtz.o
# files needed to build zic utility program # files needed to build zic utility program
ZICOBJS= zic.o ialloc.o scheck.o localtime.o dirmod.o ZICOBJS= zic.o ialloc.o scheck.o localtime.o
# timezone data files # timezone data files
TZDATA := africa antarctica asia australasia europe northamerica southamerica \ TZDATA := africa antarctica asia australasia europe northamerica southamerica \
...@@ -33,9 +33,6 @@ SUBSYS.o: $(OBJS) ...@@ -33,9 +33,6 @@ SUBSYS.o: $(OBJS)
zic: $(ZICOBJS) zic: $(ZICOBJS)
$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X)
dirmod.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
install: all installdirs install: all installdirs
./zic -d $(DESTDIR)$(datadir)/timezone $(TZDATAFILES) ./zic -d $(DESTDIR)$(datadir)/timezone $(TZDATAFILES)
...@@ -43,4 +40,4 @@ installdirs: ...@@ -43,4 +40,4 @@ installdirs:
$(mkinstalldirs) $(DESTDIR)$(datadir) $(mkinstalldirs) $(DESTDIR)$(datadir)
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f SUBSYS.o zic $(OBJS) $(ZICOBJS) dirmod.c rm -f SUBSYS.o zic $(OBJS) $(ZICOBJS)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment