-
- Downloads
Makefiles: Remove duplicate object files when linking.
Scenario: module1 depends on some common file from lib/, so specifies it in its SRC_MOD, and the same situation with module2, then common file from lib/ eventually ends up listed twice in $(OBJ), which leads to link errors. Make is equipped to deal with such situation easily, quoting the manual: "The value of $^ omits duplicate prerequisites, while $+ retains them and preserves their order." So, just use $^ consistently in all link targets.
Showing
- bare-arm/Makefile 1 addition, 1 deletionbare-arm/Makefile
- esp8266/Makefile 1 addition, 1 deletionesp8266/Makefile
- minimal/Makefile 1 addition, 1 deletionminimal/Makefile
- pic16bit/Makefile 1 addition, 1 deletionpic16bit/Makefile
- py/mkrules.mk 2 additions, 2 deletionspy/mkrules.mk
- qemu-arm/Makefile 2 additions, 2 deletionsqemu-arm/Makefile
- stmhal/Makefile 1 addition, 1 deletionstmhal/Makefile
- teensy/Makefile 1 addition, 1 deletionteensy/Makefile
Loading
Please register or sign in to comment