Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel make issue #394

Closed
osresearch opened this issue May 2, 2018 · 2 comments
Closed

Parallel make issue #394

osresearch opened this issue May 2, 2018 · 2 comments

Comments

@osresearch
Copy link
Collaborator

osresearch commented May 2, 2018

I think our parallel make issue might be a Make bug, rather than a makefile bug. Here's a minimal test case inspired by this answer https://stackoverflow.com/a/47951465 :

all: e
.INTERMEDIATE: d

e: a b c
    cat $^ > $@
a b c: d
d: i1 i2
    cat i1 i2 > a
    cat i1 i2 > b
    cat i1 i2 > c

i1 i2:
    touch $@

In a single threaded make this does the right thing. it creates i1 and i2, then cats them to make a b and c, then cats a b c to make e.

/tmp: make
touch i1
touch i2
cat i1 i2 > a
cat i1 i2 > b
cat i1 i2 > c
cat a b c > e

If e doesn't exist, it is recreated correctly in a parallel make:

/tmp: rm i1 i2 e a b c
/tmp: make -j4
touch i1
touch i2
cat i1 i2 > a
cat i1 i2 > b
cat i1 i2 > c
cat a b c > e

But if e already exists, make will regenerate a, b, and c, but not update e on the first run. It does recreate e on a second run:

/tmp: rm i1 i2
/tmp: make -j4
touch i1
touch i2
cat i1 i2 > a
cat i1 i2 > b
cat i1 i2 > c
/tmp: make -j4
cat a b c > e
@osresearch
Copy link
Collaborator Author

Reworking the parallel dependencies and allowing separate foo_dir and foo_base_dir variables for things that do per-board builds (like Linux and coreboot).
a772b27

@osresearch
Copy link
Collaborator Author

PR #395 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant