Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Makefile timestamp check to make file rebuild

Reply
Thread Tools

Makefile timestamp check to make file rebuild

 
 
Jeff
Guest
Posts: n/a
 
      03-06-2008
Ive searched google for this answer as well as the gnu makefile
documentation page and I cant seem to find what Im looking for.

Im using gmake on solaris to build a project. I know that this would
work for a single file:

file.o: file.cpp
CC -c file.cpp -o file.o

But what I want to do is more general, since I have a list of OBJECTS
I want OBJECTS to somehow check all their associated .cpp files
and rebuild if one of them has been changed without having to
list each file seperately as above.

something like:

$(OBJECTS): ($SOURCES)
CC -c $*.cpp -o $@

How do I make this work?
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      03-06-2008
In article <(E-Mail Removed)>,
Jeff <(E-Mail Removed)> wrote:
>Ive searched google for this answer as well as the gnu makefile
>documentation page and I cant seem to find what Im looking for.


>Im using gmake on solaris to build a project.


The details of gmake are not relevant to the C language. Please
ask in a newsgroup that deals with your development environment.


>But what I want to do is more general, since I have a list of OBJECTS
>I want OBJECTS to somehow check all their associated .cpp files
>and rebuild if one of them has been changed without having to
>list each file seperately as above.


>something like:


>$(OBJECTS): ($SOURCES)
> CC -c $*.cpp -o $@


>How do I make this work?


[OT]
Read the gmake documentation about "Inference rules".

--
"To all, to each! a fair good-night,
And pleasing dreams, and slumbers light" -- Sir Walter Scott
 
Reply With Quote
 
 
 
 
Robbie Hatley
Guest
Posts: n/a
 
      03-07-2008

"Jeff" <(E-Mail Removed)> wrote:

> (a question about gnu make)


This is off-topic in this group as it has nothing to do with C.

For help with gnu utils (such as make), ask in the following
newsgroup:

gnu.utils.help

--
Cheers,
Robbie Hatley
lonewolf aatt well dott com
www dott well dott com slant user slant lonewolf slant


 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      03-07-2008
"Robbie Hatley" <(E-Mail Removed)> writes:

> "Jeff" <(E-Mail Removed)> wrote:
>
>> (a question about gnu make)

>
> This is off-topic in this group as it has nothing to do with C.
>
> For help with gnu utils (such as make), ask in the following
> newsgroup:
>
> gnu.utils.help


Aha. I thought so.

One can always tell.
 
Reply With Quote
 
Kenny McCormack
Guest
Posts: n/a
 
      03-07-2008
In article <fqpbc4$7mv$(E-Mail Removed)>,
Walter Roberson <(E-Mail Removed)-cnrc.gc.ca> wrote:
>In article <(E-Mail Removed)>,
>Jeff <(E-Mail Removed)> wrote:
>>Ive searched google for this answer as well as the gnu makefile
>>documentation page and I cant seem to find what Im looking for.

>
>>Im using gmake on solaris to build a project.

>
>The details of gmake are not relevant to the C language. Please
>ask in a newsgroup that deals with your development environment.


IOW, nobody here gives a **** about you or your problems.

You may find some or all of the following links helpful in understanding
why this is so:

http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language

 
Reply With Quote
 
Micah Cowan
Guest
Posts: n/a
 
      03-07-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) (Kenny McCormack) writes:

> In article <fqpbc4$7mv$(E-Mail Removed)>,
> Walter Roberson <(E-Mail Removed)-cnrc.gc.ca> wrote:
>>In article <(E-Mail Removed)>,
>>Jeff <(E-Mail Removed)> wrote:
>>The details of gmake are not relevant to the C language. Please
>>ask in a newsgroup that deals with your development environment.

>
> IOW, nobody here gives a **** about you or your problems.


Said in response to a message which, unlike yours, actually gave the
poster advice on where to find the answer.

--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
 
Reply With Quote
 
Kenny McCormack
Guest
Posts: n/a
 
      03-07-2008
In article <(E-Mail Removed)>,
Micah Cowan <(E-Mail Removed)> wrote:
>(E-Mail Removed) (Kenny McCormack) writes:
>
>> In article <fqpbc4$7mv$(E-Mail Removed)>,
>> Walter Roberson <(E-Mail Removed)-cnrc.gc.ca> wrote:
>>>In article

><(E-Mail Removed)>,
>>>Jeff <(E-Mail Removed)> wrote:
>>>The details of gmake are not relevant to the C language. Please
>>>ask in a newsgroup that deals with your development environment.

>>
>> IOW, nobody here gives a **** about you or your problems.

>
>Said in response to a message which, unlike yours, actually gave the
>poster advice on where to find the answer.


It did? Show me where.

(Unless you've clipped something relevant, the above looks like "Not
here - try someplace else")

 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      03-07-2008
Kenny McCormack wrote:

> In article <(E-Mail Removed)>,
> Micah Cowan <(E-Mail Removed)> wrote:
>>(E-Mail Removed) (Kenny McCormack) writes:
>>
>>> In article <fqpbc4$7mv$(E-Mail Removed)>,
>>> Walter Roberson <(E-Mail Removed)-cnrc.gc.ca> wrote:
>>>>In article

>><(E-Mail Removed)>,
>>>>Jeff <(E-Mail Removed)> wrote:
>>>>The details of gmake are not relevant to the C language. Please
>>>>ask in a newsgroup that deals with your development environment.
>>>
>>> IOW, nobody here gives a **** about you or your problems.

>>
>>Said in response to a message which, unlike yours, actually gave the
>>poster advice on where to find the answer.

>
> It did? Show me where.
>
> (Unless you've clipped something relevant, the above looks like "Not
> here - try someplace else")


*You* clipped the following from Walter's reply to the OP:

>>>>


>But what I want to do is more general, since I have a list of OBJECTS
>I want OBJECTS to somehow check all their associated .cpp files
>and rebuild if one of them has been changed without having to
>list each file seperately as above.


>something like:


>$(OBJECTS): ($SOURCES)
> * *CC -c $*.cpp -o $@


>How do I make this work?


[OT]
Read the gmake documentation about "Inference rules".

<<<<

So not only did Walter give a suggestion as to which group to post to,
he also gave a hint as to where to look in gmake's documentation.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make a Makefile Paminu C Programming 6 02-11-2006 10:38 PM
how to make linux makefile work in visual c++? chenqy2004@gmail.com C Programming 4 06-03-2005 01:44 AM
Oops.. how can I rebuild a RESX file? =?Utf-8?B?ZGhucml2ZXJzaWRl?= ASP .Net 6 02-02-2005 03:41 PM
Changing web.config: Rebuild project or copy file? Chris ASP .Net 3 02-04-2004 04:17 PM
JavaMail: Dump a Message object to file, rebuild later - Possible or not? Abraham Khalil Java 0 09-29-2003 02:31 PM



Advertisments