pret / pokeemerald

Decompilation of Pokémon Emerald
2.2k stars 2.38k forks source link

Makefile: deeper folder nesting support; fail build when SCANINC fails #1951

Open DavidJCobb opened 10 months ago

DavidJCobb commented 10 months ago

Code can now be placed in more deeply-nested directories.

The scaninc build step is modified so that if scaninc fails, the entire build fails on the spot with a detailed error message.

Description

The makefile is altered so that if scaninc fails, we re-run it on the file it failed on and then echo an error message. The error message explicitly states that scaninc is what failed, that it failed because it encountered a fatal error, and that one of the previously printed messages was scaninc's error message. The error message also identifies the file that scaninc was invoked on during the failed run.

Re-running scaninc after a failure and before we echo may not actually be necessary. It was at one point during my random tinkering, in order to get scaninc's own output to reliably display, but I'm not sure it is now, and I lack the expertise (and desire to engage) with makefiles needed to know for sure. Better too many messages than too few, I suppose.

Anyway, the scaninc-related makefile changes should resolve the following problems:

The way I tested these changes was by creating a file containing only a semicolon, with file extension inl, and then #includeing it from a source file. The include directive caused a scaninc failure and the build halted with the new error message as intended. Removing the directive allowed the build to proceed again.

Discord contact info

@davidjcobb