diff --git a/Makefile b/Makefile index 7e00e64..83df968 100644 --- a/Makefile +++ b/Makefile @@ -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) -CROSSCFLAGS=$(shell config/scripts/crosscflags $(HOSTARCH) $(ARCH)) -ODIR=obj-$(ARCH) +ODIRS=$(wildcard obj-*) +TARGETS=$(subst obj-,,$(ODIRS)) -all: requirements archtest 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 "; \ - echo; echo " can be one out of x86, amd64, cross-ppc, ppc"; \ - echo " cross-sparc32, sparc32, cross-sparc64, sparc64"; \ - echo; exit 1 ) +all: requirements info build 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"; \ echo; exit 1 ) info: - @echo "Building OpenBIOS on $(HOSTARCH) for $(ARCH)" + @echo "Building OpenBIOS on $(HOSTARCH) for $(TARGETS)" clean: @printf "Cleaning up..." - @rm -rf $(ODIR) forth.dict.core + @rm -rf $(ODIRS) forth.dict.core @find . -type f -name "*~" -exec rm \{\} \; @echo " ok" -directories: clean - @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 +build: @printf "Building..." - @( $(MAKE) -f $(ODIR)/Makefile "CROSSCFLAGS=$(CROSSCFLAGS)" > $(ODIR)/build.log 2>&1 && echo "ok." ) || \ - ( echo "error:"; tail -15 $(ODIR)/build.log ) + @for dir in $(ODIRS); do \ + $(MAKE) -C $$dir > $$dir/build.log 2>&1 && echo "ok." || \ + ( echo "error:"; tail -15 $$$dir/build.log; exit 1 ) \ + done build-verbose: @echo "Building..." - $(MAKE) -f $(ODIR)/Makefile "CROSSCFLAGS=$(CROSSCFLAGS)" + @for dir in $(ODIRS); do \ + $(MAKE) -C $$dir || exit 1; \ + done -run: +run: @echo "Running..." @$(ODIR)/openbios-unix $(ODIR)/openbios-unix.dict diff --git a/arch/ppc/build.xml b/arch/ppc/build.xml index 0ff0c9d..78d2c9e 100644 --- a/arch/ppc/build.xml +++ b/arch/ppc/build.xml @@ -39,7 +39,7 @@ @@ -57,7 +57,7 @@ @@ -74,7 +74,7 @@ @@ -92,7 +92,7 @@ @@ -105,13 +105,13 @@ $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]> - - + + - - - - + + + + @@ -120,15 +120,15 @@ $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]> - - + + - - - - + + + + - + @@ -137,13 +137,13 @@ $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]> - - + + - - - - + + + + @@ -153,16 +153,16 @@ $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]> - - - - - - - - - - + + + + + + + + + + @@ -215,7 +215,7 @@ - $(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 cp $@ $@.nostrip $(STRIP) $@ diff --git a/arch/sparc32/build.xml b/arch/sparc32/build.xml index 0c4b54a..176a8da 100644 --- a/arch/sparc32/build.xml +++ b/arch/sparc32/build.xml @@ -23,17 +23,17 @@ - - + - $(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 cp $@.nostrip $@ $(STRIP) $@ @@ -61,15 +61,15 @@ - + - $(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 cp $@.nostrip $@ $(STRIP) $@ diff --git a/arch/sparc64/build.xml b/arch/sparc64/build.xml index 207e4f0..215dbc6 100644 --- a/arch/sparc64/build.xml +++ b/arch/sparc64/build.xml @@ -22,17 +22,17 @@ - - - $(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 cp $@.nostrip $@ $(STRIP) $@ @@ -61,8 +61,8 @@ - + @@ -70,7 +70,7 @@ - $(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 cp $@.nostrip $@ $(STRIP) $@ diff --git a/arch/x86/build.xml b/arch/x86/build.xml index 8d1f920..7112533 100644 --- a/arch/x86/build.xml +++ b/arch/x86/build.xml @@ -22,13 +22,13 @@ - - $(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 cp $@.nostrip $@ $(STRIP) $@ @@ -47,7 +47,7 @@ - $(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 cp $@.nostrip $@ $(STRIP) $@ @@ -78,7 +78,7 @@ @@ -87,7 +87,7 @@ - $(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 cp $@.nostrip $@ $(STRIP) $@ diff --git a/config/examples/amd64_rules.xml b/config/examples/amd64_rules.xml index 52274e0..743eab2 100644 --- a/config/examples/amd64_rules.xml +++ b/config/examples/amd64_rules.xml @@ -7,12 +7,15 @@ # ARCH := amd64 -ODIR := obj-$(ARCH) +ODIR := . +SRCDIR := .. 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+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 AS := as @@ -26,7 +29,7 @@ INSTALL := install CFLAGS := -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin -g CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 diff --git a/config/examples/cross-ppc_rules.xml b/config/examples/cross-ppc_rules.xml index a659dda..c62cff4 100644 --- a/config/examples/cross-ppc_rules.xml +++ b/config/examples/cross-ppc_rules.xml @@ -7,12 +7,15 @@ # ARCH := ppc -ODIR := obj-$(ARCH) +ODIR := . +SRCDIR := .. HOSTCC := gcc +HOSTARCH=$(shell $(SRCDIR)/config/scripts/archname) +CROSSCFLAGS=$(shell $(SRCDIR)/config/scripts/crosscflags $(HOSTARCH) $(ARCH)) HOSTCFLAGS := -Os -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 # @@ -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+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Werror 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 diff --git a/config/examples/cross-sparc32_rules.xml b/config/examples/cross-sparc32_rules.xml index c557eeb..b7745e1 100644 --- a/config/examples/cross-sparc32_rules.xml +++ b/config/examples/cross-sparc32_rules.xml @@ -7,12 +7,15 @@ # ARCH := sparc32 -ODIR := obj-$(ARCH) +ODIR := . +SRCDIR := .. 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+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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- 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+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 # diff --git a/config/examples/cross-sparc64_rules.xml b/config/examples/cross-sparc64_rules.xml index 97c7cd9..be27ffd 100644 --- a/config/examples/cross-sparc64_rules.xml +++ b/config/examples/cross-sparc64_rules.xml @@ -7,12 +7,15 @@ # ARCH := sparc64 -ODIR := obj-$(ARCH) +ODIR := . +SRCDIR := .. 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+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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- CC := $(TARGET)gcc @@ -27,7 +30,7 @@ CFLAGS+= -Wa,-xarch=v9b -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany CFLAGS+= -fno-builtin -nostdlib -ffreestanding CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 # diff --git a/config/examples/cross-x86_rules.xml b/config/examples/cross-x86_rules.xml index 724ab60..9ddbe2b 100644 --- a/config/examples/cross-x86_rules.xml +++ b/config/examples/cross-x86_rules.xml @@ -7,12 +7,15 @@ # ARCH := x86 -ODIR := obj-$(ARCH) +ODIR := . +SRCDIR := .. 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+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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= @@ -27,7 +30,7 @@ CFLAGS := -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fn CFLAGS+= -m32 CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 # diff --git a/config/examples/ppc_rules.xml b/config/examples/ppc_rules.xml index 6e39b2f..38547c7 100644 --- a/config/examples/ppc_rules.xml +++ b/config/examples/ppc_rules.xml @@ -7,12 +7,15 @@ # ARCH := ppc -ODIR := obj-$(ARCH) +ODIR := . +SRCDIR := .. HOSTCC := gcc +HOSTARCH=$(shell $(SRCDIR)/config/scripts/archname) +CROSSCFLAGS=$(shell $(SRCDIR)/config/scripts/crosscflags $(HOSTARCH) $(ARCH)) HOSTCFLAGS := -Os -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 # @@ -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+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 diff --git a/config/examples/sparc32_rules.xml b/config/examples/sparc32_rules.xml index 4c6cf27..c4f7e6c 100644 --- a/config/examples/sparc32_rules.xml +++ b/config/examples/sparc32_rules.xml @@ -7,12 +7,15 @@ # ARCH := sparc32 -ODIR := obj-$(ARCH) +ODIR := . +SRCDIR := .. 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+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 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+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 # diff --git a/config/examples/sparc64_rules.xml b/config/examples/sparc64_rules.xml index a9845fd..eb15e59 100644 --- a/config/examples/sparc64_rules.xml +++ b/config/examples/sparc64_rules.xml @@ -7,13 +7,16 @@ # ARCH := sparc64 -ODIR := obj-$(ARCH) +ODIR := . +SRCDIR := .. 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+= -Wa,-xarch=v9 -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 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+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 ifeq ($(shell uname), OpenBSD) diff --git a/config/examples/x86_rules.xml b/config/examples/x86_rules.xml index 399b256..c8dec37 100644 --- a/config/examples/x86_rules.xml +++ b/config/examples/x86_rules.xml @@ -7,12 +7,15 @@ # ARCH := x86 -ODIR := obj-$(ARCH) +ODIR := . +SRCDIR := .. 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+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 AR := ar @@ -29,7 +32,7 @@ CFLAGS := -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fn CFLAGS+= -m32 CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations 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 # diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch index 2e913ec..08bd78e 100755 --- a/config/scripts/switch-arch +++ b/config/scripts/switch-arch @@ -1,7 +1,7 @@ #!/bin/sh 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 " amd64, ppc, sparc32, sparc64, x86\n" printf "arch-config values supported for cross compiled builds:\n" @@ -9,9 +9,64 @@ if [ x"$1" = x ]; then exit 0 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 -rm -f config.xml -ln -s config/examples/${ARCH}_rules.xml rules.xml -ln -s config/examples/${ARCH}_config.xml config.xml +echo "Configuring OpenBIOS on $HOSTARCH for $*" +for RULES_ARCH in $*; do + ARCH=`cat config/examples/${RULES_ARCH}_rules.xml |grep "^ARCH" |cut -d\= -f2|tr -d \ ` + 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 diff --git a/config/xml/dictionary.xsl b/config/xml/dictionary.xsl index 7037341..275d2c3 100644 --- a/config/xml/dictionary.xsl +++ b/config/xml/dictionary.xsl @@ -56,6 +56,7 @@ -DICTIONARY:=$( -DICTIONARY) + $(SRCDIR)/ @@ -116,6 +117,7 @@ -I + $(SRCDIR)/ diff --git a/config/xml/makefile.xsl b/config/xml/makefile.xsl index f627b8e..8589274 100644 --- a/config/xml/makefile.xsl +++ b/config/xml/makefile.xsl @@ -7,7 +7,7 @@ - + diff --git a/config/xml/object.xsl b/config/xml/object.xsl index d8ee3e7..7d5961f 100644 --- a/config/xml/object.xsl +++ b/config/xml/object.xsl @@ -52,6 +52,7 @@ .o: + $(SRCDIR)/ @@ -68,7 +69,7 @@ " ;\ - + @@ -154,7 +155,7 @@ - + @@ -252,7 +253,7 @@ - + diff --git a/config/xml/util.xsl b/config/xml/util.xsl index bf95d9e..3b583b9 100644 --- a/config/xml/util.xsl +++ b/config/xml/util.xsl @@ -44,8 +44,8 @@ - - + + diff --git a/fs/hfs/build.xml b/fs/hfs/build.xml index 90f6e2b..2ac6fdb 100644 --- a/fs/hfs/build.xml +++ b/fs/hfs/build.xml @@ -1,15 +1,15 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/fs/hfsplus/build.xml b/fs/hfsplus/build.xml index 4f2604d..d3d32cb 100644 --- a/fs/hfsplus/build.xml +++ b/fs/hfsplus/build.xml @@ -1,11 +1,11 @@ - - - - - - - + + + + + + +