[hackers] [stali][patch] Change dependency specifications in makefiles

From: Evan Gates <evan.gates_AT_gmail.com>
Date: Wed, 7 Sep 2016 16:29:56 -0700

I've made a lot of changes to the makefiles to specify dependencies
correctly and allow parallel builds with make -j. Please be on the
lookout for bugs and please bring up any objections/criticism.

Specify dependencies correctly to allow parallel builds with -j.
Previously the makefiles relied upon sequential execution in order to
ensure prerequisites were built first. The new dependencies are done
on a per package level and a per directory level. For example parts of
the parted package depend on parts of the e2fsprogs package. Instead
of listing the exact dependencies and recipes in the parted makefile,
list e2fsprog as a prerequisite for parted in the bin/stali.mk. While
this isn't as exact, and means that you can't build parted directly
from its directory without building anything else, it sucks much less
to implement and puts dependencies in a more central location and
makes them easier to read and add to.

Using guard files to protect against redundant recipe execution. In
some instances more than one target is built by a single execution of
a recipe. For example, the awk package uses yacc to create both ytab.h
and ytab.c from awkgram.y. However when doing a parallel build the
recipe would be executed twice in parallel, once to create ytab.h and
once to create ytab.c. In order to avoid this an intermediate rule is
used. The rule could be PHONY, but then it would run every time
instead of only when the grammar is updated. Instead the intermediate
rule, called _ytab, touches a file called _ytab so we have a
modification time to compare against. I used the convention of guard
files begining with an underscore.

Received on Thu Sep 08 2016 - 01:29:56 CEST

This archive was generated by hypermail 2.3.0 : Thu Sep 08 2016 - 01:36:18 CEST