Introduce quiet build

Make forthstrap quiet by default. Use generic rules when possible, unify
the rules and cleanup white space. Use ld flag --whole-archive to avoid
some local rule use. We can also remove some hacks introduced to avoid
missing symbols.

Fix problems brought in by ld flag --whole-archive:
 * x86: fix missing nvram symbols
 * PPC: disable misc.S build for qemu (conflicts with our libgcc)

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@556 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2009-08-17 16:58:42 +00:00
parent f85f67517b
commit 9162f1b584
11 changed files with 164 additions and 231 deletions

View File

@@ -65,4 +65,6 @@ build-verbose: info build
build: all
quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1))
include rules.mak

View File

@@ -6,13 +6,13 @@
<object source="briq/tree.fs"/>
<object source="briq/briq.fs"/>
</dictionary>
<dictionary name="openbios-pearpc" init="openbios" target="forth" condition="PEARPC">
<object source="ppc.fs"/>
<object source="pearpc/tree.fs"/>
<object source="pearpc/pearpc.fs"/>
</dictionary>
<dictionary name="openbios-qemu" init="openbios" target="forth" condition="QEMU">
<object source="ppc.fs"/>
<object source="qemu/tree.fs"/>
@@ -24,86 +24,75 @@
<object source="mol/tree.fs"/>
<object source="mol/mol.fs"/>
</dictionary>
<!-- HACK ALERT -->
<executable name="target/include/briq-dict.h" target="target" condition="BRIQ">
<rule><![CDATA[
$(call quiet-command,true, " GEN $(TARGET_DIR)$@")
@echo "static const char forth_dictionary[] = {" > $@
@cat $< | hexdump -ve '1/0 "\t" 8/1 "0x%02x, " 1/0 "\n"' \
| sed 's/0x ,//g' >> $@
@echo "};" >> $@
]]></rule>
@echo "};" >> $@]]></rule>
<external-object source="openbios-briq.dict"/>
</executable>
<executable name="target/arch/ppc/briq/kernel.o" target="target" condition="BRIQ">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/briq/kernel.c
]]></rule>
<external-object source="target/include/briq-dict.h"/>
<rule><![CDATA[ $(SRCDIR)/arch/ppc/briq/kernel.c $(ODIR)/target/include/static-dict.h
$(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/briq/kernel.c, " CC $(TARGET_DIR)$@")]]></rule>
</executable>
<executable name="target/include/pearpc-dict.h" target="target" condition="PEARPC">
<rule><![CDATA[
$(call quiet-command,true, " GEN $(TARGET_DIR)$@")
@echo "static const char forth_dictionary[] = {" > $@
@cat $< | hexdump -ve '1/0 "\t" 8/1 "0x%02x, " 1/0 "\n"' \
| sed 's/0x ,//g' >> $@
@echo "};" >> $@
]]></rule>
@echo "};" >> $@]]></rule>
<external-object source="openbios-pearpc.dict"/>
</executable>
<executable name="target/arch/ppc/pearpc/kernel.o" target="target" condition="PEARPC">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/pearpc/kernel.c
]]></rule>
<external-object source="target/include/pearpc-dict.h"/>
<rule><![CDATA[ $(SRCDIR)/arch/ppc/pearpc/kernel.c $(ODIR)/target/include/pearpc-dict.h
$(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/pearpc/kernel.c, " CC $(TARGET_DIR)$@")]]></rule>
</executable>
<executable name="target/include/qemu-dict.h" target="target" condition="QEMU">
<rule><![CDATA[
$(call quiet-command,true, " GEN $(TARGET_DIR)$@")
@echo "static const char forth_dictionary[] = {" > $@
@cat $< | hexdump -ve '1/0 "\t" 8/1 "0x%02x, " 1/0 "\n"' \
| sed 's/0x ,//g' >> $@
@echo "};" >> $@
]]></rule>
@echo "};" >> $@]]></rule>
<external-object source="openbios-qemu.dict"/>
</executable>
<executable name="target/arch/ppc/qemu/kernel.o" target="target" condition="QEMU">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/qemu/kernel.c
]]></rule>
<external-object source="target/include/qemu-dict.h"/>
<rule><![CDATA[ $(SRCDIR)/arch/ppc/qemu/kernel.c $(ODIR)/target/include/qemu-dict.h
$(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/qemu/kernel.c, " CC $(TARGET_DIR)$@")]]></rule>
</executable>
<executable name="target/include/mol-dict.h" target="target" condition="MOL">
<rule><![CDATA[
$(call quiet-command,true, " GEN $(TARGET_DIR)$@")
@echo "static const char forth_dictionary[] = {" > $@
@cat $< | hexdump -ve '1/0 "\t" 8/1 "0x%02x, " 1/0 "\n"' \
| sed 's/0x ,//g' >> $@
@echo "};" >> $@
]]></rule>
@echo "};" >> $@]]></rule>
<external-object source="openbios-mol.dict"/>
</executable>
<executable name="target/arch/ppc/mol/kernel.o" target="target" condition="MOL">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/mol/kernel.c
]]></rule>
<external-object source="target/include/mol-dict.h"/>
$(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/mol/kernel.c, " CC $(TARGET_DIR)$@")]]></rule>
</executable>
<!-- END OF HACK ALERT -->
<library name="briq" target="target" type="static" condition="BRIQ">
<object source="misc.S">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object>
<object source="misc.S"/>
<object source="ofmem.c"/>
<object source="briq/briq.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="briq/init.c" flags="-I$(SRCDIR)/arch/ppc"/>
@@ -113,12 +102,9 @@
<object source="briq/tree.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="briq/vfd.c" flags="-I$(SRCDIR)/arch/ppc"/>
</library>
<library name="pearpc" target="target" type="static" condition="PEARPC">
<object source="misc.S">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object>
<object source="misc.S"/>
<object source="ofmem.c"/>
<object source="pearpc/pearpc.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="pearpc/init.c" flags="-I$(SRCDIR)/arch/ppc"/>
@@ -130,12 +116,8 @@
<!-- taken from mol: generalize -->
<object source="pearpc/console.c" flags="-I$(SRCDIR)/arch/ppc"/>
</library>
<library name="qemu" target="target" type="static" condition="QEMU">
<object source="misc.S">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object>
<object source="qemu/ofmem.c"/>
<object source="qemu/qemu.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="qemu/init.c" flags="-I$(SRCDIR)/arch/ppc"/>
@@ -146,12 +128,8 @@
<object source="qemu/console.c" flags="-I$(SRCDIR)/arch/ppc"/>
</library>
<library name="mol" target="target" type="static" condition="MOL">
<object source="misc.S">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object>
<object source="misc.S"/>
<object source="ofmem.c"/>
<object source="mol/init.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="mol/main.c" flags="-I$(SRCDIR)/arch/ppc"/>
@@ -165,22 +143,14 @@
<object source="mol/tree.c" flags="-I$(SRCDIR)/arch/ppc"/>
<external-object source="target/arch/ppc/mol/kernel.o"/>
</library>
<executable name="openbios-briq.elf" target="target" condition="BRIQ">
<rule>
$(LD) -g -Ttext=0x01e01000 -Bstatic $^ $(shell $(CC) -print-libgcc-file-name) -o $@
$(NM) $@ | sort > $(ODIR)/openbios-briq.syms
cp $@ $@.nostrip
$(STRIP) $@
</rule>
<object source="start.S">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object>
<object source="timebase.S">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object>
$(call quiet-command,$(LD) -g -Ttext=0x01e01000 -Bstatic $^ $(shell $(CC) -print-libgcc-file-name) -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@")
$(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-briq.syms," GEN $(TARGET_DIR)$@.syms")
$(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule>
<object source="start.S"/>
<object source="timebase.S"/>
<external-object source="libbriq.a"/>
<external-object source="libbootstrap.a"/>
<external-object source="libmodules.a"/>
@@ -188,23 +158,14 @@
<external-object source="liblibc.a"/>
<external-object source="libfs.a"/>
</executable>
<executable name="openbios-pearpc.elf" target="target" condition="PEARPC">
<rule>
$(LD) -g -Ttext=0x01e01000 -Bstatic $^ $(shell $(CC) -print-libgcc-file-name) -o $@
$(NM) $@ | sort > $(ODIR)/openbios-pearpc.syms
cp $@ $@.nostrip
$(STRIP) $@
</rule>
<object source="start.S">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object>
<object source="timebase.S">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object>
$(call quiet-command,$(LD) -g -Ttext=0x01e01000 -Bstatic $^ $(shell $(CC) -print-libgcc-file-name) -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@")
$(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-pearpc.syms," GEN $(TARGET_DIR)$@.syms")
$(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule>
<object source="start.S"/>
<object source="timebase.S"/>
<external-object source="libpearpc.a"/>
<external-object source="libbootstrap.a"/>
<external-object source="libmodules.a"/>
@@ -215,44 +176,26 @@
<executable name="openbios-qemu.elf" target="target" condition="QEMU">
<rule>
$(LD) --warn-common -N -T $(SRCDIR)/arch/ppc/qemu/ldscript $^ -o $@
$(NM) $@ | sort > $(ODIR)/openbios-qemu.syms
cp $@ $@.nostrip
$(STRIP) $@
</rule>
<object source="qemu/start.S">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object>
<object source="timebase.S">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object>
$(call quiet-command,$(LD) --warn-common -N -T $(SRCDIR)/arch/ppc/qemu/ldscript -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@")
$(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-qemu.syms," GEN $(TARGET_DIR)$@.syms")
$(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule>
<object source="qemu/start.S"/>
<object source="timebase.S"/>
<external-object source="libqemu.a"/>
<external-object source="libbootstrap.a"/>
<external-object source="libdrivers.a"/>
<!-- Needs to be after drivers to avoid missing symbols -->
<external-object source="libmodules.a"/>
<external-object source="libdrivers.a"/>
<external-object source="liblibc.a"/>
<external-object source="libfs.a"/>
<external-object source="libgcc.a"/>
</executable>
<executable name="openbios-mol.elf" target="target" condition="MOL">
<rule>
$(LD) -g -Ttext=0x01e01000 -Bstatic $^ $(shell $(CC) -print-libgcc-file-name) -o $@
$(NM) $@ | sort > $(ODIR)/openbios-mol.syms
cp $@ $@.nostrip
$(STRIP) $@
</rule>
<object source="start.S">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object>
$(call quiet-command,$(LD) -g -Ttext=0x01e01000 -Bstatic $^ $(shell $(CC) -print-libgcc-file-name) -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@")
$(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-mol.syms," GEN $(TARGET_DIR)$@.syms")
$(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule>
<object source="start.S"/>
<external-object source="libmol.a"/>
<external-object source="libbootstrap.a"/>
<external-object source="libmodules.a"/>
@@ -260,5 +203,5 @@
<external-object source="liblibc.a"/>
<external-object source="libfs.a"/>
</executable>
</build>

View File

@@ -20,26 +20,16 @@
<object source="forthload.c"/>
<object source="loadfs.c"/>
<object source="romvec.c"/>
<object source="entry.S"/>
<object source="vectors.S"/>
</library>
<executable name="target/arch/sparc32/entry.o" target="target">
<rule><![CDATA[ $(SRCDIR)/arch/sparc32/entry.S
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</executable>
<executable name="target/arch/sparc32/vectors.o" target="target">
<rule><![CDATA[ $(SRCDIR)/arch/sparc32/vectors.S $(SRCDIR)/arch/sparc32/wof.S $(SRCDIR)/arch/sparc32/wuf.S
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/sparc32/vectors.S]]></rule>
</executable>
<executable name="openbios-plain.elf" target="target" condition="IMAGE_ELF">
<rule>
$(LD) --warn-common -N -T $(SRCDIR)/arch/sparc32/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms
cp $@.nostrip $@
$(STRIP) $@</rule>
$(call quiet-command,$(LD) --warn-common -N -T $(SRCDIR)/arch/sparc32/ldscript -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@")
$(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms," GEN $(TARGET_DIR)$@.syms")
$(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule>
<object source="plainboot.c"/>
<external-object source="target/arch/sparc32/vectors.o"/>
<external-object source="target/arch/sparc32/entry.o"/>
<external-object source="libsparc32.a"/>
<external-object source="libbootstrap.a"/>
<external-object source="libmodules.a"/>
@@ -53,6 +43,7 @@
<executable name="target/include/static-dict.h" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule><![CDATA[
$(call quiet-command,true, " GEN $(TARGET_DIR)$@")
@echo "static const char forth_dictionary[] = {" > $@
@cat $< | hexdump -ve '1/0 "\t" 8/1 "0x%02x, " 1/0 "\n"' \
| sed 's/0x ,//g' >> $@
@@ -62,19 +53,16 @@
<executable name="target/arch/sparc32/builtin.o" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule><![CDATA[ $(SRCDIR)/arch/sparc32/builtin.c $(ODIR)/target/include/static-dict.h
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/sparc32/builtin.c]]></rule>
$(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/sparc32/builtin.c, " CC $(TARGET_DIR)$@")]]></rule>
</executable>
<!-- END OF HACK ALERT -->
<executable name="openbios-builtin.elf" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule>
$(LD) --warn-common -N -T $(SRCDIR)/arch/sparc32/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms
cp $@.nostrip $@
$(STRIP) $@</rule>
<external-object source="target/arch/sparc32/vectors.o"/>
<external-object source="target/arch/sparc32/entry.o"/>
$(call quiet-command,$(LD) --warn-common -N -T $(SRCDIR)/arch/sparc32/ldscript -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@")
$(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms," GEN $(TARGET_DIR)$@.syms")
$(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule>
<external-object source="target/arch/sparc32/builtin.o"/>
<external-object source="libsparc32.a"/>
<external-object source="libbootstrap.a"/>

View File

@@ -20,36 +20,21 @@
<object source="fcodeload.c"/>
<object source="loadfs.c"/>
<object source="ofmem_sparc64.c"/>
<object source="entry.S"/>
<object source="vectors.S"/>
<object source="call-client.S"/>
</library>
<executable name="target/arch/sparc64/entry.o" target="target">
<rule><![CDATA[ $(SRCDIR)/arch/sparc64/entry.S
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</executable>
<executable name="target/arch/sparc64/vectors.o" target="target">
<rule><![CDATA[ $(SRCDIR)/arch/sparc64/vectors.S
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</executable>
<executable name="target/arch/sparc64/call-client.o" target="target">
<rule><![CDATA[ $(SRCDIR)/arch/sparc64/call-client.S
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</executable>
<executable name="openbios-plain.elf" target="target" condition="IMAGE_ELF">
<rule>
$(LD) --warn-common -T $(SRCDIR)/arch/sparc64/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms
cp $@.nostrip $@
$(STRIP) $@</rule>
$(call quiet-command,$(LD) --warn-common -T $(SRCDIR)/arch/sparc64/ldscript -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@")
$(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms," GEN $(TARGET_DIR)$@.syms")
$(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule>
<object source="plainboot.c"/>
<external-object source="target/arch/sparc64/vectors.o"/>
<external-object source="target/arch/sparc64/entry.o"/>
<external-object source="target/arch/sparc64/call-client.o"/>
<external-object source="libsparc64.a"/>
<external-object source="libbootstrap.a"/>
<external-object source="libdrivers.a"/>
<!-- Needs to be after drivers to avoid missing symbols -->
<external-object source="libmodules.a"/>
<external-object source="libdrivers.a"/>
<external-object source="liblibc.a"/>
<external-object source="libfs.a"/>
<external-object source="libgcc.a"/>
@@ -59,6 +44,7 @@
<executable name="target/include/static-dict.h" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule><![CDATA[
$(call quiet-command,true, " GEN $(TARGET_DIR)$@")
@echo "static const char forth_dictionary[] = {" > $@
@cat $< | hexdump -ve '1/0 "\t" 8/1 "0x%02x, " 1/0 "\n"' \
| sed 's/0x ,//g' >> $@
@@ -68,7 +54,7 @@
<executable name="target/arch/sparc64/builtin.o" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule><![CDATA[ $(SRCDIR)/arch/sparc64/builtin.c $(ODIR)/target/include/static-dict.h
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/sparc64/builtin.c]]></rule>
$(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/sparc64/builtin.c, " CC $(TARGET_DIR)$@")]]></rule>
</executable>
<!-- END OF HACK ALERT -->
@@ -76,19 +62,14 @@
<executable name="openbios-builtin.elf" target="target" condition="IMAGE_ELF_EMBEDDED">
<!-- We use -N to reduce the file size by 1M -->
<rule>
$(LD) --warn-common -N -T $(SRCDIR)/arch/sparc64/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms
cp $@.nostrip $@
$(STRIP) $@</rule>
<external-object source="target/arch/sparc64/vectors.o"/>
<external-object source="target/arch/sparc64/entry.o"/>
$(call quiet-command,$(LD) --warn-common -N -T $(SRCDIR)/arch/sparc64/ldscript -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@")
$(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms," GEN $(TARGET_DIR)$@.syms")
$(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule>
<external-object source="target/arch/sparc64/builtin.o"/>
<external-object source="target/arch/sparc64/call-client.o"/>
<external-object source="libsparc64.a"/>
<external-object source="libbootstrap.a"/>
<external-object source="libdrivers.a"/>
<!-- Needs to be after drivers to avoid missing symbols -->
<external-object source="libmodules.a"/>
<external-object source="libdrivers.a"/>
<external-object source="liblibc.a"/>
<external-object source="libfs.a"/>
<external-object source="libgcc.a"/>

View File

@@ -6,7 +6,7 @@
<executable name="openbios-unix" target="target">
<rule>
$(CC) $(CFLAGS) -rdynamic $(LIBDL_LDFLAGS) -o $@ $^
$(call quiet-command,$(CC) $(CFLAGS) -rdynamic $(LIBDL_LDFLAGS) -o $@ $^," LINK $(TARGET_DIR)$@")
</rule>
<object source="unix.c" flags="-DBOOTSTRAP"/>
<object source="boot.c" flags="-DBOOTSTRAP"/>

View File

@@ -17,29 +17,21 @@
<object source="elfload.c"/>
<object source="forthload.c"/>
<object source="loadfs.c"/>
<object source="entry.S"/>
<object source="xbox/console.c" condition="XBOX"/>
<object source="xbox/methods.c" condition="XBOX"/>
</library>
<executable name="target/arch/x86/entry.o" target="target">
<rule><![CDATA[ $(SRCDIR)/arch/x86/entry.S
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</executable>
<executable name="openbios.multiboot" target="target" condition="IMAGE_ELF_MULTIBOOT">
<rule>
$(LD) --warn-common -N -T $(SRCDIR)/arch/x86/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-multiboot.syms
cp $@.nostrip $@
$(STRIP) $@
</rule>
<external-object source="target/arch/x86/entry.o"/>
$(call quiet-command,$(LD) --warn-common -N -T $(SRCDIR)/arch/x86/ldscript -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@")
$(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-multiboot.syms," GEN $(TARGET_DIR)$@.syms")
$(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule>
<object source="multiboot.c"/>
<external-object source="libx86.a"/>
<external-object source="libbootstrap.a"/>
<external-object source="libdrivers.a"/>
<!-- Needs to be after drivers to avoid missing symbols -->
<external-object source="libmodules.a"/>
<external-object source="libdrivers.a"/>
<external-object source="liblibc.a"/>
<external-object source="libfs.a"/>
<external-object source="libgcc.a"/>
@@ -47,60 +39,51 @@
<executable name="openbios-plain.elf" target="target" condition="IMAGE_ELF">
<rule>
$(LD) --warn-common -N -T $(SRCDIR)/arch/x86/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms
cp $@.nostrip $@
$(STRIP) $@
</rule>
<external-object source="target/arch/x86/entry.o"/>
$(call quiet-command,$(LD) --warn-common -N -T $(SRCDIR)/arch/x86/ldscript -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@")
$(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms," GEN $(TARGET_DIR)$@.syms")
$(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule>
<object source="plainboot.c"/>
<external-object source="libx86.a"/>
<external-object source="libbootstrap.a"/>
<external-object source="libdrivers.a"/>
<!-- Needs to be after drivers to avoid missing symbols -->
<external-object source="libmodules.a"/>
<external-object source="libdrivers.a"/>
<external-object source="liblibc.a"/>
<external-object source="libfs.a"/>
<external-object source="libgcc.a"/>
</executable>
<!-- HACK ALERT -->
<executable name="target/include/static-dict.h" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule><![CDATA[
$(call quiet-command,true, " GEN $(TARGET_DIR)$@")
@echo "static const char forth_dictionary[] = {" > $@
@cat $< | hexdump -ve '1/0 "\t" 8/1 "0x%02x, " 1/0 "\n"' \
| sed 's/0x ,//g' >> $@
@echo "};" >> $@
]]></rule>
@echo "};" >> $@]]></rule>
<external-object source="openbios-x86.dict"/>
</executable>
<executable name="target/arch/x86/builtin.o" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule><![CDATA[
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/x86/builtin.c
]]></rule>
<external-object source="target/include/static-dict.h"/>
<rule><![CDATA[ $(SRCDIR)/arch/x86/builtin.c $(ODIR)/target/include/static-dict.h
$(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/x86/builtin.c, " CC $(TARGET_DIR)$@")]]></rule>
</executable>
<!-- END OF HACK ALERT -->
<executable name="openbios-builtin.elf" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule>
$(LD) --warn-common -N -T $(SRCDIR)/arch/x86/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms
cp $@.nostrip $@
$(STRIP) $@</rule>
<external-object source="target/arch/x86/entry.o"/>
$(call quiet-command,$(LD) --warn-common -N -T $(SRCDIR)/arch/x86/ldscript -o $@.nostrip --whole-archive $^," LINK $(TARGET_DIR)$@")
$(call quiet-command,$(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms," GEN $(TARGET_DIR)$@.syms")
$(call quiet-command,$(STRIP) $@.nostrip -o $@," STRIP $(TARGET_DIR)$@")</rule>
<external-object source="target/arch/x86/builtin.o"/>
<external-object source="libx86.a"/>
<external-object source="libbootstrap.a"/>
<external-object source="libdrivers.a"/>
<!-- Needs to be after drivers to avoid missing symbols -->
<external-object source="libmodules.a"/>
<external-object source="libdrivers.a"/>
<external-object source="liblibc.a"/>
<external-object source="libfs.a"/>
<external-object source="libgcc.a"/>
</executable>
</build>

View File

@@ -302,3 +302,14 @@ idtarg:
_idt:
.fill 20, 8, 0 # idt is unitiailzed
_idt_end:
.globl arch_nvram_size, arch_nvram_get, arch_nvram_put
arch_nvram_size:
xor %eax, %eax
ret
arch_nvram_get:
ret
arch_nvram_put:
ret

View File

@@ -95,7 +95,7 @@
</xsl:if>
<xsl:text>&#10;</xsl:text>
<!-- rule -->
<xsl:text>&#9;$(ODIR)/forthstrap</xsl:text>
<xsl:text>&#9;$(call quiet-command,$(ODIR)/forthstrap</xsl:text>
<xsl:for-each select="//dictionary[@name = @name]">
<xsl:variable name="conditions">
@@ -131,7 +131,7 @@
</xsl:if>
<xsl:text> $(</xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>-DICTIONARY)&#10;&#10;</xsl:text>
<xsl:text>-DICTIONARY)," GEN $(TARGET_DIR)$@")&#10;&#10;</xsl:text>
</xsl:if>
</xsl:if>
</xsl:for-each>

View File

@@ -63,13 +63,19 @@
<xsl:text>&#10;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:if test="@flags!=''">
<xsl:text>&#10;&#9;EXTRACFLAGS="</xsl:text>
<xsl:value-of select="@flags"/>
<xsl:text>" ;\</xsl:text>
</xsl:if>
<!-- FIXME this requires strict spaces in rules.xml -->
<xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='object']"/>
<xsl:choose>
<xsl:when test="@flags!=''">
<xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='object'][@extracflags='1']"/>
<xsl:text> </xsl:text>
<xsl:value-of select="@flags"/>
<xsl:text> </xsl:text>
<xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='object'][@extracflags='2']"/>
</xsl:when>
<xsl:otherwise>
<!-- FIXME this requires strict spaces in rules.xml -->
<xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='object']"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>

View File

@@ -1,23 +1,31 @@
<rules>
<!-- host compiler build rules -->
<rule target="host" entity="executable">
$(HOSTCC) $(HOSTCFLAGS) -o $@ $^
$(call quiet-command,$(HOSTCC) $(HOSTCFLAGS) -o $@ $^," HOSTCC $(TARGET_DIR)$@")
</rule>
<rule target="host" entity="object">
$(HOSTCC) $(HOSTCFLAGS) $(HOSTINCLUDES) -c -o $@ $^
$(call quiet-command,$(HOSTCC) $(HOSTCFLAGS) $(HOSTINCLUDES) -c -o $@ $^," HOSTCC $(TARGET_DIR)$@")
</rule>
<rule target="host" entity="object" extracflags="1">
$(call quiet-command,$(HOSTCC) $(HOSTCFLAGS) $(HOSTINCLUDES)</rule>
<rule target="host" entity="object" extracflags="2"> -c -o $@ $^," HOSTCC $(TARGET_DIR)$@")
</rule>
<rule target="host" entity="library">
$(AR) cru $@ $^; $(RANLIB) $@
$(call quiet--command,$(AR) cru $@ $^; $(RANLIB) $@," HOSTAR $(TARGET_DIR)$@")
</rule>
<!-- target/cross compiler build rules -->
<rule target="target" entity="executable">
$(CC) $(CFLAGS) -o $@ $^
$(call quiet-command,$(CC) $(CFLAGS) -o $@ $^," CC $(TARGET_DIR)$@")
</rule>
<rule target="target" entity="object">
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $^
$(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $^," CC $(TARGET_DIR)$@")
</rule>
<rule target="target" entity="object" extracflags="1">
$(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES)</rule>
<rule target="target" entity="object" extracflags="2"> -c -o $@ $^," CC $(TARGET_DIR)$@")
</rule>
<rule target="target" entity="library">
$(AR) cru $@ $^; $(RANLIB) $@
$(call quiet-command,$(AR) cru $@ $^; $(RANLIB) $@," AR $(TARGET_DIR)$@")
</rule>
</rules>

View File

@@ -220,7 +220,9 @@ static void write_dictionary(const char *filename)
header->checksum=target_long(checksum);
dump_header(header);
if (verbose) {
dump_header(header);
}
f = fopen(filename, "w");
if (!f) {
@@ -727,8 +729,9 @@ static int build_dictionary(void)
buildconstant("/x", sizeof(u64));
reveal();
printk("Dictionary initialization finished.\n");
if (verbose) {
printk("Dictionary initialization finished.\n");
}
return 0;
}
@@ -873,7 +876,9 @@ encode_file( const char *name )
size = ftell( file );
fseek( file, 0, SEEK_SET );
printk("\nEncoding %s [%d bytes]\n", name, size );
if (verbose) {
printk("\nEncoding %s [%d bytes]\n", name, size );
}
fread( dict + dicthead, size, 1, file );
PUSH( pointer2cell(dict + dicthead) );
PUSH( size );
@@ -914,8 +919,10 @@ static void new_dictionary(const char *source)
interpret_source((char *)source);
printk("interpretion finished. %d errors occured.\n",
errors);
if (verbose || errors > 0) {
printk("interpretion finished. %d errors occured.\n",
errors);
}
}
/*
@@ -964,8 +971,6 @@ int main(int argc, char *argv[])
const char *optstring = "VvhsI:d:D:?";
printk(BANNER);
while (1) {
#ifdef __GLIBC__
int option_index = 0;
@@ -1014,12 +1019,10 @@ int main(int argc, char *argv[])
break;
case 'd':
if (!basedict) {
printk("Using source dictionary '%s'\n", optarg);
basedict = optarg;
}
case 'D':
if(!dictname) {
printk("Dumping final dictionary to '%s'\n", optarg);
dictname = optarg;
}
break;
@@ -1028,6 +1031,12 @@ int main(int argc, char *argv[])
}
}
if (verbose) {
printk(BANNER);
printk("Using source dictionary '%s'\n", basedict);
printk("Dumping final dictionary to '%s'\n", dictname);
}
if (argc < optind + 1) {
printk(USAGE, argv[0]);
return 1;
@@ -1085,7 +1094,9 @@ int main(int argc, char *argv[])
*/
for (cnt=0; cnt<2; cnt++) {
printk("Compiling dictionary %d/%d\n", cnt+1, 2);
if (verbose) {
printk("Compiling dictionary %d/%d\n", cnt+1, 2);
}
dict=bootstrapdict[cnt];
if(!basedict) {
new_dictionary(argv[optind]);