We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 763 - automatic dependencies do not work correctly
Summary: automatic dependencies do not work correctly
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.0
Hardware: PowerPC Mac OS X 10.5 (Intel)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-05 16:15 UTC by Pierre Phaneuf
Modified: 2009-10-10 12:31 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Phaneuf 2009-07-05 16:15:40 UTC
After building SDL, I changed something in src/video/SDL_sysvideo.h, then ran "make" again. Nothing happened. Looking at the content of the build-deps file, there was no trace of SDL_sysvideo.h.

Apparently, we could delete that file, nothing depends on it! ;-)

I'm working around it by having a monstrous machine, using ccache, and using "make -j3", but this is pretty silly, even bloody awful automake gets automatic dependencies right...

Which also brings to light another dependencies issue: whatever is including the SDL_revision.h file is not depending on it in the makefile, so that "make -j3" when SDL_revision.h has not been created yet races, and fails, due to files using that file when it doesn't yet exists.
Comment 1 Sam Lantinga 2009-09-26 03:15:00 UTC
The SDL_revision.h dependency was fixed today.  I haven't looked into the other issue yet.  Have you found a bug in the dependency checking script?
Comment 2 Pierre Phaneuf 2009-09-26 11:15:48 UTC
It would appear so, the generated dependencies were incorrect when I looked at them. I didn't investigate further.

I'd also add that I used to have a single file with all the dependencies in old build systems that I hand-wrote (like yours), but find that this ends up being fairly costly for no good reason, analyzing all the source files when just one of them changed. The best I've got at the moment is a subdirectory containing a tree of files with a .d extension, something like "%: .deps/%.d", so that you get a .deps/foobar.c.d (the double extension is to support foobar.c and foobar.cc in the same directory, just in case) for a foobar.c. That file also includes a dependency from .deps/foobar.c.d to foobar.c, so that any time foobar.c or any of the headers it depends on change, the makefile will regenerate the dependencies.
Comment 3 Sam Lantinga 2009-09-26 15:08:52 UTC
I tried using something like gccmakedep, which is really fast, but I haven't been able to coax it to generate rules for building from a source tree and generating objects in a build tree.

There must be a way to do it, but I haven't found it yet.
Comment 4 Sam Lantinga 2009-10-10 12:31:33 UTC
This is fixed now, whee! :)