Skip to contentSkip to conversation

2.4.1ac12 mkdep -I support - take 2

PATCH New Keith Owens 1 participant 1 message Feb 14, 2001 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4.1ac12 mkdep -I support - take 2

Get rid of the special case in drivers/acpi/Makefile. mkdep now uses the same -I options in the same order as the compiler. Against 2.4.1ac12.

Change from take 1 - make is too dumb to realise that /path/name/file.h is the same as file.h when current directory is /path/name, so do not use the full pathname to files in the current directory.

scripts/mkdep.c renamed from scripts/mkdep.c.orig +5 -10
@@ -221,15 +221,10 @@
 	char resolved_path[PATH_MAX+1];
 	const char *name2;
 
-	if (strcmp(name, ".")) {
-		name2 = realpath(name, resolved_path);
-		if (!name2) {
-			fprintf(stderr, "realpath(%s) failed, %m\n", name);
-			exit(1);
-		}
-	}
-	else {
-		name2 = "";
+	name2 = realpath(name, resolved_path);
+	if (!name2) {
+		fprintf(stderr, "realpath(%s) failed, %m\n", name);
+		exit(1);
 	}
 
 	path_array = realloc(path_array, (++paths)*sizeof(*path_array));
@@ -246,7 +241,7 @@
 		exit(1);
 	}
 	strcpy(path->buffer, name2);
-	if (path->len && *(path->buffer+path->len-1) != '/') {
+	if (*(path->buffer+path->len-1) != '/') {
 		*(path->buffer+path->len) = '/';
 		*(path->buffer+(++(path->len))) = '\0';
 	}