Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is what I do too, and it seems perfect to me for adding set-and-forget dependency awareness to an ordinary Makefile. The first build with a new .c file will work. Its .d file won't exist, but the -include directive silently ignores this because of the - prefix, and it will be built anyway, because its corresponding .o doesn't exist either. Subsequent builds will use the dependency information in the .d.

Also consider adding -MP to CFLAGS to prevent errors if you delete a .h file.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: