if (type == 'S'):
# for .S, .o depends on .s
file.write("%s: %s.s\n" % (obj[0], obj[3]))
- file.write("\t$(CC) -c $(CPU_OPT) -o $@ $<\n")
+ file.write("\t$(CC) -c $(CONFIG_CPU_OPT) -o $@ $<\n")
# and .s depends on .S
file.write("%s.s: %s\n" % (obj[3], source))
# Note: next 2 lines are ONE output line!
global curimage
global bootblocksize
mainboard()
- imagesize = getoption("ROM_IMAGE_SIZE", curimage)
+ imagesize = getoption("CONFIG_ROM_IMAGE_SIZE", curimage)
bootblocksize += imagesize
print "End ROMIMAGE"
curimage = 0
full_mainboard_path = os.path.join(treetop, 'src', 'mainboard', path)
vendor = re.sub("/.*", "", path)
part_number = re.sub("[^/]*/", "", path)
- setdefault('MAINBOARD', full_mainboard_path, 0)
- setdefault('MAINBOARD_VENDOR', vendor, 0)
- setdefault('MAINBOARD_PART_NUMBER', part_number, 0)
+ setdefault('CONFIG_MAINBOARD', full_mainboard_path, 0)
+ setdefault('CONFIG_MAINBOARD_VENDOR', vendor, 0)
+ setdefault('CONFIG_MAINBOARD_PART_NUMBER', part_number, 0)
def mainboard():
global curimage, dirstack, partstack
def setarch(my_arch):
"""arch is 'different' ... darn it."""
global curimage
- print "SETTING ARCH %s\n" % my_arch
+ print "SETTING CONFIG_ARCH %s\n" % my_arch
curimage.setarch(my_arch)
- setdefault('ARCH', my_arch, 1)
+ setdefault('CONFIG_ARCH', my_arch, 1)
part('arch', my_arch, 'Config.lb', 0)
def doconfigfile(path, confdir, file, rule):
token ACTION: 'action'
token ADDACTION: 'addaction'
token ALWAYS: 'always'
- token ARCH: 'arch'
+ token CONFIG_ARCH: 'arch'
token BUILDROM: 'buildrom'
token COMMENT: 'comment'
token CONFIG: 'config'
token IRQ: 'irq'
token LDSCRIPT: 'ldscript'
token LOADOPTIONS: 'loadoptions'
- token MAINBOARD: 'mainboard'
+ token CONFIG_MAINBOARD: 'mainboard'
token MAINBOARDINIT: 'mainboardinit'
token MAKEDEFINE: 'makedefine'
token MAKERULE: 'makerule'
] {{ if (C): part(parttype, partid, 'Config.lb', name) }}
partend<<C>>
- rule arch<<C>>: ARCH ID {{ if (C): setarch(ID) }}
+ rule arch<<C>>: CONFIG_ARCH ID {{ if (C): setarch(ID) }}
partend<<C>>
rule mainboardinit<<C>>:
rule payload<<C>>: PAYLOAD DIRPATH {{ if (C): payload(DIRPATH) }}
rule mainboard:
- MAINBOARD PATH {{ mainboardsetup(PATH) }}
+ CONFIG_MAINBOARD PATH {{ mainboardsetup(PATH) }}
rule romif<<C>>: IF ID {{ c = lookup(ID) }}
(romstmt<<C and c>>)*
file.write("# Function to create an item like -Di586 or -DCONFIG_MAX_CPUS='1' or -Ui686\n")
file.write("D_item = $(shell echo '$(if $(subst undefined,,$(origin $1)),\\#define $1$(if $($1), $($1),),\\#undef $1)' >> settings.h)\n\n")
file.write("# Compute the value of CPUFLAGS here during make's first pass.\n")
- file.write("CPUFLAGS := $(strip $(shell echo '/* autogenerated */' > settings.h)$(foreach _var_,$(VARIABLES),$(call D_item,$(_var_)))-include $(PWD)/settings.h)\n\n")
+ file.write("CPUFLAGS := $(strip $(shell echo '/* autogenerated */' > settings.h)$(foreach _var_,$(VARIABLES),$(call D_item,$(_var_)))-include $(CURDIR)/settings.h)\n\n")
for i in image.getuserdefines():
file.write("%s\n" %i)
file.write("\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("\ncbfstool:\n\tmkdir -p cbfs/tools/lzma\n\t$(MAKE) -C $(TOP)/util/cbfstool obj=$(shell pwd)/cbfs\n")
+ file.write("\ncbfstool-clean:\n\t$(MAKE) -C $(TOP)/util/cbfstool obj=$(shell pwd)/cbfs clean\n\n")
file.write("include Makefile.settings\n\n")
for i, o in romimages.items():
file.write(" %s/coreboot.rom " % j)
file.write("\n")
- romsize = getoption("ROM_SIZE", image)
+ romsize = getoption("CONFIG_ROM_SIZE", image)
file.write("\n\trm -f %s\n" %(i.name))
# build the bootblock here.
file.write("\n\tcat")
for j in i.roms:
- file.write(" %s/coreboot.strip " % j)
+ file.write(" %s/coreboot.rom " % j)
file.write("> %s.bootblock\n\n" %i.name)
- file.write("\t./cbfstool %s create %s %s %s.bootblock\n"
+ file.write("\t./cbfs/cbfstool %s create %s %s %s.bootblock\n"
%(i.name, romsize, bootblocksize, i.name))
for j in pciroms:
- file.write("\t./cbfstool %s add %s pci%04x,%04x.rom optionrom\n" % (i.name, j.name, j.pci_vid, j.pci_did))
+ file.write("\t./cbfs/cbfstool %s add %s pci%04x,%04x.rom optionrom\n" % (i.name, j.name, j.pci_vid, j.pci_did))
for j in i.roms:
#failover is a hack that will go away soon.
if (j != "failover") and (rommapping[j] != "/dev/null"):
- file.write("\t./cbfstool %s add-payload %s %s/payload $(CBFS_COMPRESS_FLAG)\n" % (i.name, rommapping[j], j,))
- file.write("\t./cbfstool %s print\n" % i.name)
+ file.write("\t./cbfs/cbfstool %s add-payload %s %s/payload $(CBFS_COMPRESS_FLAG)\n" % (i.name, rommapping[j], j,))
+ if (j != "failover"):
+ file.write("\t./cbfs/cbfstool %s add-stage %s/coreboot_ram %s/coreboot_ram $(CBFS_COMPRESS_FLAG)\n" % (i.name, j, j,))
+ file.write("\tif [ -f %s/coreboot_apc ]; then ./cbfs/cbfstool %s add-stage %s/coreboot_apc %s/coreboot_apc $(CBFS_COMPRESS_FLAG); fi\n" % (j, i.name, j, j,))
+ file.write("\t./cbfs/cbfstool %s print\n" % i.name)
file.write("\n")
file.write("else\n\n")