summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2015-03-01 13:05:23 -0500
committerNoah Misch <noah@leadboat.com>2015-03-01 13:06:39 -0500
commit585f16dc80337a2ee7b0e823c7ff42a9e10d1d88 (patch)
tree7153fa67a1ae572a71de1c8856fd0a154589bb7e /src
parent1b558782b7156bac9b4012ccee5338f1ccd236d9 (diff)
Unlink static libraries before rebuilding them.
When the library already exists in the build directory, "ar" preserves members not named on its command line. This mattered when, for example, a "configure" rerun dropped a file from $(LIBOBJS). libpgport carried the obsolete member until "make clean". Back-patch to 9.0 (all supported versions).
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.shlib3
-rw-r--r--src/common/Makefile2
-rw-r--r--src/port/Makefile2
3 files changed, 7 insertions, 0 deletions
diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index ac095374295..4ca894a2932 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -316,6 +316,7 @@ all-shared-lib: $(shlib)
ifndef haslibarule
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
+ rm -f $@
$(LINK.static) $@ $^
$(RANLIB) $@
endif #haslibarule
@@ -357,6 +358,7 @@ else # PORTNAME == aix
# AIX case
$(shlib) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
+ rm -f $(stlib)
$(LINK.static) $(stlib) $^
$(RANLIB) $(stlib)
$(MKLDEXPORT) $(stlib) >$(exports_file)
@@ -377,6 +379,7 @@ $(shlib): $(OBJS) | $(SHLIB_PREREQS)
$(CC) $(CFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
+ rm -f $@
$(LINK.static) $@ $^
$(RANLIB) $@
diff --git a/src/common/Makefile b/src/common/Makefile
index b5889f7380f..e8fb1ec86bb 100644
--- a/src/common/Makefile
+++ b/src/common/Makefile
@@ -42,6 +42,7 @@ uninstall:
rm -f '$(DESTDIR)$(libdir)/libpgcommon.a'
libpgcommon.a: $(OBJS_FRONTEND)
+ rm -f $@
$(AR) $(AROPT) $@ $^
#
@@ -49,6 +50,7 @@ libpgcommon.a: $(OBJS_FRONTEND)
#
libpgcommon_srv.a: $(OBJS_SRV)
+ rm -f $@
$(AR) $(AROPT) $@ $^
# Because this uses its own compilation rule, it doesn't use the
diff --git a/src/port/Makefile b/src/port/Makefile
index a032acca1c2..3a26006b7c1 100644
--- a/src/port/Makefile
+++ b/src/port/Makefile
@@ -52,6 +52,7 @@ uninstall:
rm -f '$(DESTDIR)$(libdir)/libpgport.a'
libpgport.a: $(OBJS)
+ rm -f $@
$(AR) $(AROPT) $@ $^
# thread.o needs PTHREAD_CFLAGS (but thread_srv.o does not)
@@ -62,6 +63,7 @@ thread.o: CFLAGS+=$(PTHREAD_CFLAGS)
#
libpgport_srv.a: $(OBJS_SRV)
+ rm -f $@
$(AR) $(AROPT) $@ $^
# Because this uses its own compilation rule, it doesn't use the