Firmware makefile cleanups#440
Conversation
Remove unused/empty variables. Replace AVRDIR with CROSS_COMPILE. Add line breaks for readability. Don't hide the compiler command line. Use pattern rules and pattern substitution to avoid duplication. Mark all phony targets as phony. Apply -DSINGLE_ENPOINT_INTERFACE to a non-phony target. Include the generated .d files for better dependency tracking. (Note that `make clean` is still required when switching variants.)
|
@brentfpage I was working on this today kind of unaware of your most recent changes in #405. This will conflict. Happy to resolve it however you think is best. |
|
I'm just going to limit #405 to the firmware workflow, which can work essentially directly with this Makefile. I agree that 0x01 and 0x02 should be changed to 01 and 02 in the file names. For consistency, I think the same change should be made for the target names. It is also useful to have a "clean" target that only deletes .o and .d files. Such a target allows a single run of the firmware workflow to build both the 01 and 02 variants and then upload them in a single asset-hex.zip. Could you please add one? One last thing that could be done either here or in #405 is to delete FIRMWARE_VERSION_ID from src/globals.h and add I checked to make sure that the firmware produced by this Makefile matches that produced currently by #405 and found exact agreement apart from whitespace changes. |
Listing files by name as targets prevents make from deleting them as intermediate. Fixes the problem where running `make` a second time will rebuild everything it just deleted, since it now finds a mention of the file in a .d file. Add a dependency on Makefile, so that objects get rebuilt if anything in the Makefile changes. There is no rule to rebuild .d files, so we don't need the conditional part to avoid including them (and potentially rebuilding them) if we're just going to delete them. Those plus the .map and .lss files are unmanaged side-effects.
|
I agree with all those changes. Syntax is now I copied automake's idea of naming the target |
This is some miscellaneous cleanups to the firmware makefile. Main goals are to:
labrafirm_$(VERSION)_$(VARIANT).hexconvention that we've been using.