Michael R

Sample Makefile has non-working dependency generation

Discussion created by Michael R on May 4, 2018
Latest reply on May 4, 2018 by Doug Kehn

The Makefile suggests that auto-generated dependencies are used. However, there are at least two bugs in this:

1. the compiler flags to generate the dependencies are wrong: it should be

CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@"

 

2. the generated files are not actually included, it should be

-include $(shell mkdir build 2>/dev/null) $(wildcard build/*.d)

Outcomes