Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
692 views
in Technique[技术] by (71.8m points)

makefile - How to determine quickly which one file is compiled in so many same-name source files?

Thanks in advance.

For some reasons I need to read the glibc code, but I can't determine quickly which one file is compiled in so many same-name source files. In my limited experience with glibc, I can't slove this problem. please help me.

For example, there are many sigaction.c in glibc.

nptl/sigaction.c
sysdeps/unix/sysv/linux/arm/sigaction.c
sysdeps/unix/sysv/linux/x86_64/sigaction.c
sysdeps/unix/sysv/linux/sigaction.c
sysdeps/unix/sysv/linux/arc/sigaction.c
sysdeps/unix/sysv/linux/i386/sigaction.c
sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
sysdeps/unix/sysv/linux/aarch64/sigaction.c
sysdeps/mach/hurd/sigaction.c
signal/sigaction.c

I can subjectively exclude some files that are not related to my platform (x86), but there are still 4 files left.

nptl/sigaction.c
sysdeps/unix/sysv/linux/x86_64/sigaction.c
sysdeps/mach/hurd/sigaction.c
signal/sigaction.c

Usually I compile glibc with adding printf in every source file to distinguish them. Wanted to know if it's good practice to do that and what would be the best way to do that?

I tried to read the Makefile, but the Makefile of glibc was too complicated for me, and it will take me a long time to fully understand it.

If there is no other method, I can only study the glibc compilation framework (is there any documentation about the glibc compilation framework?).

question from:https://stackoverflow.com/questions/65931846/how-to-determine-quickly-which-one-file-is-compiled-in-so-many-same-name-source

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...