Fix up the parallel building. Without this fix, each instance of the NTARGETS will try to build the libraries seperately, and on a suitably fast machine this can lead to overwriting. Add a specific instance to build the libraries first. Signed-off-by: Robin H. Johnson diff -Nuar mtd-utils.orig/ubi-utils/Makefile mtd-utils/ubi-utils/Makefile --- mtd-utils.orig/ubi-utils/Makefile 2008-09-23 18:51:00.129193374 -0700 +++ mtd-utils/ubi-utils/Makefile 2008-09-23 18:54:04.097290355 -0700 @@ -34,7 +34,10 @@ IGNORE=${wildcard .*.c.dep} -include ${IGNORE} -$(NTARGETS): +nlibs: + $(MAKE) -C new-utils libs + +$(NTARGETS): nlibs $(MAKE) -C new-utils $@ mv new-utils/$@ $@ diff -Nuar mtd-utils.orig/ubi-utils/new-utils/Makefile mtd-utils/ubi-utils/new-utils/Makefile --- mtd-utils.orig/ubi-utils/new-utils/Makefile 2008-09-23 18:51:00.179204851 -0700 +++ mtd-utils/ubi-utils/new-utils/Makefile 2008-09-23 18:53:32.513881545 -0700 @@ -19,6 +19,7 @@ vpath %.c src all: $(UTILS) +libs: $(addsuffix .a,$(LIBS)) # The below cancels existing implicite rule to make programs from .c files, # in order to force make using our rule defined below