help-make
[Top][All Lists]
Advanced

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

How to modify algorithm that determines weather a target needs rebuild


From: mirage1987
Subject: How to modify algorithm that determines weather a target needs rebuild
Date: Sun, 8 Aug 2010 00:38:34 -0700 (PDT)

Hi Experts,
I am new to GNU make and doesn't have much experience with builds. 
I wanted to test a scenario where i need to modify the condition that
determines weather
a target needs to be build or not. 
Consider the following rule:
foo.o : foo.c 
         cc -c foo.c
Currently if i am not wrong make builds the target:
- if either the target doesn't exist
- or the time-stamp of the target is older than the last modified time of
the files
I need to modify to something like
Build happens if
- if either the foo.o doesn't exist; 
- timestamp of foo.o is equal to the timestamp of the foo.c
And after every successful build of the target i touch the target file to
point to timestamp of foo.c

I want to do this because the timestamp of my source file (foo.c) could
change both back and forth.
So i need to build the target only if the timestamp changes for source.

Is it possible to achieve this by just defining the makefile rules or would
i need to modify the
code of GNU make.

Thanks and Regards


-- 
View this message in context: 
http://old.nabble.com/How-to-modify-algorithm-that-determines-weather-a-target-needs-rebuild-tp29378571p29378571.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.




reply via email to

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