Add support for configuring for multiple targets

git-svn-id: svn://coreboot.org/openbios/openbios-devel@420 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2009-01-23 20:09:26 +00:00
parent c2ccc6bf52
commit bcd092ad4a
21 changed files with 208 additions and 183 deletions

View File

@@ -1,96 +1,36 @@
ARCH= $(shell test -r rules.xml && cat rules.xml |grep "^ARCH" |cut -d\= -f2|tr -d \ )
HOSTARCH=$(shell config/scripts/archname) HOSTARCH=$(shell config/scripts/archname)
CROSSCFLAGS=$(shell config/scripts/crosscflags $(HOSTARCH) $(ARCH)) ODIRS=$(wildcard obj-*)
ODIR=obj-$(ARCH) TARGETS=$(subst obj-,,$(ODIRS))
all: requirements archtest info build all: requirements info build
archtest: prepare
@test -r config.xml -a -r rules.xml || \
( echo ; echo "Please run the following command first:"; echo ; \
echo " $$ config/scripts/switch-arch <arch>"; \
echo; echo "<arch> can be one out of x86, amd64, cross-ppc, ppc"; \
echo " cross-sparc32, sparc32, cross-sparc64, sparc64"; \
echo; exit 1 )
requirements: requirements:
@which toke &>/dev/null || ( echo ; echo "Please install the OpenBIOS fcode utilities."; \
echo; echo "Download with :"; \
echo " $$ svn co svn://openbios.org/openbios/fcode-utils"; \
echo; exit 1 )
@which xsltproc &>/dev/null || ( echo ; echo "Please install libxslt2"; \ @which xsltproc &>/dev/null || ( echo ; echo "Please install libxslt2"; \
echo; exit 1 ) echo; exit 1 )
info: info:
@echo "Building OpenBIOS on $(HOSTARCH) for $(ARCH)" @echo "Building OpenBIOS on $(HOSTARCH) for $(TARGETS)"
clean: clean:
@printf "Cleaning up..." @printf "Cleaning up..."
@rm -rf $(ODIR) forth.dict.core @rm -rf $(ODIRS) forth.dict.core
@find . -type f -name "*~" -exec rm \{\} \; @find . -type f -name "*~" -exec rm \{\} \;
@echo " ok" @echo " ok"
directories: clean build:
@printf "Initializing build tree..."
@mkdir $(ODIR)
@mkdir -p $(ODIR)/target
@mkdir -p $(ODIR)/target/include
@mkdir -p $(ODIR)/target/arch
@mkdir -p $(ODIR)/target/arch/unix
@mkdir -p $(ODIR)/target/arch/$(ARCH)
@mkdir -p $(ODIR)/target/arch/ppc
@mkdir -p $(ODIR)/target/arch/ppc/briq # no autodetection of those..
@mkdir -p $(ODIR)/target/arch/ppc/pearpc
@mkdir -p $(ODIR)/target/arch/ppc/qemu
@mkdir -p $(ODIR)/target/arch/ppc/mol
@mkdir -p $(ODIR)/target/arch/x86
@mkdir -p $(ODIR)/target/arch/x86/xbox
@mkdir -p $(ODIR)/target/libgcc
@mkdir -p $(ODIR)/target/kernel
@mkdir -p $(ODIR)/target/modules
@mkdir -p $(ODIR)/target/fs
@mkdir -p $(ODIR)/target/fs/grubfs
@mkdir -p $(ODIR)/target/fs/hfs
@mkdir -p $(ODIR)/target/fs/hfsplus
@mkdir -p $(ODIR)/target/drivers
@mkdir -p $(ODIR)/target/libc
@mkdir -p $(ODIR)/host/include
@mkdir -p $(ODIR)/host/kernel
@mkdir -p $(ODIR)/forth
@ln -s $(PWD)/include/$(ARCH) $(ODIR)/target/include/asm
@#compile the host binary with target settings instead
@#ln -s $(PWD)/include/$(HOSTARCH) $(ODIR)/host/include/asm
@echo "ok."
# This is needed because viewvc messes with the permissions of executables:
prepare:
@chmod 755 utils/dist/debian/rules
@chmod 755 config/scripts/switch-arch
@chmod 755 config/scripts/archname
@chmod 755 config/scripts/reldir
@chmod 755 config/scripts/crosscflags
xml: directories
@printf "Creating target Makefile..."
@xsltproc config/xml/xinclude.xsl build.xml > $(ODIR)/build-full.xml
@xsltproc config/xml/makefile.xsl $(ODIR)/build-full.xml > $(ODIR)/Makefile
@echo "ok."
@printf "Creating config files..."
@xsltproc config/xml/config-c.xsl config.xml > $(ODIR)/host/include/autoconf.h
@xsltproc config/xml/config-c.xsl config.xml > $(ODIR)/target/include/autoconf.h
@xsltproc config/xml/config-forth.xsl config.xml > $(ODIR)/forth/config.fs
@echo "ok."
build: xml
@printf "Building..." @printf "Building..."
@( $(MAKE) -f $(ODIR)/Makefile "CROSSCFLAGS=$(CROSSCFLAGS)" > $(ODIR)/build.log 2>&1 && echo "ok." ) || \ @for dir in $(ODIRS); do \
( echo "error:"; tail -15 $(ODIR)/build.log ) $(MAKE) -C $$dir > $$dir/build.log 2>&1 && echo "ok." || \
( echo "error:"; tail -15 $$$dir/build.log; exit 1 ) \
done
build-verbose: build-verbose:
@echo "Building..." @echo "Building..."
$(MAKE) -f $(ODIR)/Makefile "CROSSCFLAGS=$(CROSSCFLAGS)" @for dir in $(ODIRS); do \
$(MAKE) -C $$dir || exit 1; \
done
run: run:
@echo "Running..." @echo "Running..."
@$(ODIR)/openbios-unix $(ODIR)/openbios-unix.dict @$(ODIR)/openbios-unix $(ODIR)/openbios-unix.dict

View File

@@ -39,7 +39,7 @@
<executable name="target/arch/ppc/briq/kernel.o" target="target" condition="BRIQ"> <executable name="target/arch/ppc/briq/kernel.o" target="target" condition="BRIQ">
<rule><![CDATA[ <rule><![CDATA[
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ arch/ppc/briq/kernel.c $(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/briq/kernel.c
]]></rule> ]]></rule>
<external-object source="target/include/briq-dict.h"/> <external-object source="target/include/briq-dict.h"/>
</executable> </executable>
@@ -57,7 +57,7 @@
<executable name="target/arch/ppc/pearpc/kernel.o" target="target" condition="PEARPC"> <executable name="target/arch/ppc/pearpc/kernel.o" target="target" condition="PEARPC">
<rule><![CDATA[ <rule><![CDATA[
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ arch/ppc/pearpc/kernel.c $(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/pearpc/kernel.c
]]></rule> ]]></rule>
<external-object source="target/include/pearpc-dict.h"/> <external-object source="target/include/pearpc-dict.h"/>
</executable> </executable>
@@ -74,7 +74,7 @@
<executable name="target/arch/ppc/qemu/kernel.o" target="target" condition="QEMU"> <executable name="target/arch/ppc/qemu/kernel.o" target="target" condition="QEMU">
<rule><![CDATA[ <rule><![CDATA[
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ arch/ppc/qemu/kernel.c $(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/qemu/kernel.c
]]></rule> ]]></rule>
<external-object source="target/include/qemu-dict.h"/> <external-object source="target/include/qemu-dict.h"/>
</executable> </executable>
@@ -92,7 +92,7 @@
<executable name="target/arch/ppc/mol/kernel.o" target="target" condition="MOL"> <executable name="target/arch/ppc/mol/kernel.o" target="target" condition="MOL">
<rule><![CDATA[ <rule><![CDATA[
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ arch/ppc/mol/kernel.c $(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/ppc/mol/kernel.c
]]></rule> ]]></rule>
<external-object source="target/include/mol-dict.h"/> <external-object source="target/include/mol-dict.h"/>
</executable> </executable>
@@ -105,13 +105,13 @@
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule> $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object> </object>
<object source="ofmem.c"/> <object source="ofmem.c"/>
<object source="briq/briq.c" flags="-Iarch/ppc"/> <object source="briq/briq.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="briq/init.c" flags="-Iarch/ppc"/> <object source="briq/init.c" flags="-I$(SRCDIR)/arch/ppc"/>
<external-object source="target/arch/ppc/briq/kernel.o"/> <external-object source="target/arch/ppc/briq/kernel.o"/>
<object source="briq/main.c" flags="-Iarch/ppc"/> <object source="briq/main.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="briq/methods.c" flags="-Iarch/ppc"/> <object source="briq/methods.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="briq/tree.c" flags="-Iarch/ppc"/> <object source="briq/tree.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="briq/vfd.c" flags="-Iarch/ppc"/> <object source="briq/vfd.c" flags="-I$(SRCDIR)/arch/ppc"/>
</library> </library>
<library name="pearpc" target="target" type="static" condition="PEARPC"> <library name="pearpc" target="target" type="static" condition="PEARPC">
@@ -120,15 +120,15 @@
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule> $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object> </object>
<object source="ofmem.c"/> <object source="ofmem.c"/>
<object source="pearpc/pearpc.c" flags="-Iarch/ppc"/> <object source="pearpc/pearpc.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="pearpc/init.c" flags="-Iarch/ppc"/> <object source="pearpc/init.c" flags="-I$(SRCDIR)/arch/ppc"/>
<external-object source="target/arch/ppc/pearpc/kernel.o"/> <external-object source="target/arch/ppc/pearpc/kernel.o"/>
<object source="pearpc/main.c" flags="-Iarch/ppc"/> <object source="pearpc/main.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="pearpc/methods.c" flags="-Iarch/ppc"/> <object source="pearpc/methods.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="pearpc/tree.c" flags="-Iarch/ppc"/> <object source="pearpc/tree.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="pearpc/vfd.c" flags="-Iarch/ppc"/> <object source="pearpc/vfd.c" flags="-I$(SRCDIR)/arch/ppc"/>
<!-- taken from mol: generalize --> <!-- taken from mol: generalize -->
<object source="pearpc/console.c" flags="-Iarch/ppc"/> <object source="pearpc/console.c" flags="-I$(SRCDIR)/arch/ppc"/>
</library> </library>
<library name="qemu" target="target" type="static" condition="QEMU"> <library name="qemu" target="target" type="static" condition="QEMU">
@@ -137,13 +137,13 @@
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule> $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object> </object>
<object source="qemu/ofmem.c"/> <object source="qemu/ofmem.c"/>
<object source="qemu/qemu.c" flags="-Iarch/ppc"/> <object source="qemu/qemu.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="qemu/init.c" flags="-Iarch/ppc"/> <object source="qemu/init.c" flags="-I$(SRCDIR)/arch/ppc"/>
<external-object source="target/arch/ppc/qemu/kernel.o"/> <external-object source="target/arch/ppc/qemu/kernel.o"/>
<object source="qemu/main.c" flags="-Iarch/ppc"/> <object source="qemu/main.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="qemu/methods.c" flags="-Iarch/ppc"/> <object source="qemu/methods.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="qemu/vfd.c" flags="-Iarch/ppc"/> <object source="qemu/vfd.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="qemu/console.c" flags="-Iarch/ppc"/> <object source="qemu/console.c" flags="-I$(SRCDIR)/arch/ppc"/>
</library> </library>
@@ -153,16 +153,16 @@
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule> $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</object> </object>
<object source="ofmem.c"/> <object source="ofmem.c"/>
<object source="mol/init.c" flags="-Iarch/ppc"/> <object source="mol/init.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="mol/main.c" flags="-Iarch/ppc"/> <object source="mol/main.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="mol/mol.c" flags="-Iarch/ppc"/> <object source="mol/mol.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="mol/console.c" flags="-Iarch/ppc"/> <object source="mol/console.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="mol/osi-blk.c" flags="-Iarch/ppc"/> <object source="mol/osi-blk.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="mol/osi-scsi.c" flags="-Iarch/ppc"/> <object source="mol/osi-scsi.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="mol/pseudodisk.c" flags="-Iarch/ppc"/> <object source="mol/pseudodisk.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="mol/methods.c" flags="-Iarch/ppc"/> <object source="mol/methods.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="mol/prom.c" flags="-Iarch/ppc"/> <object source="mol/prom.c" flags="-I$(SRCDIR)/arch/ppc"/>
<object source="mol/tree.c" flags="-Iarch/ppc"/> <object source="mol/tree.c" flags="-I$(SRCDIR)/arch/ppc"/>
<external-object source="target/arch/ppc/mol/kernel.o"/> <external-object source="target/arch/ppc/mol/kernel.o"/>
</library> </library>
@@ -215,7 +215,7 @@
<executable name="openbios-qemu.elf" target="target" condition="QEMU"> <executable name="openbios-qemu.elf" target="target" condition="QEMU">
<rule> <rule>
$(LD) --warn-common -N -T arch/ppc/qemu/ldscript $^ -o $@ $(LD) --warn-common -N -T $(SRCDIR)/arch/ppc/qemu/ldscript $^ -o $@
$(NM) $@ | sort > $(ODIR)/openbios-qemu.syms $(NM) $@ | sort > $(ODIR)/openbios-qemu.syms
cp $@ $@.nostrip cp $@ $@.nostrip
$(STRIP) $@ $(STRIP) $@

View File

@@ -23,17 +23,17 @@
</library> </library>
<executable name="target/arch/sparc32/entry.o" target="target"> <executable name="target/arch/sparc32/entry.o" target="target">
<rule><![CDATA[ arch/sparc32/entry.S <rule><![CDATA[ $(SRCDIR)/arch/sparc32/entry.S
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule> $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</executable> </executable>
<executable name="target/arch/sparc32/vectors.o" target="target"> <executable name="target/arch/sparc32/vectors.o" target="target">
<rule><![CDATA[ arch/sparc32/vectors.S arch/sparc32/wof.S arch/sparc32/wuf.S <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 $@ arch/sparc32/vectors.S]]></rule> $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/sparc32/vectors.S]]></rule>
</executable> </executable>
<executable name="openbios-plain.elf" target="target" condition="IMAGE_ELF"> <executable name="openbios-plain.elf" target="target" condition="IMAGE_ELF">
<rule> <rule>
$(LD) --warn-common -N -T arch/sparc32/ldscript -o $@.nostrip $^ $(LD) --warn-common -N -T $(SRCDIR)/arch/sparc32/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms $(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms
cp $@.nostrip $@ cp $@.nostrip $@
$(STRIP) $@</rule> $(STRIP) $@</rule>
@@ -61,15 +61,15 @@
</executable> </executable>
<executable name="target/arch/sparc32/builtin.o" target="target" condition="IMAGE_ELF_EMBEDDED"> <executable name="target/arch/sparc32/builtin.o" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule><![CDATA[ arch/sparc32/builtin.c $(ODIR)/target/include/static-dict.h <rule><![CDATA[ $(SRCDIR)/arch/sparc32/builtin.c $(ODIR)/target/include/static-dict.h
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ arch/sparc32/builtin.c]]></rule> $(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/sparc32/builtin.c]]></rule>
</executable> </executable>
<!-- END OF HACK ALERT --> <!-- END OF HACK ALERT -->
<executable name="openbios-builtin.elf" target="target" condition="IMAGE_ELF_EMBEDDED"> <executable name="openbios-builtin.elf" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule> <rule>
$(LD) --warn-common -N -T arch/sparc32/ldscript -o $@.nostrip $^ $(LD) --warn-common -N -T $(SRCDIR)/arch/sparc32/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms $(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms
cp $@.nostrip $@ cp $@.nostrip $@
$(STRIP) $@</rule> $(STRIP) $@</rule>

View File

@@ -22,17 +22,17 @@
</library> </library>
<executable name="target/arch/sparc64/entry.o" target="target"> <executable name="target/arch/sparc64/entry.o" target="target">
<rule><![CDATA[ arch/sparc64/entry.S <rule><![CDATA[ $(SRCDIR)/arch/sparc64/entry.S
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule> $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</executable> </executable>
<executable name="target/arch/sparc64/vectors.o" target="target"> <executable name="target/arch/sparc64/vectors.o" target="target">
<rule><![CDATA[ arch/sparc64/vectors.S <rule><![CDATA[ $(SRCDIR)/arch/sparc64/vectors.S
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule> $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</executable> </executable>
<executable name="openbios-plain.elf" target="target" condition="IMAGE_ELF"> <executable name="openbios-plain.elf" target="target" condition="IMAGE_ELF">
<rule> <rule>
$(LD) --warn-common -T arch/sparc64/ldscript -o $@.nostrip $^ $(LD) --warn-common -T $(SRCDIR)/arch/sparc64/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms $(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms
cp $@.nostrip $@ cp $@.nostrip $@
$(STRIP) $@</rule> $(STRIP) $@</rule>
@@ -61,8 +61,8 @@
</executable> </executable>
<executable name="target/arch/sparc64/builtin.o" target="target" condition="IMAGE_ELF_EMBEDDED"> <executable name="target/arch/sparc64/builtin.o" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule><![CDATA[ arch/sparc64/builtin.c $(ODIR)/target/include/static-dict.h <rule><![CDATA[ $(SRCDIR)/arch/sparc64/builtin.c $(ODIR)/target/include/static-dict.h
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ arch/sparc64/builtin.c]]></rule> $(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/sparc64/builtin.c]]></rule>
</executable> </executable>
<!-- END OF HACK ALERT --> <!-- END OF HACK ALERT -->
@@ -70,7 +70,7 @@
<executable name="openbios-builtin.elf" target="target" condition="IMAGE_ELF_EMBEDDED"> <executable name="openbios-builtin.elf" target="target" condition="IMAGE_ELF_EMBEDDED">
<!-- We use -N to reduce the file size by 1M --> <!-- We use -N to reduce the file size by 1M -->
<rule> <rule>
$(LD) --warn-common -N -T arch/sparc64/ldscript -o $@.nostrip $^ $(LD) --warn-common -N -T $(SRCDIR)/arch/sparc64/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms $(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms
cp $@.nostrip $@ cp $@.nostrip $@
$(STRIP) $@</rule> $(STRIP) $@</rule>

View File

@@ -22,13 +22,13 @@
</library> </library>
<executable name="target/arch/x86/entry.o" target="target"> <executable name="target/arch/x86/entry.o" target="target">
<rule><![CDATA[ arch/x86/entry.S <rule><![CDATA[ $(SRCDIR)/arch/x86/entry.S
$(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule> $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule>
</executable> </executable>
<executable name="openbios.multiboot" target="target" condition="IMAGE_ELF_MULTIBOOT"> <executable name="openbios.multiboot" target="target" condition="IMAGE_ELF_MULTIBOOT">
<rule> <rule>
$(LD) --warn-common -N -T arch/x86/ldscript -o $@.nostrip $^ $(LD) --warn-common -N -T $(SRCDIR)/arch/x86/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-multiboot.syms $(NM) $@.nostrip | sort > $(ODIR)/openbios-multiboot.syms
cp $@.nostrip $@ cp $@.nostrip $@
$(STRIP) $@ $(STRIP) $@
@@ -47,7 +47,7 @@
<executable name="openbios-plain.elf" target="target" condition="IMAGE_ELF"> <executable name="openbios-plain.elf" target="target" condition="IMAGE_ELF">
<rule> <rule>
$(LD) --warn-common -N -T arch/x86/ldscript -o $@.nostrip $^ $(LD) --warn-common -N -T $(SRCDIR)/arch/x86/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms $(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms
cp $@.nostrip $@ cp $@.nostrip $@
$(STRIP) $@ $(STRIP) $@
@@ -78,7 +78,7 @@
<executable name="target/arch/x86/builtin.o" target="target" condition="IMAGE_ELF_EMBEDDED"> <executable name="target/arch/x86/builtin.o" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule><![CDATA[ <rule><![CDATA[
$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ arch/x86/builtin.c $(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/arch/x86/builtin.c
]]></rule> ]]></rule>
<external-object source="target/include/static-dict.h"/> <external-object source="target/include/static-dict.h"/>
</executable> </executable>
@@ -87,7 +87,7 @@
<executable name="openbios-builtin.elf" target="target" condition="IMAGE_ELF_EMBEDDED"> <executable name="openbios-builtin.elf" target="target" condition="IMAGE_ELF_EMBEDDED">
<rule> <rule>
$(LD) --warn-common -N -T arch/x86/ldscript -o $@.nostrip $^ $(LD) --warn-common -N -T $(SRCDIR)/arch/x86/ldscript -o $@.nostrip $^
$(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms $(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms
cp $@.nostrip $@ cp $@.nostrip $@
$(STRIP) $@</rule> $(STRIP) $@</rule>

View File

@@ -7,12 +7,15 @@
# #
ARCH := amd64 ARCH := amd64
ODIR := obj-$(ARCH) ODIR := .
SRCDIR := ..
HOSTCC := gcc HOSTCC := gcc
HOSTARCH=$(shell $(SRCDIR)/config/scripts/archname)
CROSSCFLAGS=$(shell $(SRCDIR)/config/scripts/crosscflags $(HOSTARCH) $(ARCH))
HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
CC := gcc CC := gcc
AS := as AS := as
@@ -26,7 +29,7 @@ INSTALL := install
CFLAGS := -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin -g CFLAGS := -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin -g
CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
# #
# pre rules # pre rules

View File

@@ -7,12 +7,15 @@
# #
ARCH := ppc ARCH := ppc
ODIR := obj-$(ARCH) ODIR := .
SRCDIR := ..
HOSTCC := gcc HOSTCC := gcc
HOSTARCH=$(shell $(SRCDIR)/config/scripts/archname)
CROSSCFLAGS=$(shell $(SRCDIR)/config/scripts/crosscflags $(HOSTARCH) $(ARCH))
HOSTCFLAGS := -Os -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS := -Os -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
# #
# MOLPATH is needed if you want to build openbios-mol.elf # MOLPATH is needed if you want to build openbios-mol.elf
# #
@@ -29,7 +32,7 @@ RANLIB := $(TARGET)ranlib
CFLAGS := -Os -Wall -msoft-float -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin-bcopy -fno-builtin-log2 CFLAGS := -Os -Wall -msoft-float -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin-bcopy -fno-builtin-log2
CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Werror CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Werror
CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
M4 := m4 M4 := m4

View File

@@ -7,12 +7,15 @@
# #
ARCH := sparc32 ARCH := sparc32
ODIR := obj-$(ARCH) ODIR := .
SRCDIR := ..
HOSTCC := gcc HOSTCC := gcc
HOSTARCH=$(shell $(SRCDIR)/config/scripts/archname)
CROSSCFLAGS=$(shell $(SRCDIR)/config/scripts/crosscflags $(HOSTARCH) $(ARCH))
HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
TARGET=sparc-elf- TARGET=sparc-elf-
CC := $(TARGET)gcc CC := $(TARGET)gcc
@@ -26,7 +29,7 @@ CFLAGS := -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fn
CFLAGS+= -Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc CFLAGS+= -Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc
CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
AS_FLAGS := -Wa,-xarch=v8 -Wa,-32 -g AS_FLAGS := -Wa,-xarch=v8 -Wa,-32 -g
# #

View File

@@ -7,12 +7,15 @@
# #
ARCH := sparc64 ARCH := sparc64
ODIR := obj-$(ARCH) ODIR := .
SRCDIR := ..
HOSTCC := gcc HOSTCC := gcc
HOSTARCH=$(shell $(SRCDIR)/config/scripts/archname)
CROSSCFLAGS=$(shell $(SRCDIR)/config/scripts/crosscflags $(HOSTARCH) $(ARCH))
HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
TARGET=sparc64-elf- TARGET=sparc64-elf-
CC := $(TARGET)gcc CC := $(TARGET)gcc
@@ -27,7 +30,7 @@ CFLAGS+= -Wa,-xarch=v9b -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany
CFLAGS+= -fno-builtin -nostdlib -ffreestanding CFLAGS+= -fno-builtin -nostdlib -ffreestanding
CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
AS_FLAGS := -Wa,-xarch=v9b -Wa,-64 -g AS_FLAGS := -Wa,-xarch=v9b -Wa,-64 -g
# #

View File

@@ -7,12 +7,15 @@
# #
ARCH := x86 ARCH := x86
ODIR := obj-$(ARCH) ODIR := .
SRCDIR := ..
HOSTCC := gcc HOSTCC := gcc
HOSTARCH=$(shell $(SRCDIR)/config/scripts/archname)
CROSSCFLAGS=$(shell $(SRCDIR)/config/scripts/crosscflags $(HOSTARCH) $(ARCH))
HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
#TARGET=i386-elf- #TARGET=i386-elf-
TARGET= TARGET=
@@ -27,7 +30,7 @@ CFLAGS := -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fn
CFLAGS+= -m32 CFLAGS+= -m32
CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
AS_FLAGS := -Wa,-32 -g AS_FLAGS := -Wa,-32 -g
# #

View File

@@ -7,12 +7,15 @@
# #
ARCH := ppc ARCH := ppc
ODIR := obj-$(ARCH) ODIR := .
SRCDIR := ..
HOSTCC := gcc HOSTCC := gcc
HOSTARCH=$(shell $(SRCDIR)/config/scripts/archname)
CROSSCFLAGS=$(shell $(SRCDIR)/config/scripts/crosscflags $(HOSTARCH) $(ARCH))
HOSTCFLAGS := -Os -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS := -Os -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
# #
# MOLPATH is needed if you want to build openbios-mol.elf # MOLPATH is needed if you want to build openbios-mol.elf
# #
@@ -28,7 +31,7 @@ RANLIB := ranlib
CFLAGS := -Os -Wall -msoft-float -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin-bcopy -fno-builtin-log2 CFLAGS := -Os -Wall -msoft-float -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin-bcopy -fno-builtin-log2
CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Werror CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Werror
INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
M4 := m4 M4 := m4

View File

@@ -7,12 +7,15 @@
# #
ARCH := sparc32 ARCH := sparc32
ODIR := obj-$(ARCH) ODIR := .
SRCDIR := ..
HOSTCC := gcc HOSTCC := gcc
HOSTARCH=$(shell $(SRCDIR)/config/scripts/archname)
CROSSCFLAGS=$(shell $(SRCDIR)/config/scripts/crosscflags $(HOSTARCH) $(ARCH))
HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
CC := gcc CC := gcc
AS := as AS := as
@@ -31,7 +34,7 @@ CFLAGS := -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fn
CFLAGS+= -Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc CFLAGS+= -Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc
CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
AS_FLAGS := -Wa,-xarch=v8 -Wa,-32 -g AS_FLAGS := -Wa,-xarch=v8 -Wa,-32 -g
# #

View File

@@ -7,13 +7,16 @@
# #
ARCH := sparc64 ARCH := sparc64
ODIR := obj-$(ARCH) ODIR := .
SRCDIR := ..
HOSTCC := gcc HOSTCC := gcc
HOSTARCH=$(shell $(SRCDIR)/config/scripts/archname)
CROSSCFLAGS=$(shell $(SRCDIR)/config/scripts/crosscflags $(HOSTARCH) $(ARCH))
HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
HOSTCFLAGS+= -Wa,-xarch=v9 -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany HOSTCFLAGS+= -Wa,-xarch=v9 -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany
HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
CC := gcc CC := gcc
AS := as AS := as
@@ -32,7 +35,7 @@ CFLAGS := -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fn
CFLAGS+= -Wa,-xarch=v9b -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany CFLAGS+= -Wa,-xarch=v9b -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany
CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
AS_FLAGS := -Wa,-xarch=v9b -Wa,-64 -g AS_FLAGS := -Wa,-xarch=v9b -Wa,-64 -g
ifeq ($(shell uname), OpenBSD) ifeq ($(shell uname), OpenBSD)

View File

@@ -7,12 +7,15 @@
# #
ARCH := x86 ARCH := x86
ODIR := obj-$(ARCH) ODIR := .
SRCDIR := ..
HOSTCC := gcc HOSTCC := gcc
HOSTARCH=$(shell $(SRCDIR)/config/scripts/archname)
CROSSCFLAGS=$(shell $(SRCDIR)/config/scripts/crosscflags $(HOSTARCH) $(ARCH))
HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include HOSTINCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
CC := gcc CC := gcc
AR := ar AR := ar
@@ -29,7 +32,7 @@ CFLAGS := -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fn
CFLAGS+= -m32 CFLAGS+= -m32
CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
AS_FLAGS := -Wa,-32 -g AS_FLAGS := -Wa,-32 -g
# #

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
if [ x"$1" = x ]; then if [ x"$1" = x ]; then
printf "Usage:\n $0 [arch-config]\n" printf "Usage:\n $0 [arch-config]...\n"
printf "arch-config values supported for native builds:\n" printf "arch-config values supported for native builds:\n"
printf " amd64, ppc, sparc32, sparc64, x86\n" printf " amd64, ppc, sparc32, sparc64, x86\n"
printf "arch-config values supported for cross compiled builds:\n" printf "arch-config values supported for cross compiled builds:\n"
@@ -9,9 +9,64 @@ if [ x"$1" = x ]; then
exit 0 exit 0
fi fi
ARCH=$1 # This is needed because viewvc messes with the permissions of executables:
chmod 755 utils/dist/debian/rules
chmod 755 config/scripts/switch-arch
chmod 755 config/scripts/archname
chmod 755 config/scripts/reldir
chmod 755 config/scripts/crosscflags
HOSTARCH=`config/scripts/archname`
rm -f rules.xml echo "Configuring OpenBIOS on $HOSTARCH for $*"
rm -f config.xml for RULES_ARCH in $*; do
ln -s config/examples/${ARCH}_rules.xml rules.xml ARCH=`cat config/examples/${RULES_ARCH}_rules.xml |grep "^ARCH" |cut -d\= -f2|tr -d \ `
ln -s config/examples/${ARCH}_config.xml config.xml OBJDIR=obj-$ARCH
printf "Initializing build tree $OBJDIR..."
rm -rf "$OBJDIR"
mkdir "$OBJDIR"
mkdir -p $OBJDIR/target
mkdir -p $OBJDIR/target/include
mkdir -p $OBJDIR/target/arch
mkdir -p $OBJDIR/target/arch/unix
mkdir -p $OBJDIR/target/arch/$ARCH
mkdir -p $OBJDIR/target/arch/ppc
mkdir -p $OBJDIR/target/arch/ppc/briq # no autodetection of those..
mkdir -p $OBJDIR/target/arch/ppc/pearpc
mkdir -p $OBJDIR/target/arch/ppc/qemu
mkdir -p $OBJDIR/target/arch/ppc/mol
mkdir -p $OBJDIR/target/arch/x86
mkdir -p $OBJDIR/target/arch/x86/xbox
mkdir -p $OBJDIR/target/libgcc
mkdir -p $OBJDIR/target/kernel
mkdir -p $OBJDIR/target/modules
mkdir -p $OBJDIR/target/fs
mkdir -p $OBJDIR/target/fs/grubfs
mkdir -p $OBJDIR/target/fs/hfs
mkdir -p $OBJDIR/target/fs/hfsplus
mkdir -p $OBJDIR/target/drivers
mkdir -p $OBJDIR/target/libc
mkdir -p $OBJDIR/host/include
mkdir -p $OBJDIR/host/kernel
mkdir -p $OBJDIR/forth
ln -s ../../../include/$ARCH $OBJDIR/target/include/asm
#compile the host binary with target settings instead
#ln -s ../../../include/$HOSTARCH $OBJDIR/host/include/asm
echo "ok."
cd $OBJDIR
SRCDIR=..
ODIR=.
printf "Creating target Makefile..."
ln -s $SRCDIR/config/examples/${RULES_ARCH}_rules.xml $ODIR/rules.xml
ln -s $SRCDIR/config/examples/${RULES_ARCH}_config.xml $ODIR/config.xml
xsltproc $SRCDIR/config/xml/xinclude.xsl $SRCDIR/build.xml > $ODIR/build-full.xml
xsltproc $SRCDIR/config/xml/makefile.xsl $ODIR/build-full.xml > $ODIR/Makefile
echo "ok."
printf "Creating config files..."
xsltproc $SRCDIR/config/xml/config-c.xsl $SRCDIR/config/examples/${RULES_ARCH}_config.xml > $ODIR/host/include/autoconf.h
xsltproc $SRCDIR/config/xml/config-c.xsl $SRCDIR/config/examples/${RULES_ARCH}_config.xml > $ODIR/target/include/autoconf.h
xsltproc $SRCDIR/config/xml/config-forth.xsl $SRCDIR/config/examples/${RULES_ARCH}_config.xml > $ODIR/forth/config.fs
echo "ok."
cd $SRCDIR
done

View File

@@ -56,6 +56,7 @@
<xsl:value-of select="$dictname"/><xsl:text>-DICTIONARY:=$(</xsl:text> <xsl:value-of select="$dictname"/><xsl:text>-DICTIONARY:=$(</xsl:text>
<xsl:value-of select="$dictname"/><xsl:text>-DICTIONARY) </xsl:text> <xsl:value-of select="$dictname"/><xsl:text>-DICTIONARY) </xsl:text>
<xsl:text>$(SRCDIR)/</xsl:text>
<xsl:value-of select="$path"/> <xsl:value-of select="$path"/>
<xsl:value-of select="@source"/> <xsl:value-of select="@source"/>
<xsl:text>&#10;</xsl:text> <xsl:text>&#10;</xsl:text>
@@ -116,6 +117,7 @@
<xsl:if test="$conditions = 0"> <xsl:if test="$conditions = 0">
<xsl:text> -I</xsl:text> <xsl:text> -I</xsl:text>
<xsl:text>$(SRCDIR)/</xsl:text>
<xsl:value-of select="$path"/> <xsl:value-of select="$path"/>
</xsl:if> </xsl:if>
</xsl:for-each> </xsl:for-each>

View File

@@ -7,7 +7,7 @@
<xsl:include href="object.xsl"/> <xsl:include href="object.xsl"/>
<xsl:template match="/"> <xsl:template match="/">
<xsl:value-of select="document('../../rules.xml')/rules/pre"/> <xsl:value-of select="document('rules.xml',.)/rules/pre"/>
<xsl:apply-templates select="." mode="dictionaries"/> <xsl:apply-templates select="." mode="dictionaries"/>
<xsl:apply-templates select="." mode="objects"/> <xsl:apply-templates select="." mode="objects"/>
</xsl:template> </xsl:template>

View File

@@ -52,6 +52,7 @@
<xsl:text>.o: </xsl:text> <xsl:text>.o: </xsl:text>
<!-- path of source file --> <!-- path of source file -->
<xsl:text>$(SRCDIR)/</xsl:text>
<xsl:value-of select="$path"/> <xsl:value-of select="$path"/>
<xsl:value-of select="@source"/> <xsl:value-of select="@source"/>
@@ -68,7 +69,7 @@
<xsl:text>" ;\</xsl:text> <xsl:text>" ;\</xsl:text>
</xsl:if> </xsl:if>
<!-- FIXME this requires strict spaces in rules.xml --> <!-- FIXME this requires strict spaces in rules.xml -->
<xsl:value-of select="document('../../rules.xml')//rule[@target=$target][@entity='object']"/> <xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='object']"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
@@ -154,7 +155,7 @@
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<!-- FIXME this requires strict spaces in rules.xml --> <!-- FIXME this requires strict spaces in rules.xml -->
<xsl:value-of select="document('../../rules.xml')//rule[@target=$target][@entity='executable']"/> <xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='executable']"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
@@ -252,7 +253,7 @@
<!-- FIXME this requires strict spaces in rules.xml --> <!-- FIXME this requires strict spaces in rules.xml -->
<xsl:value-of select="document('../../rules.xml')//rule[@target=$target][@entity='library']"/> <xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='library']"/>
</xsl:if> </xsl:if>
</xsl:if> </xsl:if>

View File

@@ -44,8 +44,8 @@
<xsl:choose> <xsl:choose>
<xsl:when test="$expression!=''"> <xsl:when test="$expression!=''">
<xsl:variable name="value"><xsl:value-of select="document('../../config.xml')//option[@name=$confexpr]/attribute::value"/></xsl:variable> <xsl:variable name="value"><xsl:value-of select="document('config.xml',.)//option[@name=$confexpr]/attribute::value"/></xsl:variable>
<xsl:variable name="type"><xsl:value-of select="document('../../config.xml')//option[@name=$confexpr]/attribute::type"/></xsl:variable> <xsl:variable name="type"><xsl:value-of select="document('config.xml',.)//option[@name=$confexpr]/attribute::type"/></xsl:variable>
<xsl:choose> <xsl:choose>
<xsl:when test="$type='boolean'"> <xsl:when test="$type='boolean'">
<xsl:choose> <xsl:choose>

View File

@@ -1,15 +1,15 @@
<build> <build>
<library name="fs" type="static" target="target"> <library name="fs" type="static" target="target">
<object source="block.c" flags="-Ifs/hfs/include -Ifs/ -fno-strict-aliasing" condition="HFS"/> <object source="block.c" flags="-I$(SRCDIR)/fs/hfs/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFS"/>
<object source="btree.c" flags="-Ifs/hfs/include -Ifs/ -fno-strict-aliasing" condition="HFS"/> <object source="btree.c" flags="-I$(SRCDIR)/fs/hfs/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFS"/>
<object source="data.c" flags="-Ifs/hfs/include -Ifs/ -fno-strict-aliasing" condition="HFS"/> <object source="data.c" flags="-I$(SRCDIR)/fs/hfs/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFS"/>
<object source="file.c" flags="-Ifs/hfs/include -Ifs/ -fno-strict-aliasing" condition="HFS"/> <object source="file.c" flags="-I$(SRCDIR)/fs/hfs/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFS"/>
<object source="hfs.c" flags="-Ifs/hfs/include -Ifs/ -fno-strict-aliasing" condition="HFS"/> <object source="hfs.c" flags="-I$(SRCDIR)/fs/hfs/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFS"/>
<object source="low.c" flags="-Ifs/hfs/include -Ifs/ -fno-strict-aliasing" condition="HFS"/> <object source="low.c" flags="-I$(SRCDIR)/fs/hfs/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFS"/>
<object source="medium.c" flags="-Ifs/hfs/include -Ifs/ -fno-strict-aliasing" condition="HFS"/> <object source="medium.c" flags="-I$(SRCDIR)/fs/hfs/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFS"/>
<object source="node.c" flags="-Ifs/hfs/include -Ifs/ -fno-strict-aliasing" condition="HFS"/> <object source="node.c" flags="-I$(SRCDIR)/fs/hfs/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFS"/>
<object source="record.c" flags="-Ifs/hfs/include -Ifs/ -fno-strict-aliasing" condition="HFS"/> <object source="record.c" flags="-I$(SRCDIR)/fs/hfs/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFS"/>
<object source="volume.c" flags="-Ifs/hfs/include -Ifs/ -fno-strict-aliasing" condition="HFS"/> <object source="volume.c" flags="-I$(SRCDIR)/fs/hfs/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFS"/>
<object source="hfs_fs.c" flags="-Ifs/hfs/include -Ifs/ -fno-strict-aliasing" condition="HFS"/> <object source="hfs_fs.c" flags="-I$(SRCDIR)/fs/hfs/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFS"/>
</library> </library>
</build> </build>

View File

@@ -1,11 +1,11 @@
<build> <build>
<library name="fs" type="static" target="target"> <library name="fs" type="static" target="target">
<object source="blockiter.c" flags="-Ifs/hfsplus/include -Ifs/ -fno-strict-aliasing" condition="HFSP"/> <object source="blockiter.c" flags="-I$(SRCDIR)/fs/hfsplus/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFSP"/>
<object source="btree.c" flags="-Ifs/hfsplus/include -Ifs/ -fno-strict-aliasing" condition="HFSP"/> <object source="btree.c" flags="-I$(SRCDIR)/fs/hfsplus/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFSP"/>
<object source="libhfsp.c" flags="-Ifs/hfsplus/include -Ifs/ -fno-strict-aliasing" condition="HFSP"/> <object source="libhfsp.c" flags="-I$(SRCDIR)/fs/hfsplus/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFSP"/>
<object source="record.c" flags="-Ifs/hfsplus/include -Ifs/ -fno-strict-aliasing" condition="HFSP"/> <object source="record.c" flags="-I$(SRCDIR)/fs/hfsplus/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFSP"/>
<object source="unicode.c" flags="-Ifs/hfsplus/include -Ifs/ -fno-strict-aliasing" condition="HFSP"/> <object source="unicode.c" flags="-I$(SRCDIR)/fs/hfsplus/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFSP"/>
<object source="volume.c" flags="-Ifs/hfsplus/include -Ifs/ -fno-strict-aliasing" condition="HFSP"/> <object source="volume.c" flags="-I$(SRCDIR)/fs/hfsplus/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFSP"/>
<object source="hfsp_fs.c" flags="-Ifs/hfsplus/include -Ifs/ -fno-strict-aliasing" condition="HFSP"/> <object source="hfsp_fs.c" flags="-I$(SRCDIR)/fs/hfsplus/include -I$(SRCDIR)/fs/ -fno-strict-aliasing" condition="HFSP"/>
</library> </library>
</build> </build>