Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #106553
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Linker question |
| Date | 2017-03-20 13:05 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <8737e8qerw.fsf@bsb.me.uk> (permalink) |
| References | <a514effa-76a6-4930-9278-f9345d3da8b0@googlegroups.com> <87bmsxs9r0.fsf@bsb.me.uk> <59c9c47f-4129-4470-aa2e-d2ff87474654@googlegroups.com> |
silusilusilu@gmail.com writes: <snip> >> ... I think the suggestion to use make has missed your >> point. Make will have to be told that file2.o depends on file3.h >> because its information is based solely on what files include which >> others. I don't know of an automatic way to avoid compiling file2.c >> simply because it does not use any of the specific changes to one of the >> included files. (Of course, *I* may have missed your point but this is >> what I think you want.) > > you haven't missed the point: i have the problem you have underlined > >> Naturally, you can split file3.h into different parts and only include >> into file2.c exactly those parts that it definitively needs, but >> complicating the structure to avoid a few redundant re-compilations is >> probably a bad idea. Does it really matter that much? > > It is a requirement Then your simplest solution is might be to break the include files up, but I am puzzled by why this is a requirement. If you say a bit more about why this is important, you might get some better suggestions. Elsewhere, you comment that one of the source files might not exist. That suggests that your situation is not the normal one envisioned by build systems. You can't always get finer compile granularity just by splitting the include files up because, sometimes, it comes down to what #defines are in play. It's possible that some quite complex use of scons could accommodate this situation but I am not really familiar with it. -- Ben.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Linker question silusilusilu@gmail.com - 2017-03-19 04:42 -0700
Re: Linker question Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-03-19 05:10 -0700
Re: Linker question Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-19 12:59 +0000
Re: Linker question silusilusilu@gmail.com - 2017-03-20 04:06 -0700
Re: Linker question Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-20 13:05 +0000
Re: Linker question silusilusilu@gmail.com - 2017-03-20 06:24 -0700
Re: Linker question Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-20 13:51 +0000
Re: Linker question Manfred <noname@invalid.add> - 2017-03-20 16:03 +0100
Re: Linker question Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-20 17:09 +0000
Re: Linker question gof@somewhere.invalid (Adam Wysocki) - 2017-03-20 09:59 +0000
Re: Linker question silusilusilu@gmail.com - 2017-03-20 04:13 -0700
Re: Linker question gof@somewhere.invalid (Adam Wysocki) - 2017-03-21 09:44 +0000
csiph-web