I'm writing a makefile for working with a microcontroller.
Among various PHONY targets, are:
- build - builds the project
- flash - flashes the MCU
- serial - opens Minicom serial interface
None of these strictly depends on the other - e.g. I can open serial without rebuilding or reflashing.
BUT, if the other targets are also specified (e.g. make flash serial), then a certain ordering needs to be respected (build before flashing, flash before opening serial).
Make is running with concurrency enabled (-j) and I don't want to change this.
How do I define optional-dependencies, to ensure ordering of targets, without requiring those dependencies to be checked/updated each time unless requested?