From 21574ddbecd38a7cfb31811827642a36030fe8fc Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Wed, 24 Jan 2018 12:40:05 -0800 Subject: [PATCH] fix(Makefile): fix issues finding target specs --- Makefile | 26 +++++++++++-------- .../x86_32-sos-bootstrap-gnu.json | 0 .../x86_64-sos-kernel-gnu.json | 0 3 files changed, 15 insertions(+), 11 deletions(-) rename {boot => targets}/x86_32-sos-bootstrap-gnu.json (100%) rename x86_64-sos-kernel-gnu.json => targets/x86_64-sos-kernel-gnu.json (100%) diff --git a/Makefile b/Makefile index dc94488f..9370ebc0 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,8 @@ HELP_FUN = \ exception: $(iso) ##@build Run the kernel, dumping the state from QEMU if an exception occurs @qemu-system-x86_64 -s -hda $(iso) -d int -no-reboot -serial file:$(CURDIR)/target/$(target)/serial-$(TIMESTAMP).log +cargo: + doc: ##@utilities Make RustDoc documentation @xargo doc @@ -98,29 +100,31 @@ $(wild_isofiles): @mkdir -p $@/boot/grub $(boot): - @cd boot && RUST_TARGET_PATH="$(shell pwd)/boot" xargo rustc \ + @cd boot && RUST_TARGET_PATH="$(PWD)/targets" xargo rustc \ --target $(boot_target) \ -- --crate-type=staticlib - # Place 32-bit bootstrap code into a 64-bit ELF - @x86_64-pc-elf-objcopy -O elf64-x86-64 $(boot_outdir)/debug/libboot32.a \ - $(boot_outdir)/debug/libboot.a + # Place 32-bit bootstrap code into a 64-bit ELF + @x86_64-pc-elf-objcopy -O elf64-x86-64 \ + $(boot_outdir)/debug/libboot32.a \ + $(boot_outdir)/debug/libboot.a @x86_64-pc-elf-objcopy --strip-debug -G _start \ $(boot_outdir)/debug/libboot.a # @cd $(boot_outdir)/debug && ar -crus libboot.a boot.o $(release_boot): - @cd boot && RUST_TARGET_PATH="$(shell pwd)/boot" xargo rustc \ + @cd boot && RUST_TARGET_PATH="$(PWD)/targets" xargo rustc \ --target $(boot_target) \ -- --release \ - --crate-type=staticlib - # Place 32-bit bootstrap code into a 64-bit ELF - @x86_64-pc-elf-objcopy -O elf64-x86-64 $(boot_outdir)/release/libboot32.a \ - $(boot_outdir)/release/libboot.a + --crate-type=staticlib + # Place 32-bit bootstrap code into a 64-bit ELF + @x86_64-pc-elf-objcopy -O elf64-x86-64 \ + $(boot_outdir)/release/libboot32.a \ + $(boot_outdir)/release/libboot.a @x86_64-pc-elf-objcopy --strip-debug -G _start \ $(boot_outdir)/release/libboot.a $(release_kernel): $(release_boot) - @xargo build --target $(target) --release + @RUST_TARGET_PATH="$(PWD)/targets" xargo build --target $(target) --release $(release_kernel).bin: $(release_kernel) @cp $(release_kernel) $(release_kernel).bin @@ -133,7 +137,7 @@ $(release_iso): $(release_kernel).bin $(grub_cfg) @rm -r $(release_isofiles) $(kernel): $(boot) - @xargo build --target $(target) + @RUST_TARGET_PATH="$(PWD)/targets" xargo build --target $(target) $(kernel).debug: $(kernel) @x86_64-elf-objcopy --only-keep-debug $(kernel) $(kernel).debug diff --git a/boot/x86_32-sos-bootstrap-gnu.json b/targets/x86_32-sos-bootstrap-gnu.json similarity index 100% rename from boot/x86_32-sos-bootstrap-gnu.json rename to targets/x86_32-sos-bootstrap-gnu.json diff --git a/x86_64-sos-kernel-gnu.json b/targets/x86_64-sos-kernel-gnu.json similarity index 100% rename from x86_64-sos-kernel-gnu.json rename to targets/x86_64-sos-kernel-gnu.json