mirror of
https://github.com/postgres/postgres.git
synced 2025-06-10 09:21:54 +03:00
Put libpgport into OBJS instead of LIBS, so that it gets included
into .def and .exp files automatically on Windows, AIX, and the like. An additional benefit is that changes in libpgport files correctly propagate to force rebuild of the backend executable. This is my reworking of Rocco Altier's idea, and if it breaks anything it's definitely my fault.
This commit is contained in:
@ -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.108 2005/01/26 21:55:26 tgl Exp $
|
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.109 2005/07/28 04:31:30 tgl Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -17,19 +17,21 @@ DIRS := access bootstrap catalog parser commands executor lib libpq \
|
|||||||
main nodes optimizer port postmaster regex rewrite \
|
main nodes optimizer port postmaster regex rewrite \
|
||||||
storage tcop utils $(top_builddir)/src/timezone
|
storage tcop utils $(top_builddir)/src/timezone
|
||||||
|
|
||||||
OBJS := $(DIRS:%=%/SUBSYS.o)
|
SUBSYSOBJS := $(DIRS:%=%/SUBSYS.o)
|
||||||
|
|
||||||
|
OBJS := $(SUBSYSOBJS) $(top_builddir)/src/port/libpgport_srv.a
|
||||||
|
|
||||||
|
# We put libpgport into OBJS, so remove it from LIBS
|
||||||
|
LIBS := $(patsubst -lpgport, , $(LIBS))
|
||||||
|
|
||||||
ifeq ($(PORTNAME), qnx4)
|
ifeq ($(PORTNAME), qnx4)
|
||||||
# This file crashes qnx4's wlink and is therefore not in
|
# This file crashes qnx4's wlink and is therefore not in
|
||||||
# bootstrap/SUBSYS.o on that platform. (Wotta hack ... is it still
|
# bootstrap/SUBSYS.o on that platform. (Wotta hack ... is it still
|
||||||
# necessary?) [ Yes, until the Watcom compiler goes open source it's
|
# necessary?) [ Yes, until the Watcom compiler goes open source it's
|
||||||
# effectively unsupported ]
|
# effectively unsupported ]
|
||||||
OBJS+= bootstrap/bootstrap.o
|
OBJS += bootstrap/bootstrap.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Use server version of port library
|
|
||||||
LIBS := $(patsubst -lpgport,-lpgport_srv, $(LIBS))
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
all: submake-libpgport postgres $(POSTGRES_IMP)
|
all: submake-libpgport postgres $(POSTGRES_IMP)
|
||||||
@ -69,7 +71,7 @@ postgres: $(OBJS) $(DLLINIT) postgres.def libpostgres.a $(WIN32RES)
|
|||||||
rm -f $@.exp $@.base
|
rm -f $@.exp $@.base
|
||||||
|
|
||||||
postgres.def: $(OBJS)
|
postgres.def: $(OBJS)
|
||||||
$(DLLTOOL) --export-all --output-def $@ $^ $(top_builddir)/src/port/libpgport.a
|
$(DLLTOOL) --export-all --output-def $@ $^
|
||||||
|
|
||||||
libpostgres.a: postgres.def
|
libpostgres.a: postgres.def
|
||||||
$(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@
|
$(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@
|
||||||
@ -98,7 +100,7 @@ endif
|
|||||||
endif # aix
|
endif # aix
|
||||||
|
|
||||||
# Parallel make trickery
|
# Parallel make trickery
|
||||||
$(OBJS): $(DIRS:%=%-recursive) ;
|
$(SUBSYSOBJS): $(DIRS:%=%-recursive) ;
|
||||||
|
|
||||||
.PHONY: $(DIRS:%=%-recursive)
|
.PHONY: $(DIRS:%=%-recursive)
|
||||||
# Update the commonly used headers before building the subdirectories
|
# Update the commonly used headers before building the subdirectories
|
||||||
|
Reference in New Issue
Block a user