See patch. This fixes a very ugly issue in v2.

Stefan

-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: [email protected]http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866

With this patch the v2 build system will create a directory hierarchy
similar to what v3 does. This is required to have two source files with
the same name but in different directories. (As in, two different SuperIOs on
board, with a superio.c each)

Signed-off-by: Stefan Reinauer <[email protected]>

Index: src/cpu/x86/smm/Config.lb
===================================================================
--- src/cpu/x86/smm/Config.lb	(revision 3960)
+++ src/cpu/x86/smm/Config.lb	(working copy)
@@ -27,8 +27,8 @@
 	smmobject smihandler.o
 
 	makerule smm.o
-		depends	"$(SMM-OBJECTS) printk.o vtxprintf.o $(LIBGCC_FILE_NAME)" 
-		action	"$(CC) $(DISTRO_LFLAGS) -nostdlib -r -o $@ $(SMM-OBJECTS) printk.o vtxprintf.o $(LIBGCC_FILE_NAME)"
+		depends	"$(SMM-OBJECTS) $(TOP)/src/console/printk.o $(TOP)/src/console/vtxprintf.o $(LIBGCC_FILE_NAME)" 
+		action	"$(CC) $(DISTRO_LFLAGS) -nostdlib -r -o $@ $^"
 	end
 
 	makerule smm
Index: src/config/Config.lb
===================================================================
--- src/config/Config.lb	(revision 3960)
+++ src/config/Config.lb	(working copy)
@@ -45,8 +45,8 @@
 
 
 makerule coreboot_ram.o
-	depends	"$(DRIVER) coreboot.a $(LIBGCC_FILE_NAME)" 
-	action	"$(CC) $(DISTRO_LFLAGS) -nostdlib -r -o $@ c_start.o $(DRIVER) coreboot.a $(LIBGCC_FILE_NAME)"
+	depends	"$(TOP)/src/arch/$(ARCH)/lib/c_start.o $(DRIVER) coreboot.a $(LIBGCC_FILE_NAME)" 
+	action	"$(CC) $(DISTRO_LFLAGS) -nostdlib -r -o $@ $^"
 end
 
 makerule coreboot_ram
Index: util/newconfig/config.g
===================================================================
--- util/newconfig/config.g	(revision 3960)
+++ util/newconfig/config.g	(working copy)
@@ -329,9 +329,14 @@
 		type = object_name[-1:]
 		if (object_name[0] == '.'):
 			source = base + suffix
+			object = base + '.o'
 		else:
-			source = os.path.join(dirstack.tos(), base + suffix)
-		object = base + '.o'
+			rel_base = re.sub(treetop, "", os.path.join(dirstack.tos(), base))
+			source = "$(TOP)/" + rel_base + suffix
+			if (rel_base[0] == '/'):
+				rel_base = re.sub("^/", "", rel_base)
+			object = rel_base + '.o'
+
 		debug.info(debug.object, "add object %s source %s" % (object_name, source))
 		l = getdict(dict, base)
 		if (l):
@@ -2378,6 +2383,30 @@
 			print "Creating directory %s" % img_dir
 			os.makedirs(img_dir)
 
+		for objrule, obj in image.getobjectrules().items():
+			sub_dir = img_dir + '/' + os.path.dirname(obj[0])
+			if not os.path.isdir(sub_dir):
+				print "Creating sub directory %s" % sub_dir
+				os.makedirs(sub_dir)
+
+		for driverrule, driver in image.getdriverrules().items():
+			sub_dir = img_dir + '/' + os.path.dirname(driver[0])
+			if not os.path.isdir(sub_dir):
+				print "Creating sub directory %s" % sub_dir
+				os.makedirs(sub_dir)
+
+		for srule, smm in image.getsmmobjectrules().items():
+			sub_dir = img_dir + '/' + os.path.dirname(smm[0])
+			if not os.path.isdir(sub_dir):
+				print "Creating sub directory %s" % sub_dir
+				os.makedirs(sub_dir)
+
+		for irule, init in image.getinitobjectrules().items():
+			sub_dir = img_dir + '/' + os.path.dirname(init[0])
+			if not os.path.isdir(sub_dir):
+				print "Creating sub directory %s" % sub_dir
+				os.makedirs(sub_dir)
+
 		if (debug.level(debug.dump)):
 			for i in image.getinitincludes():
 				debug.info(debug.dump, "crt0include file %s" % i)
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to