lkml.org 
[lkml]   [2000]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectmkdep.c question (2.3.49)
   I'm wondering about this function in mkdep.c:

/*
* Handle an #include line.
*/
void handle_include(int type, const char * name, int len)
{
struct path_struct *path = path_array+type;

if (len == 14 && !memcmp(name, "linux/config.h", len))
return;

if (len >= 7 && !memcmp(name, "config/", 7))
define_config(name+7, len-7-2);

memcpy(path->buffer+path->len, name, len);
path->buffer[path->len+len] = '\0';
if (access(path->buffer, F_OK) != 0)
return;

if (!hasdep) {
hasdep = 1;
printf("%s:", depname);
}
printf(" \\\n %s", path->buffer);
}


in particular this part:

if (access(path->buffer, F_OK) != 0)
return;


It looks obviously wrong to me, and it breaks in a situation like
this:

#include "firmware.h"

where the firmware.h file is generated from another file (say firmware.s)
by a Makefile rule. Is there any good reason for the access() check in the
#include "foobar.h" case and not just for the #include <foobar.h> case?

I see two options:

1) Adding such dependencies to the Makefile manually. This is how it is
done for some SCSI drivers. But doesn't it defeat the purpose of mkdep to
some extent?

2) Modifying mkdep to handle the case:

--- linux/scripts/mkdep.c-bak Fri Jan 14 03:03:58 2000
+++ linux/scripts/mkdep.c Sat Mar 4 12:23:18 2000
@@ -190,7 +190,7 @@

memcpy(path->buffer+path->len, name, len);
path->buffer[path->len+len] = '\0';
- if (access(path->buffer, F_OK) != 0)
+ if (type == 0 && access(path->buffer, F_OK) != 0)
return;

if (!hasdep) {

Regards,

/¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯T¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\
| Rask Ingemann Lambertsen | E-mail: mailto:rask@kampsax.k-net.dk |
| Registered Phase5 developer | WWW: http://www.gbar.dtu.dk/~c948374/ |
| A4000, 896 kkeys/s (RC5-64) | "ThrustMe" on XPilot, ARCnet and IRC |
| Eight out of every five people are math illiterates. |


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.045 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site