-
Notifications
You must be signed in to change notification settings - Fork 67
build: standalone build #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,208 @@ | ||||||
| # Available arguments: | ||||||
| # * General options: | ||||||
| # - `ARCH`: Target architecture: x86_64, riscv64, aarch64, loongarch64 | ||||||
| # - `MYPLAT`: Package name of the target platform crate. | ||||||
| # - `PLAT_CONFIG`: Path to the platform configuration file. | ||||||
| # - `SMP`: Override maximum CPU number specified in the platform config. For | ||||||
| # statically configured platforms, this is also the number of CPUs to boot | ||||||
| # and for platforms with runtime CPU detection, this is the upper limit of | ||||||
| # CPUs. | ||||||
| # - `MODE`: Build mode: release, debug | ||||||
| # - `LOG:` Logging level: warn, error, info, debug, trace | ||||||
| # - `V`: Verbose level: (empty), 1, 2 | ||||||
| # - `TARGET_DIR`: Artifact output directory (cargo target directory) | ||||||
| # - `EXTRA_CONFIG`: Extra config specification file | ||||||
| # - `OUT_CONFIG`: Final config file that takes effect | ||||||
| # - `UIMAGE`: To generate U-Boot image | ||||||
| # - `LD_SCRIPT`: Use a custom linker script file. | ||||||
| # * App options: | ||||||
| # - `A` or `APP`: Path to the application | ||||||
| # - `FEATURES`: Features os ArceOS modules to be enabled. | ||||||
| # - `APP_FEATURES`: Features of (rust) apps to be enabled. | ||||||
| # * QEMU options: | ||||||
| # - `BLK`: Enable storage devices (virtio-blk) | ||||||
| # - `NET`: Enable network devices (virtio-net) | ||||||
| # - `GRAPHIC`: Enable display devices and graphic output (virtio-gpu) | ||||||
| # - `BUS`: Device bus type: mmio, pci | ||||||
| # - `MEM`: Memory size (default is 128M) | ||||||
| # - `DISK_IMG`: Path to the virtual disk image | ||||||
| # - `ACCEL`: Enable hardware acceleration (KVM on linux) | ||||||
| # - `QEMU_LOG`: Enable QEMU logging (log file is "qemu.log") | ||||||
| # - `NET_DUMP`: Enable network packet dump (log file is "netdump.pcap") | ||||||
| # - `NET_DEV`: QEMU netdev backend types: user, tap, bridge | ||||||
| # - `VFIO_PCI`: PCI device address in the format "bus:dev.func" to passthrough | ||||||
| # - `VHOST`: Enable vhost-net for tap backend (only for `NET_DEV=tap`) | ||||||
| # * Network options: | ||||||
| # - `IP`: ArceOS IPv4 address (default is 10.0.2.15 for QEMU user netdev) | ||||||
| # - `GW`: Gateway IPv4 address (default is 10.0.2.2 for QEMU user netdev) | ||||||
|
|
||||||
| # General options | ||||||
| ARCH ?= x86_64 | ||||||
| MYPLAT ?= | ||||||
| PLAT_CONFIG ?= | ||||||
| SMP ?= | ||||||
| MODE ?= release | ||||||
| LOG ?= warn | ||||||
| V ?= | ||||||
| DWARF ?= | ||||||
| LTO ?= | ||||||
| TARGET_DIR ?= $(PWD)/target | ||||||
| EXTRA_CONFIG ?= | ||||||
| OUT_CONFIG ?= $(PWD)/.axconfig.toml | ||||||
| UIMAGE ?= n | ||||||
|
|
||||||
| # App options | ||||||
| A ?= examples/helloworld | ||||||
|
||||||
| A ?= examples/helloworld | |
| A ?= . |
Copilot
AI
Feb 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clean depends on clean_c, but no clean_c target/rule is provided in the current make system. This makes make clean fail with “No rule to make target 'clean_c'”; either define clean_c (likely in the missing build_c.mk) or remove it from the prerequisite list.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,86 @@ | ||||||
| # Main building script | ||||||
|
|
||||||
| include cargo.mk | ||||||
|
|
||||||
| ifeq ($(APP_TYPE), c) | ||||||
| include build_c.mk | ||||||
|
||||||
| include build_c.mk | |
| $(error C app builds are not supported in this repository (missing make/build_c.mk)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Cargo features and build args | ||
|
|
||
| ifeq ($(V),1) | ||
| verbose := -v | ||
| else ifeq ($(V),2) | ||
| verbose := -vv | ||
| else | ||
| verbose := | ||
| endif | ||
|
|
||
| build_args-release := --release | ||
|
|
||
| build_args := \ | ||
| -Z unstable-options \ | ||
| --target $(TARGET) \ | ||
| --target-dir $(TARGET_DIR) \ | ||
| $(build_args-$(MODE)) \ | ||
| $(verbose) | ||
|
|
||
| RUSTFLAGS_LINK_ARGS := -C link-arg=-T$(LD_SCRIPT) -C link-arg=-no-pie -C link-arg=-znostart-stop-gc | ||
| RUSTDOCFLAGS := -Z unstable-options --enable-index-page -D rustdoc::broken_intra_doc_links | ||
|
|
||
| ifeq ($(MAKECMDGOALS), doc_check_missing) | ||
| RUSTDOCFLAGS += -D missing-docs | ||
| endif | ||
|
|
||
| define cargo_build | ||
| $(call run_cmd,cargo -C $(1) build,$(build_args) --features "$(strip $(2))") | ||
| endef |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||||||||||
| # Config generation | ||||||||||||||
|
|
||||||||||||||
| config_args := \ | ||||||||||||||
| defconfig.toml $(PLAT_CONFIG) $(EXTRA_CONFIG) \ | ||||||||||||||
| -w 'arch="$(ARCH)"' \ | ||||||||||||||
| -w 'platform="$(PLAT_NAME)"' \ | ||||||||||||||
| -o "$(OUT_CONFIG)" | ||||||||||||||
|
|
||||||||||||||
| ifneq ($(MEM),) | ||||||||||||||
| config_args += -w 'plat.phys-memory-size=$(shell ./strtosz.py $(MEM))' | ||||||||||||||
|
||||||||||||||
| config_args += -w 'plat.phys-memory-size=$(shell ./strtosz.py $(MEM))' | |
| MEM_PARSED := $(shell ./strtosz.py $(MEM)) | |
| ifeq ($(MEM_PARSED),) | |
| $(error "Failed to parse MEM='$(MEM)'. Please specify a valid memory size (e.g. 1G, 512M).") | |
| endif | |
| config_args += -w 'plat.phys-memory-size=$(MEM_PARSED)' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Stack size of each task. | ||
| task-stack-size = 0x40000 # uint | ||
|
|
||
| # Number of timer ticks per second (Hz). A timer tick may contain several timer | ||
| # interrupts. | ||
| ticks-per-sec = 100 # uint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc comment typo: “Features os ArceOS modules” should be “Features of ArceOS modules”.