diff options
author | Ronald G. Minnich <rminnich@gmail.com> | 2003-07-23 03:11:40 +0000 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2003-07-23 03:11:40 +0000 |
commit | 3874d40ad6039303decb4e99ff68348d12cb6474 (patch) | |
tree | 7bd3164c8bf46039886f4284602b9dce519d2eb6 /util/newconfig/config.g | |
parent | 99d0d7b300a3810e1cd7af514eb810418f01accc (diff) |
Fix the generation of .o from .S
The object rules now have four members, this is getting KLUDGY!
[object, source, type (i.e. suffix), base]
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1006 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/newconfig/config.g')
-rw-r--r-- | util/newconfig/config.g | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/util/newconfig/config.g b/util/newconfig/config.g index 2d6d27856f..cced81146e 100644 --- a/util/newconfig/config.g +++ b/util/newconfig/config.g @@ -265,6 +265,7 @@ class romimage: if (suffix == '.o'): suffix = '.c' base = object_name[:-2] + type = object_name[-1:] if (object_name[0] == '.'): source = base + suffix else: @@ -274,7 +275,7 @@ class romimage: l = getdict(dict, base) if (l): print "Warning, object/driver %s previously defined" % base - setdict(dict, base, [object, source]) + setdict(dict, base, [object, source, type, base]) def addinitobjectrule(self, name): self.addobjectdriver(self.initobjectrules, name) @@ -1502,8 +1503,21 @@ def writeimagemakefile(image): file.write("\n# objectrules:\n") for objrule, obj in image.getobjectrules().items(): source = topify(obj[1]) - file.write("%s: %s\n" % (obj[0], source)) - file.write("\t$(CC) -c $(CFLAGS) -o $@ $<\n") + type = obj[2] + if (type == 'S'): + # for .S, .o depends on .s + file.write("%s: %s.s\n" % (obj[0], obj[3])) + file.write("\t@echo $(CC) ... -o $@ $<\n") + file.write("\t$(CC) -c $(CPU_OPT) -o $@ $<\n") + # and .s depends on .S + file.write("%s.s: %s\n" % (obj[3], source)) + file.write("\t@echo $(CPP) ... $< > $@\n") + # Note: next 2 lines are ONE output line! + file.write("\t$(CPP) $(CPPFLAGS) $< ") + file.write(">$@.new && mv $@.new $@\n") + else: + file.write("%s: %s\n" % (obj[0], source)) + file.write("\t$(CC) -c $(CFLAGS) -o $@ $<\n") #file.write("%s\n" % objrule[2]) for driverrule, driver in image.getdriverrules().items(): |