diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 86db52fe5e..924d21f443 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -338,7 +338,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)