Bug #116665: parallel build fails There are two problems. 1. inttypes_netpbm.h is required by many files that include Makefile.common via the target importinc, but the rule to create it is included only in the root file GNUmakefile. 2. Several makefiles in subdirectories do not contain complete dependency information, especially dependencies on generated header files. This is addressed by making importinc a dependencie of recursive calls to make all. This patch also contains some changes between SRCDIR and BUILDDIR. As those are the same on Gentoo builds, these changes have not been tested. 2006-03-01 Martin von Gagern diff -rux Makefile.config netpbm-10.32/GNUmakefile netpbm/GNUmakefile --- netpbm-10.32/GNUmakefile 2006-02-25 20:02:54.000000000 +0100 +++ netpbm/GNUmakefile 2006-02-28 23:57:29.000000000 +0100 @@ -89,6 +89,7 @@ OMIT_CONFIG_RULE = 1 OMIT_VERSION_H_RULE = 1 +OMIT_INTTYPES_RULE = 1 include $(SRCDIR)/Makefile.common $(BUILDDIR)/Makefile.config: $(SRCDIR)/Makefile.config.in @@ -107,7 +108,7 @@ DELETEIT = (rm -f $@ || false) -inttypes_netpbm.h: $(TYPEGEN) +$(BUILDDIR)/inttypes_netpbm.h: $(TYPEGEN) $(TYPEGEN) >$@ || $(DELETEIT) # We run a couple of programs on the build machine in computing the diff -rux Makefile.config netpbm-10.32/Makefile.common netpbm/Makefile.common --- netpbm-10.32/Makefile.common 2006-02-25 19:53:48.000000000 +0100 +++ netpbm/Makefile.common 2006-02-28 23:53:49.000000000 +0100 @@ -129,13 +129,11 @@ $(IMPORTINC_LIB_FILES) \ $(IMPORTINC_LIB_UTIL_FILES) \ -$(IMPORTINC_ROOT_FILES):importinc/%:$(SRCDIR)/% +$(IMPORTINC_ROOT_FILES):importinc/%:$(BUILDDIR)/% mkdir -p importinc rm -f $@ $(SYMLINK) $< $@ -importinc/pm_config.h: $(BUILDDIR)/pm_config.h - $(IMPORTINC_LIB_FILES):importinc/%:$(SRCDIR)/lib/% mkdir -p importinc rm -f $@ @@ -168,6 +166,11 @@ $(MAKE) -C $(dir $@) $(notdir $@) endif +ifneq ($(OMIT_INTTYPES_RULE),1) +$(BUILDDIR)/inttypes_netpbm.h: + $(MAKE) -C $(dir $@) -f $(SRCDIR)/GNUmakefile $(notdir $@) +endif + # Note that any time you do a make on a fresh Netpbm source tree, # Make notices that 'Makefile.config', which the make files include, does not # exist and runs the "Makefile.config" target, which runs Configure. @@ -484,7 +487,7 @@ %/install.merge: $(MAKE) -C $(dir $@) -f $(SRCDIR)/$(SUBDIR)/$(dir $@)Makefile \ SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) $(notdir $@) -$(SUBDIRS:%=%/all): %/all: $(CURDIR)/% +$(SUBDIRS:%=%/all): %/all: $(CURDIR)/% importinc $(MAKE) -C $(dir $@) -f $(SRCDIR)/$(SUBDIR)/$(dir $@)Makefile \ SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) $(notdir $@) $(SUBDIRS:%=%/mergetrylist): %/mergetrylist: $(CURDIR)/% FORCE