v2/src romfs->cbfs rename
[coreboot.git] / util / newconfig / config.g
index 1d3395b071c050e12e953e60b759b3048204c13f..02e04b1ff6b26746f0cb06477ee1df650021f4ee 100644 (file)
@@ -2034,7 +2034,7 @@ def writeimagesettings(image):
        for o in exported:
                file.write("export VARIABLES += %s\n" % o.name)
        file.write("\n")
-       writemakefilefooter(file,filename)
+       writemakefilefooter(file,filename)
        file.close()
 
 # write the romimage makefile
@@ -2224,15 +2224,24 @@ def writemakefile(path):
        file = safe_open(makefilepath, 'w+')
        writemakefileheader(file, makefilepath)
 
+       # Hack to get the necessary settings (CONFIG_CBFS):
+       file.write("include %s/Makefile.settings\n\n" % romimages.keys()[0])
+
        # main rule
+       file.write("ifeq \"$(CONFIG_CBFS)\" \"1\"\n")
        file.write("\nall: ")
        for i in buildroms:
                file.write(" %sfs" % i.name)
-       file.write("\n\n")      
+       file.write("\n")
+       file.write("else")
+       file.write("\nall: ")
+       for i in buildroms:
+               file.write(" %s" % i.name)
+       file.write("\n")
+       file.write("endif\n\n")
 
-       # romtool rules
-       file.write("\nromtool:\n\t$(MAKE) -C $(TOP)/util/romtool\n\tmkdir -p tools\n")
-       file.write("\tcp $(TOP)/util/romtool/tools/rom-mkpayload $(TOP)/util/romtool/tools/rom-mkstage tools\n\tcp $(TOP)/util/romtool/romtool romtool\n")
+       # cbfstool rules
+       file.write("\ncbfstool:\n\tmkdir -p tools/lzma\n\t$(MAKE) -C $(TOP)/util/cbfstool obj=$(shell pwd)\n\n")
 
        file.write("include Makefile.settings\n\n")
        for i, o in romimages.items():
@@ -2269,17 +2278,17 @@ def writemakefile(path):
 
        romsize = getoption("ROM_SIZE", image)
        # i.name? That can not be right, can it? 
-       file.write("%sfs: %s romtool\n" %(i.name,i.name));
-       file.write("\trm -f coreboot.romfs\n");
-       file.write("\t./romtool %sfs create %s %s %s.bootblock\n" % (i.name, romsize, bootblocksize, i.name))
+       file.write("%sfs: %s cbfstool\n" %(i.name,i.name));
+       file.write("\trm -f coreboot.cbfs\n");
+       file.write("\t./cbfstool %sfs create %s %s %s.bootblock\n" % (i.name, romsize, bootblocksize, i.name))
        for i in buildroms:
                for j in i.roms:
                        #failover is a hack that will go away soon. 
                        if (j != "failover") and (rommapping[j] != "/dev/null"):
-                               file.write("\tif [ -f %s/romfs-support ]; then ./romtool %sfs add-payload %s %s/payload `cat %s/romfs-support`; fi\n" % (j, i.name, rommapping[j], j, j))
-               file.write("\t ./romtool %sfs print\n" % i.name)
+                               file.write("\tif [ -f %s/cbfs-support ]; then ./cbfstool %sfs add-payload %s %s/payload `cat %s/cbfs-support`; fi\n" % (j, i.name, rommapping[j], j, j))
+               file.write("\t ./cbfstool %sfs print\n" % i.name)
 
-       file.write(".PHONY: all clean romtool")
+       file.write(".PHONY: all clean cbfstool")
        for i in romimages.keys():
                file.write(" %s-clean" % i)
        for i, o in romimages.items():