Hi, all:
I have a question about print the project compile date.
I have a project which contains 2 files: "a.c" and "b.c"*. *I want to print
project compile date in one of these 2 files. I put it in a.c:
>>>>>>>>>>>>>>>>>>>>>>>
// This is a.c
#include <stdio.h>
int main()
{
printf("%s\n", __DATE__);
return 0;
}
<<<<<<<<<<<<<<<<<<<<<<<
And b.c looks like this:
>>>>>>>>>>>>>>>>>>>>>>>
// This is b.c
#include <stdio.h>
int do_something(void)
{
//......;
}
<<<<<<<<<<<<<<<<<<<<<<<
If only "b.c" is modified, and no change in "a.c" at all, when I recompile
the project, the printed date doesn't reflect the latest changes in project
(in my case "b.c").
I am wondering how to print the project compile date/time to show the latest
modification in project files?
I am using powerpc-eabi-gcc, and my Makefile looks like this:
>>>>>>>>>>>>>>>>>>>>>>>
APP = showdate
SRCS = a.c b.c
OBJS = $(SRCS:.c=.o)
$(APP): $(OBJS)
$(CC) $^ -o $@
<<<<<<<<<<<<<<<<<<<<<<<
Is there a mechanism in GNU tools to pass the compile date/time info and no
need to change source file? Can I do it in Makefile? Or any other better
choices?
Thanks
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make