lkml.org 
[lkml]   [1998]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPatch: 2.1.92pre2: relative-depends (fwd)
If someone does a 'make dep', then move the directory the kernel source
resides in, a following kernel compile will fail. The problem is that 'make
dep' store the absolute filename into the .depend files. This patch fixes
this.

Adam
diff -ruN linux/Makefile 2.1.92/Makefile
--- linux/Makefile Mon Mar 30 15:29:45 1998
+++ 2.1.92/Makefile Sun Mar 29 00:05:21 1998
@@ -20,7 +20,9 @@
else echo sh; fi ; fi)
TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)

-HPATH = $(TOPDIR)/include
+HIGHESTDIR := .
+HPATH = $(HIGHESTDIR)/include
+TOPHPATH = $(TOPDIR)/include
FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net

HOSTCC =gcc
@@ -30,7 +32,7 @@

AS =$(CROSS_COMPILE)as
LD =$(CROSS_COMPILE)ld
-CC =$(CROSS_COMPILE)gcc -D__KERNEL__ -I$(HPATH)
+CC =$(CROSS_COMPILE)gcc -D__KERNEL__ -I$(TOPHPATH)
CPP =$(CC) -E
AR =$(CROSS_COMPILE)ar
NM =$(CROSS_COMPILE)nm
@@ -424,7 +426,7 @@

endif

-include Rules.make
+include $(TOPDIR)/Rules.make

#
# This generates dependencies for the .h files.
diff -ruN linux/Rules.make 2.1.92/Rules.make
--- linux/Rules.make Wed Jan 21 17:32:14 1998
+++ 2.1.92/Rules.make Sat Mar 28 23:56:05 1998
@@ -2,6 +2,18 @@
# This file contains rules which are shared between multiple Makefiles.
#

+HIGHESTDIR := $(shell \
+ DIR=`pwd -P `;\
+ NEWCURDIR=.;\
+ while [ "$$DIR" != "$(TOPDIR)" ];do\
+ DIR=`dirname $$DIR`;\
+ NEWCURDIR=$$NEWCURDIR/..;\
+ done;\
+ echo $$NEWCURDIR;\
+ )
+HPATH = $(HIGHESTDIR)/include
+FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net
+
#
# False targets.
#
@@ -103,7 +115,7 @@
# This make dependencies quickly
#
fastdep: dummy
- $(TOPDIR)/scripts/mkdep $(wildcard *.[chS] local.h.master) > .depend
+ $(HIGHESTDIR)/scripts/mkdep $(wildcard *.[chS] local.h.master) > .depend
ifdef ALL_SUB_DIRS
set -e; for i in $(ALL_SUB_DIRS); do $(MAKE) -C $$i fastdep; done
endif
\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.030 / U:1.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site