Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Make the AIX case of Makefile.shlib safe for parallel make.
authorNoah Misch <noah@leadboat.com>
Sun, 24 Jul 2016 00:30:03 +0000 (20:30 -0400)
committerNoah Misch <noah@leadboat.com>
Sun, 24 Jul 2016 00:30:48 +0000 (20:30 -0400)
Use our typical approach, from src/backend/parser.  Back-patch to 9.1
(all supported versions).

src/Makefile.shlib

index 4ca894a29328738845233fb8e8713008c8f47abf..3a6b404371bf8506df165aedbeb4017b59f733fa 100644 (file)
@@ -357,7 +357,16 @@ endif
 else # PORTNAME == aix
 
 # AIX case
-$(shlib) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
+
+# There is no correct way to write a rule that generates two files.
+# Rules with two targets don't have that meaning, they are merely
+# shorthand for two otherwise separate rules.  To be safe for parallel
+# make, we must chain the dependencies like this.  The semicolon is
+# important, otherwise make will choose some built-in rule.
+
+$(stlib): $(shlib) ;
+
+$(shlib): $(OBJS) | $(SHLIB_PREREQS)
    rm -f $(stlib)
    $(LINK.static) $(stlib) $^
    $(RANLIB) $(stlib)