My previous idea was to generate a list of all the headers, and add it as a dependency for all object files. This way, any changes in a header would trigger a rebuild of all object files, which would in-turn trigger a build of the binary. This will be a bit of an issue later on when we have stuff that's independent of others; a change in parser code won't necessarily affect code generation, but a change in AST will. We don't want to re-trigger builds for everything. This setup forces gcc to generate a clear set of dependencies in the build folder (in a syntax recognisable by Make), then include that in the Makefile itself. These dependencies are specific to each code unit and so only concern the headers that code unit uses.
916 B
916 B