all-shared-lib: $(shlib)
+# In this rule, "touch $@" works around a problem on some platforms wherein
+# ranlib updates the library file's mod time with a value calculated to
+# seconds precision. If the filesystem has sub-second timestamps, this can
+# cause the library file to appear older than its input files, triggering
+# parallel-make problems.
ifndef haslibarule
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
rm -f $@
$(LINK.static) $@ $^
$(RANLIB) $@
+ touch $@
endif #haslibarule
# Cygwin case
$(shlib): $(OBJS) | $(SHLIB_PREREQS)
- $(CC) $(CFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
+ $(CC) $(CFLAGS) -shared -o $@ -Wl,--out-implib=$(stlib) $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
-$(stlib): $(OBJS) | $(SHLIB_PREREQS)
- rm -f $@
- $(LINK.static) $@ $^
- $(RANLIB) $@
+# see notes in src/backend/parser/Makefile about use of this type of rule
+$(stlib): $(shlib)
+ touch $@
else
$(INSTALL_STLIB) $< '$(DESTDIR)$(libdir)/$(stlib)'
ifeq ($(PORTNAME), darwin)
cd '$(DESTDIR)$(libdir)' && \
- ranlib $(stlib)
+ $(RANLIB) $(stlib)
endif
install-lib-shared: $(shlib) installdirs-lib