help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: does make behave serially when serially invoked


From: Todd Showalter
Subject: Re: does make behave serially when serially invoked
Date: Fri, 19 Feb 2010 19:50:29 -0500

On Fri, Feb 19, 2010 at 6:58 PM, Mark Galeck (CW) <address@hidden> wrote:

> Well, what I meant was that this makefile works as intended - the intended 
> result being, that all the .o files are listed in the file srcs.
>
>> OBJECTS = <listed here are thousands of .o file names>
>>
>> all: $(OBJECTS)
>>
>> %.o: %.c
>>                 echo $< >> srcs
>
> The reason that I was not sure, even though I read the same thing you read in 
> the manual, is that I do see sometimes a few file names missing.  This is of 
> course on Windows, but I am not sure if that is related - if you, as you say 
> make does, finish one append to srcs before you attempt another, you should 
> be fine here, I don't expect Windows would have a bug where you could not 
> serially do many >> srcs commands.

    If any of the .o files are up to date (ie: if they are younger
than their corresponding .c file) the rule won't be invoked, and
therefore you won't have the object appear in the file.  If you have
something like:

%.o: %.c
    echo $< >> srcs
    $(CC) $< -o $@

    Then srcs will be a list of the sources that got built.  Assuming,
of course, that you remember to erase "srcs" after every build;
otherwise, it's just going to be a continuous log of every file built
in every invocation of make since srcs was created.

                                                      Todd.

-- 
 Todd Showalter, President,
 Electron Jump Games, Inc.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]