linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mkdep patch in 2.4.21-pre4-ac7 breaks pci/drivers
@ 2003-02-28 22:00 Pavel Roskin
  2003-03-02  2:13 ` Horst von Brand
  0 siblings, 1 reply; 6+ messages in thread
From: Pavel Roskin @ 2003-02-28 22:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alan Cox

Hello, Alan and all!

If I compile linux 2.4.21-pre4-ac7, then run "make depend" and "make
clean", then "make bzImage" fails in pci/drivers:

gcc -D__KERNEL__ -I/usr/local/src/linux/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer
-pipe -mpreferred-stack-boundary=2 -march=athlon   -nostdinc -iwithprefix
include -DKBUILD_BASENAME=compat  -c -o compat.o compat.c
make[3]: *** No rule to make target
`/usr/local/src/linux/drivers/pci/devlist.h', needed by `names.o'.  Stop.
make[3]: Leaving directory `/usr/local/src/linux/drivers/pci'
make[2]: *** [first_rule] Error 2
make[2]: Leaving directory `/usr/local/src/linux/drivers/pci'
make[1]: *** [_subdir_pci] Error 2
make[1]: Leaving directory `/usr/local/src/linux/drivers'
make: *** [_dir_drivers] Error 2

This is caused by the patch for scripts/mkdep.c (part of the
2.4.21-pre4-ac7 patch) which makes full names from the includes.  GNU
make 3.79.1 tries to compile names.o, notices that it depends on
/usr/local/src/linux/drivers/pci/devlist.h, but doesn't "realize" (I guess
it's an intentional limitation) that the devlist.h target would create
that file.

The old code would put "devlist.h" without path into the .depend file.
make can actually deal with it.  If there are any reasons to use the full
path (most likely the reason is to eliminate ".."), either "wildcard"
should be used on the local files, or the "cleanable" files should be
somehow marked as such.  Finally, the build system could require "make
depend" after "make clean", but that would be an annoyance.

Here's the patch that uses wildcards for the local includes.  By the way,
there is no need to suppress "/../" for local files - neither the filename
not the working directory can have it.  Sorry, I'm including both changes
together, but it's trivial to separate them.

=========================
--- linux.orig/drivers/pci/mkdep.c
+++ linux/drivers/pci/mkdep.c
@@ -205,11 +205,13 @@ void handle_include(int start, const cha
 		path->buffer[path->len+len] = '\0';
 		if (access(path->buffer, F_OK) == 0) {
 			int l = lcwd + strlen(path->buffer);
+			int need_wildcard = 0;
 			char name2[l+2], *p;
 			if (path->buffer[0] == '/') {
 				memcpy(name2, path->buffer, l+1);
 			}
 			else {
+				need_wildcard = 1;
 				memcpy(name2, cwd, lcwd);
 				name2[lcwd] = '/';
 				memcpy(name2+lcwd+1, path->buffer, path->len+len+1);
@@ -219,7 +221,11 @@ void handle_include(int start, const cha
 				strcpy(strrchr(name2, '/'), p+3);
 			}
 			do_depname();
-			printf(" \\\n   %s", name2);
+			if (need_wildcard) {
+				printf(" \\\n   $(wildcard %s)", name2);
+			} else {
+				printf(" \\\n   %s", name2);
+			}
 			return;
 		}
 	}
=========================

Just in case, I'm using Red Hat 8.0 (make 3.79.1, bash 2.05b, gcc 3.2) on
AMD Athlon.

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-03-04  1:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-28 22:00 mkdep patch in 2.4.21-pre4-ac7 breaks pci/drivers Pavel Roskin
2003-03-02  2:13 ` Horst von Brand
2003-03-03  8:32   ` Pavel Roskin
2003-03-04  1:27     ` Horst von Brand
2003-03-03  9:00   ` [PATCH] " Pavel Roskin
2003-03-03  9:58     ` Pavel Roskin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).