diff --git a/Makefile b/Makefile index 52959ea..ef5ad40 100644 --- a/Makefile +++ b/Makefile @@ -203,11 +203,7 @@ $(LIBDIR)/libgray.so: $(MODULES) | $(LIBDIR) $(LD) -shared $(LDFLAGS) -o '$@' $^ # GRAY static library -$(LIBDIR)/libgray.a($(MODULES)): | $(LIBDIR) -$(LIBDIR)/libgray.a: $(LIBDIR)/libgray.a($(MODULES)) - -# Don't update archives in parallel, it's unsupported -.NOTPARALLEL: $(LIBDIR)/libgray.a +$(LIBDIR)/libgray.a: $(LIBDIR)/libgray.a($(MODULES)) | $(LIBDIR) # GRAY static library when compiling from JETTO -include ../include.mk @@ -270,6 +266,12 @@ $(OBJDIR)/%.d: %.f90 | $(OBJDIR) sort -u >> '$@' @sed -nE 's@^#include "(.+)"@$(INCDIR)/\1 \\@p' '$<' >> '$@' +# Accumulate members and update archives all at once +# Note: this replaces the default POSIX rules that +# break under parallel building (make -j) +(%) : % ; +%.a : ; $(AR) $(ARFLAGS) $@ $? + # Load the generated rules include $(DEPS)