chore(mk): move accessible targets to the "make main file" i.e. Makefile #3017
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes our approach to Makefile targets to make them more customisable upstream
The biggest problem here is that Make make its troublesome to simply override make targets.
Previously we would 'override' targets by not including the file that had the target we had to override, and then including a different file with our customisations in it for the relevant target. The thing is you would also need to override (or just copy) all targets in a file, rather than just the one you wanted to override.
This approach names all consumable make targets prefixed with a
.
i.e..install
vsinstall
. We than add references to all these in our baseMakefile
(essentiallymake
smain
file). TheMakefile
is specific to each project so we can add what we want in there and it doesn't affect anything downstream. This also includes adding different documentation if need be.For example, say in one make file we have:
And we need to add some sort of auth to that we can use
Both of the above examples will run our installation scripts without them being duplicated, but one is decorated with some sort of authentication before doing so.
Moving forwards we should add all "common" user scripts in this file using the same approach. We should avoid mixing the documented aliases in with the rest of the
./mk
files, and avoid mixing long form scripts into theMakefile
itself. I've added a small comment at the top of theMakefile
to this effect.Lastly, I've only moved previously documented targets into this form as these are the commonly used ones. We can move others later on if necessary/desirable.