From ff08835fad5e66d11d698cc17fa7e012be7bf95d Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Tue, 7 Sep 2004 08:14:30 +0000 Subject: [PATCH] - Replaced the target extension with '.h.gch' if the source extension was '.h' svn path=/trunk/; revision=10795 --- reactos/tools/depends.c | 47 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/reactos/tools/depends.c b/reactos/tools/depends.c index ed73b03d58a..4d8cbaab869 100644 --- a/reactos/tools/depends.c +++ b/reactos/tools/depends.c @@ -5,9 +5,11 @@ int main(int argc, char* argv[]) { char buf[512]; + char buf2[512]; char ch; - unsigned int i; + unsigned int i, j; char* dot; + char* ext; char* prefix; FILE* out; @@ -50,14 +52,53 @@ int main(int argc, char* argv[]) { return(0); } + i = 0; + while ((ch = fgetc(stdin)) == ' ' && ch != EOF) + { + buf2[i] = ch; + i++; + } + if (i == 0) + { + return 0; + } + if (ch != EOF) + { + buf2[i] = ch; + i++; + } + j = i; + while ((ch = fgetc(stdin)) != ' ' && ch != EOF) + { + buf2[j] = ch; + j++; + } + buf2[j] = 0; + if (i == j) + { + return 0; + } + + ext = strrchr(buf2, '.'); + if (ext != NULL) + { + if (0 == strcmp(ext, ".h")) + { + ext = "h.gch"; + } + else + { + ext = NULL; + } + } dot = strrchr(buf, '.'); if (dot != NULL) { *dot = 0; } - fprintf(out, "%s/.%s.TAG %s/.%s.d %s/%s.o:", prefix, buf, prefix, buf, - prefix,buf); + fprintf(out, "%s/.%s.TAG %s/.%s.d %s/%s.%s:%s ", prefix, buf, prefix, buf, + prefix,buf,ext ? ext : "o" , buf2); while ((ch = fgetc(stdin)) != EOF) {