Skip to content

Commit

Permalink
Add make defconfig & oldconfig, cache AX_ROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
equation314 committed Dec 25, 2024
1 parent 57c8074 commit 7ca578c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,19 @@ jobs:
- name: Build c/redis for x86_64-pc-oslab
run: make PLATFORM=x86_64-pc-oslab A=c/redis FEATURES=driver-ixgbe,driver-ramdisk SMP=4

- run: make PLATFORM=aarch64-raspi4 defconfig
- name: Build rust/helloworld for aarch64-raspi4
run: make PLATFORM=aarch64-raspi4 A=rust/helloworld
run: make PLATFORM=aarch64-raspi4 SMP=4 A=rust/helloworld
- name: Build rust/fs/shell for aarch64-raspi4
run: make PLATFORM=aarch64-raspi4 A=rust/fs/shell FEATURES=driver-bcm2835-sdhci
run: make PLATFORM=aarch64-raspi4 SMP=4 A=rust/fs/shell FEATURES=driver-bcm2835-sdhci BUS=mmio

- run: make PLATFORM=aarch64-bsta1000b defconfig
- name: Build rust/helloworld for aarch64-bsta1000b
run: make PLATFORM=aarch64-bsta1000b A=rust/helloworld
run: make PLATFORM=aarch64-bsta1000b SMP=8 A=rust/helloworld

- run: make PLATFORM=aarch64-phytium-pi defconfig
- name: Build rust/helloworld for aarch64-phytium-pi
run: make PLATFORM=aarch64-phytium-pi SMP=4 A=rust/helloworld

build-for-std:
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/.vscode
/.arceos
/.cargo
/.axconfig.*
/.axroot
.DS_Store
Cargo.lock
*.o
Expand Down
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
A ?= rust/helloworld
AX_ROOT ?= $(PWD)/.arceos
AX_ROOT ?= $(shell cat .axroot 2>/dev/null)

APP := $(A)
ifeq ($(filter /%,$(A)),)
Expand All @@ -8,12 +8,14 @@ ifeq ($(filter /%,$(A)),)
endif
endif

$(if $(V), $(info AX_ROOT: "$(AX_ROOT)"))

all: build

ax_root:
chaxroot:
@./scripts/set_ax_root.sh $(AX_ROOT)

build run justrun debug disasm disk_img clean clean_c: ax_root
defconfig oldconfig build run justrun debug disasm disk_img clean clean_c:
@make -C $(AX_ROOT) A=$(APP) $@

test:
Expand All @@ -23,4 +25,4 @@ else
@./scripts/app_test.sh
endif

.PHONY: all ax_root build run justrun debug disasm disk_img clean clean_c test
.PHONY: all chaxroot defconfig oldconfig build run justrun debug disasm disk_img clean clean_c test
5 changes: 1 addition & 4 deletions scripts/get_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
AX_ROOT=.arceos

test ! -d "$AX_ROOT" && echo "Cloning repositories ..." || true
test ! -d "$AX_ROOT" && git clone https://github.com/arceos-org/arceos "$AX_ROOT" --depth=1 || true

echo "Copying Cargo.lock ..."
cp "$AX_ROOT/Cargo.lock" Cargo.lock
test ! -d "$AX_ROOT" && git clone https://github.com/arceos-org/arceos -b new-axconfig "$AX_ROOT" --depth=1 || true

$(dirname $0)/set_ax_root.sh $AX_ROOT
3 changes: 3 additions & 0 deletions scripts/set_ax_root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ mkdir -p .cargo
sed -e "s|%AX_ROOT%|$AX_ROOT|g" scripts/config.toml.temp > .cargo/config.toml

echo "Set AX_ROOT (ArceOS directory) to $AX_ROOT"

cp "$AX_ROOT/Cargo.lock" Cargo.lock
echo "$1" > .axroot

0 comments on commit 7ca578c

Please sign in to comment.