gcc -MMD allows to find dependencies for Makefile.in
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 13.6k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Modifying Makefile.in I found it hard to account nested dependencies when .h file includes more .h files.
@rofl0r pointed out to me that it is possible to ask gcc to list dependencies of .c file onto .h files.
For example, my list of dependencies included all .h files included in .c file:
showformats.o: showformats.c showformats.h loader.h options.h config.h dynamic.h
$ gcc -E -MMD showformats.c > /dev/null
$ cat showformats.d
showformats.o: showformats.c loader.h params.h arch.h list.h formats.h \
misc.h jumbo.h omp_autotune.h options.h getopt.h common.h memory.h \
john_mpi.h config.h dynamic.h simd-intrinsics.h pseudo_intrinsics.h \
aligned.h simd-intrinsics-load-flags.h
So dependencies in Makefile.in might be improved.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Makefile.in and the dependency rule for showformats.c, then reproduce the gcc -E -MMD example from the issue. Check how the generated .d file is incorporated and ensure nested header dependencies are included in the Makefile dependencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100