asterinas/Makefile

66 lines
1.4 KiB
Makefile
Raw Normal View History

# Make arguments and their defaults
AUTO_SYSCALL_TEST ?= 0
BUILD_SYSCALL_TEST ?= 0
EMULATE_IOMMU ?= 0
ENABLE_KVM ?= 1
# End of Make arguments
KERNEL_CMDLINE := SHELL="/bin/sh" LOGNAME="root" HOME="/" USER="root" PATH="/bin" init=/usr/bin/busybox -- sh -l
ifeq ($(AUTO_SYSCALL_TEST), 1)
KERNEL_CMDLINE += /opt/syscall_test/run_syscall_test.sh
endif
CARGO_KRUN_ARGS := -- '$(KERNEL_CMDLINE)'
ifeq ($(ENABLE_KVM), 1)
CARGO_KRUN_ARGS += --enable-kvm
endif
ifeq ($(EMULATE_IOMMU), 1)
CARGO_KRUN_ARGS += --emulate-iommu
endif
ifeq ($(AUTO_SYSCALL_TEST), 1)
BUILD_SYSCALL_TEST := 1
endif
# Pass make variables to all subdirectory makes
export
.PHONY: all setup build tools run test docs check clean
2022-08-08 22:43:47 +00:00
2023-04-10 03:12:42 +00:00
all: build
2022-08-08 22:43:47 +00:00
2022-08-17 03:22:49 +00:00
setup:
@rustup component add rust-src
2023-02-07 08:05:21 +00:00
@rustup component add rustc-dev
2022-08-17 03:22:49 +00:00
@rustup component add llvm-tools-preview
@cargo install mdbook
2022-08-08 22:43:47 +00:00
build:
2023-05-29 05:29:53 +00:00
@make --no-print-directory -C regression
2023-04-10 03:12:42 +00:00
@cargo kbuild
2022-08-17 03:22:49 +00:00
2023-02-07 08:05:21 +00:00
tools:
2023-04-10 03:12:42 +00:00
@cd services/libs/comp-sys && cargo install --path cargo-component
2023-02-07 08:05:21 +00:00
2022-08-17 03:22:49 +00:00
run: build
@cargo krun $(CARGO_KRUN_ARGS)
2022-08-08 22:43:47 +00:00
test: build
2023-04-10 03:12:42 +00:00
@cargo ktest
2022-08-08 22:43:47 +00:00
docs:
2023-04-10 03:12:42 +00:00
@cargo doc # Build Rust docs
2022-08-08 22:43:47 +00:00
@echo "" # Add a blank line
2022-08-08 23:02:55 +00:00
@cd docs && mdbook build # Build mdBook
2022-08-08 22:43:47 +00:00
2022-08-08 23:02:55 +00:00
check:
2023-09-04 03:04:42 +00:00
@cargo fmt --check # Check Rust format issues
@cargo kclippy -- -D warnings # Make build fail if any warnings are found by rustc and clippy
2022-08-08 22:43:47 +00:00
clean:
2023-04-10 03:12:42 +00:00
@cargo clean
2022-08-17 03:22:49 +00:00
@cd docs && mdbook clean
2023-05-29 05:29:53 +00:00
@make --no-print-directory -C regression clean