reactos/tools
diff -u -r1.5 -r1.6
--- depends.c 15 Aug 2004 01:23:19 -0000 1.5
+++ depends.c 7 Sep 2004 08:14:30 -0000 1.6
@@ -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 @@
{
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)
{