1
votes

After executing command "make" in ubuntu 15.04 I found files .*.o.d with content like this:

objdir.o: objdir.cpp /usr/lib/gcc/i486-linux-gnu/4.4.3/include/stdarg.h \
 /usr/include/assert.h /usr/include/features.h \
 /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \
 /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
 /usr/include/gnu/stubs-32.h ../include/ntstatus.h ../include/windef.h \
 ../include/winnt.h ../include/basetsd.h /usr/include/ctype.h \
 /usr/include/bits/types.h /usr/include/bits/typesizes.h \
 /usr/include/endian.h /usr/include/bits/endian.h \
 /usr/include/bits/byteswap.h /usr/include/xlocale.h \
 /usr/lib/gcc/i486-linux-gnu/4.4.3/include/stddef.h /usr/include/string.h \
 /usr/include/bits/string3.h ../include/pshpack2.h ../include/poppack.h \
 ../include/pshpack4.h ../include/guiddef.h ../include/pshpack8.h \
 ../include/winternl.h debug.h object.h list.h unicode.h objdir.h \
 object.inl ntcall.h thread.h timer.h fiber.h token.h mem.h \
 /usr/include/unistd.h /usr/include/bits/posix_opt.h \
 /usr/include/bits/environments.h /usr/include/bits/confname.h \
 /usr/include/getopt.h /usr/include/bits/unistd.h process.h symlink.h

but in those files I got wrong paths - for example instead of /usr/lib/gcc/i486-linux-gnu/4.4.3 there must be /usr/lib/gcc/i686-linux-gnu/4.9 So how those files generating and how I can change paths in those files?

1

1 Answers

1
votes

You can generate dependency files (.d) using gcc -MM in gnu environment. From this page:

The solution is fairly simple: every time we build a .o file, we also create a file with extension .d (for dependency) that records which files were used to create the corresponding .o file. (Note that we do not create the .d files ahead of time, in contrast to some approaches.) The .d files will be written in the make language itself, and included into the primary Makefile. We can generate the files using the -MM option of gcc