-
Notifications
You must be signed in to change notification settings - Fork 11
Avoid creating intermediate .mk files #28
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work for nested dependencies, nor RGBDS if there are two generated files necessary in a row. RGBASM needs to be run in a loop until the object file exists.
How does the previous design avoid the need to run Would resolving gbdev/rgbds#903 (comment) be sufficient? As for nested dependencies, I don't see how the current design handles them either. Every .asm file gets a .o+.mk file, and only .inc files are supposed to be |
That behaviour is built into Make.
No. You need to re-build the build graph after discovering new dependencies.
It wouldn't; instead, it would re-run |
Thanks for running the CI. It does at least now build on Windows, and on macOS without having to |
CI passes with this change because the default project only has a single generated dependency at all; if a more complex project (I could think of Shock Lobster, Esprit, and Rhythm Land) can build successfully with this change, then it would be appropriate to merge. |
I don't see a way to avoid the need for running |
My goal here is to make issue #1 a moot point, since no file timestamps will be involved.
Instead of storing the
rgbasm -M
output in a .mk file for each .o and theninclude
ing all those .mk files in the Makefile, this just directly dumps thergbasm -M
output into the Makefile.This is similar to how pokecrystal's Makefile works, using
scan_includes
instead ofrgbasm -M
.It has to work around the fact that
$(shell)
unavoidably turns newlines into spaces, bytr
ing them into pipe characters and thensubst
ituting to undo the transformation. (The pipe|
is highly unlikely to be in any Linux filenames, and is outright forbidden on Windows.)I did have an issue with building this from scratch on macOS, where
make
would fail (Error opening INCBIN file 'assets/crash_font.1bpp.pb8': No such file or directory
) but running it again would succeed. This was becausergbasm -M
was not outputting theassets/crash_font.1bpp.pb8
target unlessassets/crash_font.1bpp.pb8.size
existed. I think that's a bug with RGBDS; see gbdev/rgbds#903 (comment). Anyway, having .pb8.size depend on .pb8 directly fixes it too.