Re: Make: Unexpected Behavior with Dependencies and include Statement

2015-09-23 Thread Edward Welbourne
> I was thinking to build the objects but not the dependencies. We do a lot > of one-time only builds, where we don't need dependencies at all. In that case, leave out the include of any .d whose .o doesn't exist; you fatuously know you need to build the .o, so you don't need to know its dependenc

Re: Make: Unexpected Behavior with Dependencies and include Statement

2015-09-23 Thread Paul Smith
On Wed, 2015-09-23 at 15:00 -0500, John Westing wrote: > > You are doing exactly Basic Auto-dependencies. But that works because > > of the re-exec if include files are rebuilt > > I don't think that's true, as the author explains in regards to the > basic method: > > "Let’s address the first pr

Re: Make: Unexpected Behavior with Dependencies and include Statement

2015-09-23 Thread John Westing
>> 1. For the code that I'm supporting includes are rarely changed. > All the more reason to ensure dependencies are updated automatically, as > people will forget to do it otherwise. Point taken. > You are doing exactly Basic Auto-dependencies. But that works because > of the re-exec if includ

Re: Make: Unexpected Behavior with Dependencies and include Statement

2015-09-23 Thread Paul Smith
On Wed, 2015-09-23 at 12:48 -0500, John Westing wrote: > Here are a few points: > > 1. For the code that I'm supporting includes are rarely changed. All the more reason to ensure dependencies are updated automatically, as people will forget to do it otherwise. > 2. By default I will always rebui

Re: Make: Unexpected Behavior with Dependencies and include Statement

2015-09-23 Thread John Westing
Here are a few points: 1. For the code that I'm supporting includes are rarely changed. 2. By default I will always rebuild dependencies (the all rule I showed). For this case I thought about it for a few minutes I don't think dependencies will become out of date if auto-remaking doesn't occur (a

Re: Make: Unexpected Behavior with Dependencies and include Statement

2015-09-23 Thread Paul Smith
On Wed, 2015-09-23 at 12:15 -0500, John Westing wrote: > So when an include make file gets modified make restarts the original > make file? Correct. > For efficiency I don't want to always create the dependencies, that's > why I did it this way. I don't understand what you mean by this... for ef

Re: Make: Unexpected Behavior with Dependencies and include Statement

2015-09-23 Thread John Westing
So when an include make file gets modified make restarts the original make file? For efficiency I don't want to always create the dependencies, that's why I did it this way. Is there anyway to disable remaking? On Wed, Sep 23, 2015 at 12:13 PM, Paul Smith wrote: > On Wed, 2015-09-23 at 13:06 -0

Re: Make: Unexpected Behavior with Dependencies and include Statement

2015-09-23 Thread Paul Smith
On Wed, 2015-09-23 at 13:06 -0400, Mike Shal wrote: > Though normally you don't want to include .d files as targets in your > Makefile. Just generate them as a side-effect of compilation with -MMD > or whatever in gcc and then include them, and you can avoid the whole > issue. For an example and d

Re: Make: Unexpected Behavior with Dependencies and include Statement

2015-09-23 Thread Mike Shal
On Wed, Sep 23, 2015 at 12:57 PM, John Westing wrote: > I made a typo in my previous email: The following make file duplicates the > problem, the one in the previous email does not: > > a.d: > gcc -m32 -MM -o $@ a.c > sed 's!a.o!$@ a.o!' --in-place $@ > > a.o: > gc

Re: Make: Unexpected Behavior with Dependencies and include Statement

2015-09-23 Thread John Westing
Any ideas? On Wed, Sep 23, 2015 at 11:14 AM, John Westing wrote: > I originally posted this problem here: > > > http://stackoverflow.com/questions/32742321/make-unexpected-behavior-with-dependencies-and-include-statement > > Here's my problem: > > I have the following Ma

Make: Unexpected Behavior with Dependencies and include Statement

2015-09-23 Thread John Westing
I originally posted this problem here: http://stackoverflow.com/questions/32742321/make-unexpected-behavior-with-dependencies-and-include-statement Here's my problem: I have the following Makefile: a.d: gcc -m32 -MM -o $@ a.c sed 's!a.o!$@ a.o!' --in-pl