Best practices for multi-architecture builds?

Posts that don't fit in the other forums
Post Reply
Posts: 1
Joined: Mon May 12, 2014 1:23 am

Best practices for multi-architecture builds?

Post by Cydrak » Wed Aug 26, 2015 5:46 pm

Bear with me, this sounds worse than it really is. d:

I've got a project which contains targets for ARM, PowerPC, and x86. Currently, the ARM build is being linked into the PPC executable... but for testing purposes, I have support for reloading it over the network. So in addition to those, there's a host-side client which isn't cross-compiled at all.

Simply put, the situation resembles NDS, where you have the split ARM9/ARM7 binaries, except here we have a dependency: one needs to recompile when the other changes. In addition, I want to support two PPC targets (Wii and Gamecube) without forking the entire codebase, since any differences should be minimal there.

In other words:
- client.exe -> client.cpp
- arm.blob -> arm.elf -> arm.cpp
- wii.dol -> wii.elf -> server.cpp, arm.blob
- gc.dol -> gc.elf -> server.cpp, arm.blob

(It would be nicer if it were possible to have a "universal" DOL, but I would be very surprised if the crt0 and libraries supported such a thing...)

Needless to say, fun questions arise on what to do with the Makefiles. Getting everything to work isn't my problem: making it less ugly is. :-)

On one hand—and this is the way I'm leaning—I can move to recursive make. To me this feels like a giant hack: the top-level PPC build can't know dependencies for the ARM code, so it has to recurse every time you build. Nested folder structures are not only annoying to navigate; they feel overkill for small projects, making everything look messier and more complicated. But, on the other, you don't have multiple sets of rules and configurations in the same build, a situation make isn't really aware of at all ("willfully ignorant" might even be the better term, heheh).

I'd much prefer to stick with a single Makefile. The downside being those tend to invite the sort of magic that verges dangerously close to ad-hoc Cthulhuian build systems / Turing tarpits... and having toyed with them before, I'm groaning at the thought already. Still, the whole deal is simple enough to get by with a handful of target-specific variables, if managed carefully. And, I don't expect it to get much fancier. (Famous last words, right? :-))

The third option would be another build system like CMake, but I'm quite unfamiliar with those. From what little I've seen, I feel like I'd only be adding complexity for no good reason.

Curious to hear people's thoughts on this. Are there better options? What's the best way to handle the Gamecube/Wii platform variants?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests