mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
5
Makefile
5
Makefile
@@ -13,10 +13,11 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
arch ?= x86_64
|
arch ?= x86_64
|
||||||
|
target ?= $(arch)-unknown-linux-gnu
|
||||||
kernel := build/kernel-$(arch).bin
|
kernel := build/kernel-$(arch).bin
|
||||||
iso := build/os-$(arch).iso
|
iso := build/os-$(arch).iso
|
||||||
|
|
||||||
rust_os := target/debug/libblog_os.a
|
rust_os := target/$(target)/debug/libblog_os.a
|
||||||
linker_script := src/arch/$(arch)/linker.ld
|
linker_script := src/arch/$(arch)/linker.ld
|
||||||
grub_cfg := src/arch/$(arch)/grub.cfg
|
grub_cfg := src/arch/$(arch)/grub.cfg
|
||||||
assembly_source_files := $(wildcard src/arch/$(arch)/*.asm)
|
assembly_source_files := $(wildcard src/arch/$(arch)/*.asm)
|
||||||
@@ -47,7 +48,7 @@ $(kernel): cargo $(rust_os) $(assembly_object_files) $(linker_script)
|
|||||||
@ld -n --gc-sections -T $(linker_script) -o $(kernel) $(assembly_object_files) $(rust_os)
|
@ld -n --gc-sections -T $(linker_script) -o $(kernel) $(assembly_object_files) $(rust_os)
|
||||||
|
|
||||||
cargo:
|
cargo:
|
||||||
@cargo rustc -- -Z no-landing-pads
|
@cargo rustc --target $(target) -- -Z no-landing-pads
|
||||||
|
|
||||||
# compile assembly files
|
# compile assembly files
|
||||||
build/arch/$(arch)/%.o: src/arch/$(arch)/%.asm
|
build/arch/$(arch)/%.o: src/arch/$(arch)/%.asm
|
||||||
|
|||||||
Reference in New Issue
Block a user