New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 738809 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Dec 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

ec: make: *** No rule to make target 'xxx.h', needed by 'yyy.o'. Stop.

Project Member Reported by drinkcat@chromium.org, Jul 3 2017

Issue description

Errors like this one:
make: *** No rule to make target 'driver/charger/bd99955.h', needed by 'build/gru/RO/board/gru/board.o'.  Stop.

Often seen when doing incremental EC builds (particularly in the private overlays, but not only).

For example:

rm -rf build/gru
git checkout 420b42309^
make BOARD=gru -j
git checkout m/master # e.g. 5e5788f3c
make BOARD=gru -j

...
  BUILDCC util/usb_pd_policy.o
  LDS     RO/ec.RO.lds
make: *** No rule to make target 'driver/charger/bd99955.h', needed by 'build/gru/RO/board/gru/board.o'.  Stop.
make: *** Waiting for unfinished jobs....
  VERSION ec_version.h

The workaround is obvious: remove build/gru (or the whole build/ folder) and start over, but it gets a bit painful when having to do that often on many boards, especially when the purpose is just to to make buildall -j to sanity-check a CL before submitting, after a rebase.
 
We might want to add '-MP' to the preprocessor flags for dependencies generation.
e.g works for me:

rm -rf build/gru
git checkout 420b42309^
sed -i -e "s@-MMD -MF@-MMD -MP -MF@g" Makefile.rules
make BOARD=gru -j
git stash
git checkout m/master # e.g. 5e5788f3c
sed -i -e "s@-MMD -MF@-MMD -MP -MF@g" Makefile.rules
make BOARD=gru -j

The downside is the whole system is slightly less robust against a few corner cases.
I think this page has some interesting overview:
http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/


By the way, we still have the issue that we don't have a dependency on our Makefiles,
so when they change, the incremental build might ignore it (and then fail badly).
the kernel-style $(call if_changed) in each rule is probably necessary to solve this one.


Cc: vbendeb@chromium.org caveh@chromium.org
Vadim added the flag in this CL: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/814876
Status: Fixed (was: Available)
I don't think not having dependencies on makefiles is such a big deal in case of EC codebase.

Sign in to add a comment