Re: More parallelism in makefile

Michael Elizabeth Chastain (
Wed, 28 Jan 1998 04:29:16 -0600

Hi Andreas,

> This patch improves the makefiles by making all subdirectories separate
> targets that can be built in parallel.

When CONFIG_MODVERSIONS is turned on, there are subtle ordering
dependencies where files that define symbols need to be compiled before
files that use the symbols.

More importantly, when CONFIG_MODVERSIONS is turned on, the sub-Makefiles
want to modify include/linux/modversions.h. If this happens in parallel
you will hose the build.

There is some obscure reason why Makefile targets depend on dummy rather
than being a dependency of .PHONY. I don't remember what it is, but it
has bitten me once.

Also I've had problems with dynamic % dependencies like this:

$(addsuffix _modules,$(SUBDIRS)): %_modules: include/linux/version.h

The dependency doesn't have a % substitution, so why not just this:

$(addsuffix _modules,$(SUBDIRS)): include/linux/version.h

In Rules.make, $(SYMTAB_OBJS) lost its dependency on $(SYMTAB_OBJS:%.o=%.c).
The original rule does cause excessive compilation, but by removing this
dependency, I believe you completely lose the dependency of foo.o on foo.c.
The pattern rule %.o : %.c does *not* provide a dependency for anything
that has explicit dependencies.

There's probably more but I'm falling asleep.